refactor: move manager initialization from trait method to constructors #467
refactor: move manager initialization from trait method to constructors #467xdustinface wants to merge 2 commits intov0.42-devfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
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.
7d5adf1 to
c85abe0
Compare
d655bb3 to
27aefe4
Compare
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.
27aefe4 to
e364976
Compare
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
e364976 to
89ab17e
Compare
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
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.
89ab17e to
8e08c35
Compare
SyncManager::initialize()trait method and into each manager's constructor.SyncCoordinatorseeds initial progress from actual manager state instead of default and usesWatchStream::from_changesto avoid re-emitting all initial progresses.Based on:
SyncState::Initializingvariant #465ensure_not_started()guard #466