Crate reth_blockchain_tree_api

Source
Expand description

Interfaces and types for interacting with the blockchain tree.

Modules§

error
Error handling for the blockchain tree

Enums§

BlockAttachment
Represents what kind of block is being executed and validated.
BlockStatus
From Engine API spec, block inclusion can be valid, accepted or invalid. Invalid case is already covered by error, but we need to make distinction between valid blocks that extend canonical chain and the ones that fork off into side chains (see BlockAttachment). If we don’t know the block parent we are returning Disconnected status as we can’t make a claim if block is valid or not.
BlockStatus2
Block inclusion can be valid, accepted, or invalid. Invalid blocks are returned as an error variant.
BlockValidationKind
Represents the kind of validation that should be performed when inserting a block.
CanonicalOutcome
All possible outcomes of a canonicalization attempt of BlockchainTreeEngine::make_canonical.
InsertPayloadOk
How a payload was inserted if it was valid.
InsertPayloadOk2
How a payload was inserted if it was valid.

Traits§

BlockchainTreeEngine
BlockchainTreeEngine::insert_block: Connect block to chain, execute it and if valid insert block inside tree.BlockchainTreeEngine::finalize_block: Remove chains that join to now finalized block, as chain becomes invalid.BlockchainTreeEngine::make_canonical: Check if we have the hash of block that we want to finalize and commit it to db. If we don’t have the block, syncing should start to fetch the blocks from p2p. Do reorg in tables if canonical chain if needed.
BlockchainTreeViewer
Allows read only functionality on the blockchain tree.