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 block_buffer::BlockBuffer;
Modules§
- block_
buffer - Buffer of not executed blocks.
- block_
indices - Implementation of
BlockIndices
related tosuper::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§
- Bundle
State Data Ref - Structure that combines references of required data to be a [
ExecutionDataProvider
]. - Execution
Data - Structure that owns the relevant data needs to be a [
ExecutionDataProvider
]
Enums§
- Block
Attachment - Re-export of the blockchain tree API. Represents what kind of block is being executed and validated.
- Block
Status - 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. - Block
Status2 - Re-export of the blockchain tree API. Block inclusion can be valid, accepted, or invalid. Invalid blocks are returned as an error variant.
- Block
Validation Kind - Re-export of the blockchain tree API. Represents the kind of validation that should be performed when inserting a block.
- Canonical
Outcome - Re-export of the blockchain tree API.
All possible outcomes of a canonicalization attempt of
BlockchainTreeEngine::make_canonical
. - Insert
Payload Ok - Re-export of the blockchain tree API. How a payload was inserted if it was valid.
- Insert
Payload Ok2 - Re-export of the blockchain tree API. How a payload was inserted if it was valid.
Traits§
- Blockchain
Tree Engine - Re-export of the blockchain tree API.
- Blockchain
Tree Viewer - Re-export of the blockchain tree API. Allows read only functionality on the blockchain tree.