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.