pub trait NetworkSyncUpdater:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn update_sync_state(&self, state: SyncState);
fn update_status(&self, head: Head);
fn update_block_range(&self, update: BlockRangeUpdate);
// Provided method
fn set_fork_filter(&self, fork_filter: ForkFilter) { ... }
}Expand description
An updater for updating the SyncState and status of the network.
The node is either syncing, or it is idle.
While syncing, the node will download data from the network and process it. The processing
consists of several stages, like recovering senders, executing the blocks and indexing.
Eventually the node reaches the Finish stage and will transition to SyncState::Idle, it
which point the node is considered fully synced.
Required Methods§
Sourcefn update_sync_state(&self, state: SyncState)
fn update_sync_state(&self, state: SyncState)
Notifies about a SyncState update.
Sourcefn update_status(&self, head: Head)
fn update_status(&self, head: Head)
Updates the status of the p2p node.
Sourcefn update_block_range(&self, update: BlockRangeUpdate)
fn update_block_range(&self, update: BlockRangeUpdate)
Updates the advertised block range.
Provided Methods§
Sourcefn set_fork_filter(&self, fork_filter: ForkFilter)
fn set_fork_filter(&self, fork_filter: ForkFilter)
Replaces the node’s active ForkFilter to adopt a fork schedule that changed at runtime
(e.g. an L1-signalled upgrade) without a restart.
The caller must build fork_filter from the updated chain spec advanced to the node’s
current head, and should do so before the fork’s activation timestamp so the node
announces the upcoming fork ahead of time. Defaults to a no-op for updaters that do not
track a fork filter.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".