Skip to content

refactor: Rename SequentialSyncManager to SyncManager#235

Merged
xdustinface merged 1 commit into
v0.41-devfrom
refactor/rename-sequential-sync-manager
Dec 4, 2025
Merged

refactor: Rename SequentialSyncManager to SyncManager#235
xdustinface merged 1 commit into
v0.41-devfrom
refactor/rename-sequential-sync-manager

Conversation

@xdustinface

@xdustinface xdustinface commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

Just since that is the only sync manager we have and should focus on for time being i think.

Summary by CodeRabbit

  • Refactor

    • Improved internal component naming and organization for better code clarity.
    • Updated architecture documentation to reflect structural changes.
  • Documentation

    • Enhanced synchronization phase documentation with additional phase details.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Public API rename from SequentialSyncManager to SyncManager across the codebase with structural enhancements including expanded constructor parameters, additional fields in SyncManager, and a new running flag in FilterSyncCoordinator. Documentation updated to reflect terminology changes.

Changes

Cohort / File(s) Change Summary
Documentation Updates
dash-spv/ARCHITECTURE.md, dash-spv/CLAUDE.md
References to SequentialSyncManager replaced with SyncManager. Extended synchronization phases documentation to include Phase 4: Filters and Phase 5: Blocks.
Core Manager Struct
dash-spv/src/sync/sequential/manager.rs
Public struct renamed from SequentialSyncManager<S, N, W> to SyncManager<S, N, W>. Struct expanded with new fields: current_phase, transition_manager, header_sync, filter_sync, masternode_sync, config, phase_history, sync_start_time, phase_timeout, max_phase_retries, current_phase_retries, wallet, stats.
Manager Implementation Blocks
dash-spv/src/sync/sequential/lifecycle.rs, dash-spv/src/sync/sequential/message_handlers.rs, dash-spv/src/sync/sequential/phase_execution.rs, dash-spv/src/sync/sequential/post_sync.rs
Impl blocks updated to target SyncManager<S, N, W> instead of SequentialSyncManager<S, N, W>. Imports adjusted accordingly.
Module Re-export
dash-spv/src/sync/sequential/mod.rs
Public export changed from pub use manager::SequentialSyncManager; to pub use manager::SyncManager;.
Client Core Struct
dash-spv/src/client/core.rs
Field type and test accessor updated: sync_manager: SequentialSyncManager<S, N, W>sync_manager: SyncManager<S, N, W>. Import updated.
Client Lifecycle
dash-spv/src/client/lifecycle.rs
Constructor call updated to SyncManager::new() with expanded parameters: now includes state.clone() and stats.clone() in addition to existing arguments.
Filter Sync Coordinator
dash-spv/src/client/filter_sync.rs
Field type changed from &'a mut SequentialSyncManager<S, N, W> to &'a mut SyncManager<S, N, W>. New public field added: running: &'a Arc<RwLock<bool>>. Constructor parameter and import updated.
Message Handler
dash-spv/src/client/message_handler.rs, dash-spv/src/client/message_handler_test.rs
Field and constructor parameter types updated from SequentialSyncManager<S, N, W> to SyncManager<S, N, W>. Imports adjusted.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Areas requiring extra attention:

  • dash-spv/src/sync/sequential/manager.rs — Verify that all newly added struct fields are properly initialized and documented
  • dash-spv/src/client/lifecycle.rs — Confirm that SyncManager::new() constructor correctly accepts and utilizes the new state and stats parameters
  • dash-spv/src/client/filter_sync.rs — Validate the new running field integration and its usage in sync_and_check_filters logic
  • Cross-file consistency — Ensure all type references and imports are consistently updated across the 15+ affected files

Suggested reviewers

  • PastaPastaPasta
  • QuantumExplorer

Poem

🐰 A manager reborn, Sequential no more,
Now simply SyncManager knocks at the door!
With phases and stats, the structure grows strong,
This refactor was needed, been waiting so long! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: renaming SequentialSyncManager to SyncManager across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/rename-sequential-sync-manager

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
dash-spv/CLAUDE.md (1)

27-30: Docs now correctly reference SyncManager and still emphasize sequential phases

The terminology update from the old manager name to SyncManager is consistent and still clearly describes the sequential, phase-based sync design expected in dash-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 new SyncManager::new API

