Expand description
Contains the state of the chain synchronization process
At any given point in time, a running node tries as much as possible to be at the head of the chain. This module handles the logic of which blocks to request from remotes, and processing responses. It yields blocks to check and potentially move to the database.
§Usage
The ChainSync struct maintains the state of the block requests. Whenever something happens on
the network, or whenever a block has been successfully verified, call the appropriate method in
order to update it.
Structs§
- Chain
Sync - The main data structure which contains all the state for a chains active syncing strategy.
Enums§
- Chain
Sync Mode - Sync operation mode.
- GapSync
Body Policy - Which block bodies gap sync downloads while backfilling the block history below a warp-synced block.
Functions§
- validate_
blocks - Validate that the given
blocksare correct. Returns the number of the first block in the sequence.
Type Aliases§
- GapSync
Body Policy Provider - Resolves the
GapSyncBodyPolicylazily, when aChainSyncinstance is created.