Crate reth_blockchain_tree

Source
Expand description

Implementation of a tree-like structure for blockchains.

The BlockchainTree can validate, execute, and revert blocks in multiple competing sidechains. This structure is used for Reth’s sync mode at the tip instead of the pipeline, and is the primary executor and validator of payloads sent from the consensus layer.

Blocks and their resulting state transitions are kept in-memory until they are persisted.

§Feature Flags

  • test-utils: Export utilities for testing

Re-exports§

pub use blockchain_tree::BlockchainTree;
pub use block_indices::BlockIndices;
pub use chain::AppendableChain;
pub use config::BlockchainTreeConfig;
pub use externals::TreeExternals;
pub use shareable::ShareableBlockchainTree;
pub use block_buffer::BlockBuffer;

Modules§

block_buffer
Buffer of not executed blocks.
block_indices
Implementation of BlockIndices related to super::BlockchainTree
blockchain_tree
Implementation of BlockchainTree
chain
A chain in a BlockchainTree.
config
Blockchain tree configuration
error
Re-export of the blockchain tree API. Error handling for the blockchain tree
externals
Blockchain tree externals.
metrics
Common blockchain tree metrics.
noop
Implementation of Tree traits that does nothing.
shareable
Wrapper around BlockchainTree that allows for it to be shared.

Structs§

BundleStateDataRef
Structure that combines references of required data to be a [ExecutionDataProvider].
ExecutionData
Structure that owns the relevant data needs to be a [ExecutionDataProvider]

Enums§

BlockAttachment
Re-export of the blockchain tree API. Represents what kind of block is being executed and validated.
BlockStatus
Re-export of the blockchain tree API. 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
Re-export of the blockchain tree API. Block inclusion can be valid, accepted, or invalid. Invalid blocks are returned as an error variant.
BlockValidationKind
Re-export of the blockchain tree API. Represents the kind of validation that should be performed when inserting a block.
CanonicalOutcome
Re-export of the blockchain tree API. All possible outcomes of a canonicalization attempt of BlockchainTreeEngine::make_canonical.
InsertPayloadOk
Re-export of the blockchain tree API. How a payload was inserted if it was valid.
InsertPayloadOk2
Re-export of the blockchain tree API. How a payload was inserted if it was valid.

Traits§

BlockchainTreeEngine
Re-export of the blockchain tree API.
BlockchainTreeViewer
Re-export of the blockchain tree API. Allows read only functionality on the blockchain tree.