Crate sc_network_sync

source ·
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.

Re-exports

Modules

  • Helper for handling (i.e. answering) block requests from a remote peer via the crate::request_responses::RequestResponsesBehaviour.
  • SyncingEngine is the actor responsible for syncing Substrate chain to tip and keep the blockchain up to date with network updates.
  • Contains a mock implementation of ChainSync that can be used for testing calls made to ChainSync.
  • ChainSync-related service code
  • State sync support.
  • Helper for handling (i.e. answering) state requests from a remote peer via the crate::request_responses::RequestResponsesBehaviour.
  • Warp sync support.
  • Helper for handling (i.e. answering) grandpa warp sync requests from a remote peer.

Structs

  • The main data structure which contains all the state for a chains active syncing strategy.
  • All the data we have about a Peer that we are trying to sync with

Enums

  • The ancestor search state expresses which algorithm, and its stateful parameters, we are using to try to find an ancestor block
  • The state of syncing between a Peer and ourselves.