The import and tuple return type updates to SyncManager are consistent with the core rename, but SyncManager::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::new call to pass the additional parameters now required by the lifecycle constructor (wallet, chain_state, stats) and construct those values in setup_test_components.

dash-spv/src/sync/sequential/manager.rs (1)

21-21: Consider updating surrounding docs/guidelines that still name SequentialSyncManager

This file now exposes SyncManager as the sequential, phase-based sync coordinator, but the higher-level guidelines and prior docs still refer to SequentialSyncManager as the canonical type for sequential sync. It may be worth explicitly stating here (or in sync/sequential/mod.rs / CLAUDE.md) that SyncManager is 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 name

The switch to SyncManager::new with the extra state.clone() and stats.clone() arguments is consistent with the manager’s expanded API and existing SpvStats/filter-heights wiring. For clarity, you might also update the log line "Creating sequential sync manager" to mention SyncManager (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: Align sync_filters_range with the new running precondition for consistency

Now that sync_and_check_filters refuses to run when the client is not marked as running, sync_filters_range still allowing calls in a stopped state might be surprising (and could be invoked before start() connects the network). If both entry points are meant to have the same lifecycle assumptions, consider adding the same running check to sync_filters_range as 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

📥 Commits

Reviewing files that changed from the base of the PR and between 180209c and 60c3378.

📒 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 in src/; unit tests live alongside code with #[cfg(test)]
Maintain MSRV of 1.89 for Rust code
Format Rust code with rustfmt (see rustfmt.toml); run cargo fmt --all before commits
Lint Rust code with clippy; avoid unwrap()/expect() in library code; use error types (e.g., thiserror)
Use snake_case for function and variable names in Rust
Use UpperCamelCase for types and traits in Rust
Use SCREAMING_SNAKE_CASE for constants in Rust
Follow mixed editions (2021/2024) and crate-specific idioms; prefer async via tokio where 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 -- --ignored flag
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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-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 with SequentialSyncManager for organized sync phases
Use state machines with SyncState enum to drive synchronization flow and state transitions

Files:

  • dash-spv/src/sync/sequential/post_sync.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-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.rs
  • dash-spv/src/sync/sequential/mod.rs
  • dash-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.rs
  • dash-spv/src/sync/sequential/message_handlers.rs
  • dash-spv/src/sync/sequential/phase_execution.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/sync/sequential/lifecycle.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/client/message_handler_test.rs
  • dash-spv/src/client/message_handler.rs
  • dash-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.rs
  • dash-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.rs
  • dash-spv/src/sync/sequential/manager.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/filter_sync.rs
  • dash-spv/ARCHITECTURE.md
  • dash-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.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-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.rs
  • dash-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.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-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.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-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.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/filter_sync.rs
  • 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: 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.md
  • dash-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 target SyncManager

The switch from SequentialSyncManager to SyncManager in 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 to SyncManager

Updating the import and impl to use SyncManager is 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 to SyncManager without behavior change

The renamed import and impl target cleanly move phase execution, transition, and timeout logic onto SyncManager while preserving the existing state-machine behavior.

dash-spv/src/sync/sequential/mod.rs (1)

45-47: Public re‑export rename changes external API surface

Re‑exporting SyncManager instead of SequentialSyncManager is 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 for v0.41-dev explicitly account for this rename.

dash-spv/src/sync/sequential/lifecycle.rs (1)

1-26: Lifecycle impl correctly retargeted to SyncManager

The updated module doc, import, and impl header bring the lifecycle code in line with the new SyncManager type 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 on SyncManager with unchanged behavior

Switching 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 consistent

The 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 consistently

The import, sync_manager field type, documentation note, and sync_manager_mut test accessor are all updated to use SyncManager<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 rename

The ASCII architecture diagram, data-flow description, and module listing now all refer to SyncManager as 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 correct

The coordinator now cleanly depends on SyncManager<S, N, W> (import, field, and constructor) and reuses its wallet/config helpers exactly as before. The added running: &Arc<RwLock<bool>> plus the early running check in sync_and_check_filters correctly 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 using filter_sync_mut().sync_filters_with_flow_control remains unchanged and type-safe.

Also applies to: 14-20, 30-44, 57-66, 140-170

@xdustinface
xdustinface merged commit c113987 into v0.41-dev Dec 4, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants