Expand description
Block sync: allows a node that is behind to catch up by requesting missing blocks from peers and replaying the commit lifecycle.
Structs§
- Sync
State - Mutable state needed by block sync and replay.
Functions§
- query_
peer_ status - Query a peer’s status via the sync channel. Returns
Noneon timeout/error. - replay_
blocks - Replay a batch of blocks: store them and run the application lifecycle.
Validates chain continuity (parent_hash linkage).
Replay synced blocks and return any pending epoch that hasn’t reached its
start_viewyet. The caller should store this aspending_epochin the engine so the epoch transition fires at the correct view. - sync_
to_ tip - Run block sync: request missing blocks from peers and replay them.
- sync_
via_ snapshot - Attempt state sync via snapshots. Returns
Ok(true)if successful,Ok(false)if no snapshots are available (caller should fall back to block sync).