Expand description
A download stream that handles gossiped blocks from peers.
Structs§
- Authenticated
Block Rejected - 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.
- Early
Relay 🔒Allowances - 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§
- Download
Action - The action taken in response to a peer’s gossiped block hash.
- Height
Limit Error - 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_addrif the parent header Zebra already holds proves that a gossiped block’s claimedblock_heightwas rewritten, andNoneif there is no such proof. - best_
tip_ 🔒commitments_ are_ valid - Returns
trueif the state confirms thatblockpasses the rest of the checks that authenticate it for early relay, against the current best tip. - early_
block_ 🔒is_ authenticated - Returns
trueifblockatheightpasses 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’sEarlyRelayAllowances. - is_
later_ 🔒validation_ failure - Returns
trueiferrorscores 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, inrejected, a block downloader’s list of those hashes, oldest first. - start_
early_ 🔒relay_ check - Starts checking
blockagainst the best tip, if its parent is the best tip, and returns the task that checks it.
Type Aliases§
- BoxError 🔒