Module sync

Source
Expand description

The syncer downloads and verifies large numbers of blocks from peers to Zebra.

It is used when Zebra is a long way behind the current chain tip.

ModulesΒ§

downloads πŸ”’
A download stream for Zebra’s block syncer.
end_of_support
End of support checking task.
gossip πŸ”’
A task that gossips newly verified block::Hashes to peers.
progress πŸ”’
Progress tracking for blockchain syncing.
recent_sync_lengths πŸ”’
A channel which holds a list of recent syncer response lengths.
status πŸ”’
Syncer chain tip status, based on recent block locator responses from peers.

StructsΒ§

ChainSync
CheckedTip πŸ”’
Helps work around defects in the bitcoin protocol by checking whether the returned hashes actually extend a chain tip.
Config
Sync configuration section.
RecentSyncLengths
A helper type which holds a list of recent syncer response lengths. These sync lengths can be used to work out if Zebra has reached the end of the chain.
SyncStatus
A helper type to determine if the synchronizer has likely reached the chain tip.

EnumsΒ§

BlockGossipError
Errors that can occur when gossiping committed blocks

ConstantsΒ§

BLOCK_DOWNLOAD_RETRY_LIMIT πŸ”’
Controls how many times we will retry each block download.
BLOCK_DOWNLOAD_TIMEOUT πŸ”’
Controls how long we wait for a block download request to complete.
BLOCK_VERIFY_TIMEOUT πŸ”’
Controls how long we wait for a block verify request to complete.
DEFAULT_CHECKPOINT_CONCURRENCY_LIMIT
The default for the user-specified lookahead limit.
FANOUT πŸ”’
Controls the number of peers used for each ObtainTips and ExtendTips request.
FINAL_CHECKPOINT_BLOCK_VERIFY_TIMEOUT πŸ”’
A shorter timeout used for the first few blocks after the final checkpoint.
FINAL_CHECKPOINT_BLOCK_VERIFY_TIMEOUT_LIMIT πŸ”’
The number of blocks after the final checkpoint that get the shorter timeout.
GENESIS_TIMEOUT_RETRY πŸ”’
Controls how long we wait to retry a failed attempt to download and verify the genesis block.
MAX_TIPS_RESPONSE_HASH_COUNT
The expected maximum number of hashes in an ObtainTips or ExtendTips response.
MIN_CHECKPOINT_CONCURRENCY_LIMIT
A lower bound on the user-specified checkpoint verification concurrency limit.
MIN_CONCURRENCY_LIMIT
A lower bound on the user-specified concurrency limit.
PEER_GOSSIP_DELAY
Controls how long we wait between gossiping successive blocks or transactions.
SYNC_RESTART_DELAY πŸ”’
Controls how long we wait to restart syncing after finishing a sync run.
TIPS_RESPONSE_TIMEOUT
Controls how long we wait for a tips response to return.
VERIFICATION_PIPELINE_SCALING_MULTIPLIER
A multiplier used to calculate the extra number of blocks we allow in the verifier, state, and block commit pipelines, on top of the lookahead limit.

FunctionsΒ§

gossip_best_tip_block_hashes
Run continuously, gossiping newly verified block::Hashes to peers.
show_block_chain_progress
Logs Zebra’s estimated progress towards the chain tip every minute or so, and updates a terminal progress bar every few seconds.