Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Checkpoint-based block verification.

Checkpoint-based verification uses a list of checkpoint hashes to speed up the initial chain sync for Zebra. This list is distributed with Zebra.

The checkpoint verifier queues pending blocks. Once there is a chain from the previous checkpoint to a target checkpoint, it verifies all the blocks in that chain, and sends accepted blocks to the state service as finalized chain state, skipping the majority of contextual verification checks.

Verification starts at the first checkpoint, which is the genesis block for the configured network.

Admission also counts accepted commit owners until completion, including cancelled requests and failure recovery. The count allows four candidates per configured checkpoint gap or 2,000 bodies (two default sync batches), whichever is greater. Only queued bodies have the additional byte limit; these bounds are not process-RSS caps.

Modulesยง

types ๐Ÿ”’
Supporting types for checkpoint-based block verification

Structsยง

CheckpointVerifier
A checkpointing block verifier.
CommitFailure ๐Ÿ”’
A failed checkpoint block commit, sent from its commit task to the verifier.
QueuedBlock ๐Ÿ”’
An unverified block, which is in the queue for checkpoint verification.
RetainedBlockPermit ๐Ÿ”’
A lifetime reservation shared by queued blocks and accepted commit tasks.
Verified ๐Ÿ”’
A checkpoint verified block, ready to be committed to the state.

Enumsยง

VerifyCheckpointError

Constantsยง

MAX_CHECKPOINT_BYTE_COUNT
We limit the memory usage and download contention for each checkpoint, based on the cumulative size of the serialized blocks in the chain.
MAX_CHECKPOINT_HEIGHT_GAP
We limit the maximum number of blocks in each checkpoint. Each block uses a constant amount of memory for the supporting data structures and futures.
MAX_QUEUED_BLOCKS_PER_HEIGHT
The maximum number of queued blocks at any one height.
MAX_QUEUED_BYTES ๐Ÿ”’
The maximum estimated memory used by the blocks queued for checkpoint verification, in bytes.

Functionsยง

progress_from_tip ๐Ÿ”’
Convert a tip into its hash and matching progress.

Type Aliasesยง

QueuedBlockList ๐Ÿ”’
A list of unverified blocks at a particular height.