Skip to content

refactor: move manager initialization from trait method to constructors #467

Draft
xdustinface wants to merge 2 commits intov0.42-devfrom
refactor/move-initialization
Draft

refactor: move manager initialization from trait method to constructors #467
xdustinface wants to merge 2 commits intov0.42-devfrom
refactor/move-initialization

Conversation

@xdustinface
Copy link
Collaborator

  • Moves initialization logic out of the SyncManager::initialize() trait method and into each manager's constructor.
  • Genesis block is now stored before managers are created, so they can read the tip during construction.
  • The SyncCoordinator seeds initial progress from actual manager state instead of default and uses WatchStream::from_changes to avoid re-emitting all initial progresses.

Based on:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/move-initialization

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.

@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Feb 25, 2026
xdustinface added a commit that referenced this pull request Feb 25, 2026
Move the storage background persist worker spawn from `DiskStorageManager::new()` to a new `StorageManager::start()` trait method, called from `DashSpvClient::start()`.

This prevents a tokio task leak when clients are created and destroyed without being started in #467.
@xdustinface xdustinface force-pushed the refactor/move-initialization branch from 7d5adf1 to c85abe0 Compare February 25, 2026 03:42
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Feb 25, 2026
@xdustinface xdustinface force-pushed the refactor/move-initialization branch 5 times, most recently from d655bb3 to 27aefe4 Compare February 25, 2026 06:10
xdustinface added a commit to xdustinface/rust-dashcore that referenced this pull request Feb 25, 2026
Move the storage background persist worker spawn from `DiskStorageManager::new()` to a new `StorageManager::start()` trait method, called from `DashSpvClient::start()`.

This prevents a tokio task leak when clients are created and destroyed without being started in dashpay#467.
@xdustinface xdustinface force-pushed the refactor/move-initialization branch from 27aefe4 to e364976 Compare February 25, 2026 14:03
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Feb 25, 2026
@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface xdustinface force-pushed the refactor/move-initialization branch from e364976 to 89ab17e Compare February 25, 2026 22:40
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Feb 25, 2026
@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Feb 26, 2026
We currently just silently ignore any failure inside the sync coordinator or `monitor_network` thread. This PR propagates them and also adds a FFI callback structure which can be set to receive notifications about errors inside the SPV client.
- Moves initialization logic out of the `SyncManager::initialize()` trait method and into each manager's constructor.
- Genesis block is now stored before managers are created, so they can read the tip during construction.
- The `SyncCoordinator` seeds initial progress from actual manager state instead of default and uses `WatchStream::from_changes` to avoid re-emitting all initial progresses.
@xdustinface xdustinface force-pushed the refactor/move-initialization branch from 89ab17e to 8e08c35 Compare February 26, 2026 16:45
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Feb 26, 2026
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.

1 participant