Expand description
This module is centered around the ChainState type, defining it and providing
implementations for the BlockchainInterface and UpdatableChainstate traits.
Consequently, ChainState serves as the blockchain backend for our node and is
the highest-level type in floresta-chain. It is responsible for:
- Keeping track of the chain state, and using a ChainStore for persisted storage
- Correctly updating the state with the help of the
consensus.rsfunctions - Interfacing with other components, and providing data about the current view of the chain
The primary methods for updating our state are ChainState::accept_header, which constructs a chain of headers, and ChainState::connect_block, which verifies the corresponding blocks.
Key types:
- ChainState: The high-level chain backend
- BlockConsumer: Trait for receiving new block notifications
- BestChain: Tracks the current best chain and alternative forks
Structs§
- Best
Chain - Internal representation of the chain we are in
- Chain
State - The high-level chain backend managing the blockchain state.
- Chain
State Inner - Internal state of the blockchain managed by
ChainState.
Enums§
- Assume
Valid Arg - Represents the argument for the assume-valid configuration.
Traits§
- Block
Consumer - Trait for components that need to receive notifications about new blocks.