refactor: move manager initialization from trait method to constructors #467
Draft
xdustinface wants to merge 4 commits intov0.42-devfrom
Draft
refactor: move manager initialization from trait method to constructors #467xdustinface wants to merge 4 commits intov0.42-devfrom
xdustinface wants to merge 4 commits intov0.42-devfrom
Conversation
commit a138810 Author: xdustinface <xdustinfacex@gmail.com> Date: Thu Feb 12 20:03:27 2026 +0100 feat: report/propagate client start/run failures 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. commit dfb0355 Author: xdustinface <xdustinfacex@gmail.com> Date: Wed Feb 18 20:42:01 2026 +0100 refactor: cleanup `DashSpvClient` to have single `run()` entry point Combine `start()` + `monitor_network()` + `stop()` into a single `run(token)` entry point. Callers no longer need to call `start()` separately since `run()` handles the full lifecycle and returns after the token is cancelled. - Make `start()` an internal function - Remove `monitor_network()` its loop is now inside `run()` - Remove `dash_spv_ffi_client_start` so that `dash_spv_ffi_client_run` is the only FFI entry point - Move ctrl-c handling out of the client
commit 1d16871 Author: xdustinface <xdustinfacex@gmail.com> Date: Sat Feb 21 13:34:13 2026 +0100 refactor: remove `SyncState::Initializing` variant The `Initializing` state was only used as a default before `initialize()` was called. Replace it with `WaitForEvents` as the default state to simplify the state machine.
commit 4220038 Author: xdustinface <xdustinfacex@gmail.com> Date: Sat Feb 21 14:04:22 2026 +0100 refactor: add `ensure_not_started()` guard Add a state guard that returns an error if a manager's sync has already been started, and use it in `start_sync()` implementations instead of inline state checks.
- 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.
Contributor
|
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)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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