Skip to main content

Module downloads

Module downloads 

Source
Expand description

A download stream that handles gossiped blocks from peers.

Structs§

AuthenticatedBlockRejected
A block from a peer that negotiated compact block relay failed later validation, after it passed the checks that authenticate it for early relay.
Downloads
Manages download and verification of blocks gossiped to this peer.
EarlyRelayAllowances 🔒
The peer groups that a block downloader didn’t score for a later validation failure of a block from a connection that negotiated compact block relay, after the block passed the checks that authenticate it for early relay, with the parent of that block.

Enums§

DownloadAction
The action taken in response to a peer’s gossiped block hash.
HeightLimitError
A gossiped block was dropped before verification because its coinbase height was outside the accepted range around the chain tip.

Constants§

EARLY_RELAY_CHECK_TIMEOUT 🔒
How long to wait for the state to check a block from a peer that negotiated compact block relay against the best tip.
EARLY_RELAY_PARENT_POLL_INTERVAL 🔒
How often to check whether that parent has become the best tip.
EARLY_RELAY_PARENT_TIMEOUT 🔒
How long to wait for the parent of a block from a peer that negotiated compact block relay to become the best tip, when the block fails later validation first.
MAX_EARLY_RELAY_ALLOWANCES 🔒
The maximum number of peer groups and parent blocks that a block downloader remembers in its EarlyRelayAllowances.
MAX_INBOUND_CONCURRENCY
The maximum number of concurrent inbound download and verify tasks. Also used as the maximum lookahead limit, before block verification.
MAX_REJECTED_EARLY_BLOCKS 🔒
The maximum number of blocks from peers that negotiated compact block relay that a block downloader remembers as invalid, after they passed the checks that authenticate them for early relay.
PARENT_LOOKUP_TIMEOUT 🔒
How long to wait for the parent-height lookup that decides whether a behind-tip gossiped block was forged.

Functions§

advertiser_if_parent_contradicts 🔒
Returns advertiser_addr if the parent header Zebra already holds proves that a gossiped block’s claimed block_height was rewritten, and None if there is no such proof.
best_tip_commitments_are_valid 🔒
Returns true if the state confirms that block passes the rest of the checks that authenticate it for early relay, against the current best tip.
early_block_is_authenticated 🔒
Returns true if block at height passes the rest of the checks that authenticate it for early relay, so a later validation failure doesn’t score the peer that sent it, if the peer has an allowance for the block’s parent in its downloader’s EarlyRelayAllowances.
is_later_validation_failure 🔒
Returns true if error scores the peer that sent a block, and the block verifier only returns it after the block passed the verifier’s part of the checks that authenticate a block for early relay.
remember_rejected_early_block 🔒
Remembers hash, the hash of a block from a peer that negotiated compact block relay, which passed the checks that authenticate it for early relay and then failed later validation, in rejected, a block downloader’s list of those hashes, oldest first.
start_early_relay_check 🔒
Starts checking block against the best tip, if its parent is the best tip, and returns the task that checks it.

Type Aliases§

BoxError 🔒