IBD state management de-coupled from PeerManager#497
Open
Sansh2356 wants to merge 1 commit into
Open
Conversation
Adding IBD state management separating the need for coupling it with PeerManager instead keeping both the sync state separated from the PeerInfo . I have add a sync module comprising of `RetryPolicy`, `PeerState` and `SyncEvent` that will emit `SyncActions` according to each req/resp cycle in batched pages along with sequnetially forwarding IBD state with respect to sync peer. This will replace the current in account `IBD_MANAGER` module to into more distributed modules as mentioned above for better management and coupling.
There was a problem hiding this comment.
Pull request overview
Adds a new sans-I/O IBD sync engine under node::sync, aiming to decouple IBD state from PeerManager/PeerInfo and introduce bounded retry/backoff behavior while keeping the wire protocol unchanged (single-peer sync target).
Changes:
- Introduces
SyncEnginestate machine (SyncEvent→SyncAction) for IBD request/response driving, batching, and peer drop/retry scheduling. - Adds
RetryPolicyexponential backoff + retry ceiling tracking, andSyncPeerStateto hold per-sync-target cursors (tips, hash queue, offset). - Exposes the new
syncmodule fromnode/src/lib.rs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| node/src/sync/mod.rs | New IBD state machine (events/actions), batching rules, hash-page pruning, retry/exhaustion tracking. |
| node/src/sync/retry.rs | Defines exponential backoff retry policy used by the engine. |
| node/src/sync/peer_state.rs | Holds per-active-peer sync cursors (tips, queue, offset). |
| node/src/lib.rs | Exports the new sync module. |
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.
PeerManager/PeerInfoand setting up to replace the currentibd_managermodule. Single-peer sync target, wire protocol unchanged.Retryengine for each of the request being timed out after specific intervals but capped with maximum number of retries to avoid retry loop increasing overload on the executing thread .