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Β§
- diagnostics π
- Syncer state published for stall diagnosis.
- 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. - hedge π
- Preserve a live hedge arm when its sibling exhausts its retries.
- 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Β§
- Chain
Sync - Checked
Tip π - Helps work around defects in the bitcoin protocol by checking whether the returned hashes actually extend a chain tip.
- Config
- Sync configuration section.
- Recent
Sync Lengths - 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.
- Restart
Error π - A sync round that ended early, and why.
- Sync
Status - A helper type to determine if the synchronizer has likely reached the chain tip.
EnumsΒ§
- Block
Gossip Error - 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_ πROUND_ TIMEOUT - Bounds one complete block download round, including readiness, capacity waits and both hedges.
- BLOCK_
DOWNLOAD_ πTIMEOUT - The per-peer wire-response budget used to derive complete download deadlines.
- 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.
- EXTEND_
TIP_ πROUNDS - How many rounds of
FANOUTrequestsextend_tipssends for a tip before dropping it, when no peer answers a round. - 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.
- KNOWN_
BLOCK_ πCHECK_ CONCURRENCY - Limits concurrent discovery membership checks against the shared state service.
- MAX_
BLOCK_ πREOBTAIN_ RETRIES - Controls how many times the syncer will re-request a block whose download
failed because no peer delivered it (a
NotFound), before giving up and letting the normal tip re-walk handle it. - 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.
- MIN_
UTXO_ πRACE_ DROPS_ BEFORE_ RESTART - The fewest
TransparentInputNotFounddrops without a verified block before the sync restarts, so a lowfull_verify_concurrency_limitcanβt disable the #11168 exemption. - PEER_
GOSSIP_ DELAY - Controls how long we wait between gossiping successive batches of 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. - interleave_
peer_ πhashes - Orders tip response hashes round-robin across responses, so each peerβs next hash is admitted before any peerβs later hashes when the lookahead limit caps the batch.
- is_
not_ πfound - Match the missing-block errors used by both hedging and sync recovery.
- record_
tip_ block_ delay - Records how long after its header time each new best chain tip block was committed, with the blockβs network upgrade once the network this node runs on is known, and sends each value to Sentry with the blockβs height.
- 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.