refactor: Rename SequentialSyncManager to SyncManager#235
Conversation
WalkthroughPublic API rename from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Areas requiring extra attention:
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (5)
dash-spv/CLAUDE.md (1)
27-30: Docs now correctly referenceSyncManagerand still emphasize sequential phasesThe terminology update from the old manager name to
SyncManageris consistent and still clearly describes the sequential, phase-based sync design expected indash-spv/src/sync/**/*.rs.Also applies to: 100-107, 156-163
dash-spv/src/client/message_handler_test.rs (1)
15-69: Rename is correct, but constructor call is stale for the newSyncManager::newAPIThe import and tuple return type updates to
SyncManagerare consistent with the core rename, butSyncManager::new(&config, received_filter_heights)still reflects the old constructor shape. Because this whole test module is currently commented out, it doesn’t break the build, but it will fail to compile once re-enabled.Before uncommenting these tests, you’ll need to update the
SyncManager::newcall to pass the additional parameters now required by the lifecycle constructor (wallet, chain_state, stats) and construct those values insetup_test_components.dash-spv/src/sync/sequential/manager.rs (1)
21-21: Consider updating surrounding docs/guidelines that still nameSequentialSyncManagerThis file now exposes
SyncManageras the sequential, phase-based sync coordinator, but the higher-level guidelines and prior docs still refer toSequentialSyncManageras the canonical type for sequential sync. It may be worth explicitly stating here (or insync/sequential/mod.rs/ CLAUDE.md) thatSyncManageris the sequential sync manager referenced in older docs to avoid confusion for readers cross‑referencing materials.Based on learnings, this keeps the “sequential phase-based synchronization with
SequentialSyncManager” guidance aligned with the current type name.Also applies to: 61-61
dash-spv/src/client/lifecycle.rs (1)
20-21: SyncManager initialization is sound; log message could reflect the new nameThe switch to
SyncManager::newwith the extrastate.clone()andstats.clone()arguments is consistent with the manager’s expanded API and existingSpvStats/filter-heights wiring. For clarity, you might also update the log line"Creating sequential sync manager"to mentionSyncManager(or “sequential SyncManager”) so logs line up with the current type name.Also applies to: 53-61
dash-spv/src/client/filter_sync.rs (1)
57-66: Alignsync_filters_rangewith the new running precondition for consistencyNow that
sync_and_check_filtersrefuses to run when the client is not marked as running,sync_filters_rangestill allowing calls in a stopped state might be surprising (and could be invoked beforestart()connects the network). If both entry points are meant to have the same lifecycle assumptions, consider adding the samerunningcheck tosync_filters_rangeas well, or documenting that it intentionally bypasses that precondition as a lower-level API.Also applies to: 118-138
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
dash-spv/ARCHITECTURE.md(3 hunks)dash-spv/CLAUDE.md(3 hunks)dash-spv/src/client/core.rs(3 hunks)dash-spv/src/client/filter_sync.rs(3 hunks)dash-spv/src/client/lifecycle.rs(2 hunks)dash-spv/src/client/message_handler.rs(3 hunks)dash-spv/src/client/message_handler_test.rs(3 hunks)dash-spv/src/sync/sequential/lifecycle.rs(2 hunks)dash-spv/src/sync/sequential/manager.rs(3 hunks)dash-spv/src/sync/sequential/message_handlers.rs(1 hunks)dash-spv/src/sync/sequential/mod.rs(1 hunks)dash-spv/src/sync/sequential/phase_execution.rs(1 hunks)dash-spv/src/sync/sequential/post_sync.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs: Never hardcode network parameters, addresses, or keys in Rust code
Use proper error types with thiserror crate and propagate errors appropriately in Rust code
Use tokio runtime for async operations in Rust code
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality in Rust
Format Rust code with cargo fmt before committing
Ensure clippy passes with all warnings as errors on all Rust code
**/*.rs: Each crate keeps sources insrc/; unit tests live alongside code with#[cfg(test)]
Maintain MSRV of 1.89 for Rust code
Format Rust code withrustfmt(seerustfmt.toml); runcargo fmt --allbefore commits
Lint Rust code withclippy; avoidunwrap()/expect()in library code; use error types (e.g.,thiserror)
Usesnake_casefor function and variable names in Rust
UseUpperCamelCasefor types and traits in Rust
UseSCREAMING_SNAKE_CASEfor constants in Rust
Follow mixed editions (2021/2024) and crate-specific idioms; prefer async viatokiowhere applicable
Unit tests should be placed near code with descriptive names (e.g.,test_parse_address_mainnet)
Use#[ignore]for network-dependent or long-running tests; run with-- --ignoredflag
Never commit secrets or real keys; avoid logging sensitive data in Rust code
Keep test vectors deterministic in Rust test code
Files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rs
dash-spv/src/**/*.rs
📄 CodeRabbit inference engine (dash-spv/CLAUDE.md)
dash-spv/src/**/*.rs: Use trait-based abstractions for swappable implementations (e.g.,NetworkManager,StorageManager)
Use async/await throughout the codebase with tokio runtime
Use domain-specific error types (NetworkError,StorageError,SyncError,ValidationError,SpvError) for error handling
Use trait objects (Arc<dyn StorageManager>,Arc<dyn NetworkManager>) for runtime polymorphism
Use Tokio channels for inter-component message passing
Add comprehensive unit tests in-module for individual components
Files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rs
dash-spv/src/sync/**/*.rs
📄 CodeRabbit inference engine (dash-spv/CLAUDE.md)
dash-spv/src/sync/**/*.rs: Use sequential phase-based synchronization withSequentialSyncManagerfor organized sync phases
Use state machines withSyncStateenum to drive synchronization flow and state transitions
Files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/sync/sequential/mod.rs
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/sync/**/*.rs : Use sequential phase-based synchronization with `SequentialSyncManager` for organized sync phases
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/sync/**/*.rs : Use sequential phase-based synchronization with `SequentialSyncManager` for organized sync phases
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/sync/**/*.rs : Use state machines with `SyncState` enum to drive synchronization flow and state transitions
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/**/*.rs : Use trait-based abstractions for swappable implementations (e.g., `NetworkManager`, `StorageManager`)
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/types.rs : Define common data structures in `types.rs` including `SyncProgress`, `ValidationMode`, `WatchItem`, etc.
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/**/*.rs : Use async/await throughout the codebase with tokio runtime
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/CLAUDE.md
📚 Learning: 2025-06-26T15:54:02.509Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:54:02.509Z
Learning: The `StorageManager` trait in `dash-spv/src/storage/mod.rs` uses `&mut self` methods but is also `Send + Sync`, and implementations often use interior mutability for concurrency. This can be confusing, so explicit documentation should clarify thread-safety expectations and the rationale for the API design.
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/**/*.rs : Use trait objects (`Arc<dyn StorageManager>`, `Arc<dyn NetworkManager>`) for runtime polymorphism
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/sync/sequential/mod.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/storage/**/*.rs : Implement `StorageManager` trait with segmented storage: headers in 10,000-header segments with index files, filters in separate storage, and state persistence in dedicated paths
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/client/core.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.md
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.rs : Implement new FFI functions in Rust with `#[no_mangle] extern "C"` annotation in dash-spv-ffi
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/mod.rsdash-spv/ARCHITECTURE.md
📚 Learning: 2025-06-26T16:02:42.390Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T16:02:42.390Z
Learning: Passing exclusive mutable references to network and storage managers into the sync manager in async Rust can lead to borrow checker issues or runtime contention if concurrent access is needed elsewhere. It's advisable to document this architectural tradeoff and consider refactoring to interior mutability or message passing for shared access as the codebase evolves.
Applied to files:
dash-spv/src/sync/sequential/post_sync.rsdash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/sync/sequential/phase_execution.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/message_handler.rsdash-spv/src/sync/sequential/lifecycle.rsdash-spv/src/client/core.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/**/*.rs : Use Tokio channels for inter-component message passing
Applied to files:
dash-spv/src/sync/sequential/message_handlers.rsdash-spv/src/client/message_handler_test.rsdash-spv/src/client/message_handler.rsdash-spv/ARCHITECTURE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/tests/**/*.rs : Add integration tests in the `tests/` directory for comprehensive test suites
Applied to files:
dash-spv/src/client/message_handler_test.rs
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/**/*.rs : Add comprehensive unit tests in-module for individual components
Applied to files:
dash-spv/src/client/message_handler_test.rsdash-spv/src/client/core.rs
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/tests/**/*.rs : Add real network tests with live Dash Core node integration that gracefully handle node unavailability
Applied to files:
dash-spv/src/client/message_handler_test.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function
Applied to files:
dash-spv/src/client/message_handler_test.rs
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Follow a layered architecture with clear separation of concerns: `client/`, `network/`, `storage/`, `sync/`, `validation/`, `wallet/`, `types.rs`, and `error.rs`
Applied to files:
dash-spv/src/client/message_handler_test.rsdash-spv/src/sync/sequential/manager.rsdash-spv/src/client/core.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/wallet/**/*.rs : Implement wallet functionality with UTXO tracking, balance calculation with confirmation states, and transaction processing
Applied to files:
dash-spv/src/sync/sequential/manager.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rs
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/storage/**/*.rs : Use segmented storage with headers in 10,000-header chunks stored with index files for efficient retrieval
Applied to files:
dash-spv/src/sync/sequential/manager.rs
📚 Learning: 2025-12-01T08:00:17.379Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:17.379Z
Learning: Applies to dash-spv/src/**/*.rs : Use domain-specific error types (`NetworkError`, `StorageError`, `SyncError`, `ValidationError`, `SpvError`) for error handling
Applied to files:
dash-spv/src/client/message_handler.rsdash-spv/src/client/filter_sync.rs
📚 Learning: 2025-06-26T16:01:37.609Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T16:01:37.609Z
Learning: The mempool tracking infrastructure (UnconfirmedTransaction, MempoolState, configuration, and mempool_filter.rs) is fully implemented and integrated in the Dash SPV client as of this PR, including client logic, FFI APIs, and tests.
Applied to files:
dash-spv/src/client/message_handler.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rs
📚 Learning: 2025-12-01T08:01:00.652Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/Examples/DashHDWalletExample/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:01:00.652Z
Learning: Applies to swift-dash-core-sdk/Examples/DashHDWalletExample/**/*.swift : Use DashSDK's public methods, not direct SPVClient access, when accessing SPV functionality in Swift code
Applied to files:
dash-spv/src/client/core.rsdash-spv/src/client/lifecycle.rsdash-spv/ARCHITECTURE.md
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.swift : Use actors for state management in SPVClient to ensure thread safety
Applied to files:
dash-spv/src/client/core.rsdash-spv/src/client/lifecycle.rsdash-spv/src/client/filter_sync.rsdash-spv/ARCHITECTURE.md
📚 Learning: 2025-12-01T08:01:18.174Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-01T08:01:18.174Z
Learning: Keep Rust modules focused and organized
Applied to files:
dash-spv/ARCHITECTURE.md
📚 Learning: 2025-12-01T08:01:18.174Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-01T08:01:18.174Z
Learning: Applies to **/*.rs : Follow mixed editions (2021/2024) and crate-specific idioms; prefer async via `tokio` where applicable
Applied to files:
dash-spv/ARCHITECTURE.mddash-spv/CLAUDE.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: RPC Tests (stable, true)
- GitHub Check: Core Components Tests
- GitHub Check: Key Wallet Components Tests
- GitHub Check: SPV Components Tests
- GitHub Check: fuzz (hashes_ripemd160)
- GitHub Check: fuzz (hashes_sha512)
- GitHub Check: fuzz (hashes_sha1)
- GitHub Check: fuzz (hashes_cbor)
- GitHub Check: fuzz (hashes_sha512_256)
- GitHub Check: fuzz (hashes_sha256)
- GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
- GitHub Check: fuzz (dash_deserialize_script)
- GitHub Check: fuzz (dash_deserialize_block)
- GitHub Check: fuzz (dash_deserialize_witness)
- GitHub Check: fuzz (dash_deserialize_address)
- GitHub Check: fuzz (dash_deser_net_msg)
- GitHub Check: fuzz (dash_outpoint_string)
- GitHub Check: fuzz (dash_deserialize_amount)
- GitHub Check: Pre-commit (ubuntu-latest)
- GitHub Check: Pre-commit (macos-latest)
🔇 Additional comments (10)
dash-spv/src/sync/sequential/message_handlers.rs (1)
16-24: Impl and import now properly targetSyncManagerThe switch from
SequentialSyncManagertoSyncManagerin the import and impl header is mechanically correct; all referenced fields/methods (current_phase,header_sync,filter_sync, etc.) still belong on the manager, so behavior remains unchanged while aligning with the new type name.dash-spv/src/sync/sequential/post_sync.rs (1)
13-21: Post‑sync handlers correctly moved toSyncManagerUpdating the import and impl to use
SyncManageris consistent with the core rename; post‑sync inventory, headers, filters, and masternode‑diff handling continue to hang off the same manager abstraction.dash-spv/src/sync/sequential/phase_execution.rs (1)
10-18: Phase execution logic now attached toSyncManagerwithout behavior changeThe renamed import and impl target cleanly move phase execution, transition, and timeout logic onto
SyncManagerwhile preserving the existing state-machine behavior.dash-spv/src/sync/sequential/mod.rs (1)
45-47: Public re‑export rename changes external API surfaceRe‑exporting
SyncManagerinstead ofSequentialSyncManageris consistent with the internal rename and the intent to make this the primary sync manager. It does, however, constitute a breaking change for external crates importing the old name from this module, so make sure any dependents and versioning/release notes forv0.41-devexplicitly account for this rename.dash-spv/src/sync/sequential/lifecycle.rs (1)
1-26: Lifecycle impl correctly retargeted toSyncManagerThe updated module doc, import, and impl header bring the lifecycle code in line with the new
SyncManagertype name while preserving its role as the sequential phase-based sync manager described in the architecture docs.dash-spv/src/client/message_handler.rs (1)
8-61: Message handler now depends onSyncManagerwith unchanged behaviorSwitching the import, field type, and constructor argument to
SyncManager<S, N, W>is consistent with the core rename. All existing usages (handle_message,is_synced,handle_inventory, etc.) remain valid on the renamed manager, so the client’s message routing and sync integration behavior are preserved.dash-spv/src/sync/sequential/manager.rs (1)
1-1: SyncManager rename and struct layout look consistentThe type rename to
SyncManager<S, N, W>is wired cleanly into the struct and impl, with generic bounds unchanged and all existing methods (progress helpers, phase checks, blockchain height calc) still behaving as before. No correctness or API-shape issues stand out in this file.Also applies to: 61-98, 100-252
dash-spv/src/client/core.rs (1)
23-24: Client core now references SyncManager consistentlyThe import,
sync_managerfield type, documentation note, andsync_manager_muttest accessor are all updated to useSyncManager<S, N, W>with matching generic ordering. This keeps the client’s core struct aligned with the renamed sync component without changing behavior.Also applies to: 126-136, 180-184
dash-spv/ARCHITECTURE.md (1)
95-99: Architecture docs correctly reflect the SyncManager renameThe ASCII architecture diagram, data-flow description, and module listing now all refer to
SyncManageras the central sync component, matching the codebase. The sequential role and sub‑managers are still described accurately; no further changes needed here.Also applies to: 111-112, 1011-1015
dash-spv/src/client/filter_sync.rs (1)
6-7: SyncManager integration and running guard in filter sync look correctThe coordinator now cleanly depends on
SyncManager<S, N, W>(import, field, and constructor) and reuses its wallet/config helpers exactly as before. The addedrunning: &Arc<RwLock<bool>>plus the earlyrunningcheck insync_and_check_filterscorrectly prevent filter sync from being triggered when the client is stopped, while explicitly dropping the read guard before longer async work to avoid holding the lock unnecessarily. The flow-control path usingfilter_sync_mut().sync_filters_with_flow_controlremains unchanged and type-safe.Also applies to: 14-20, 30-44, 57-66, 140-170
Just since that is the only sync manager we have and should focus on for time being i think.
Summary by CodeRabbit
Refactor
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.