Expand description
Block generation system.
This module provides the actual block generation code. The output is an unsealed header and body.
After a block has been generated, it must still be sealed (in other words, signed by its author) by adding a corresponding entry to the log items in its header. This is out of scope of this module.
§Detail
Building a block consists in four steps:
- A runtime call to
Core_initialize_block
, passing a header prototype as input. This call performs some initial storage writes. - A runtime call to
BlockBuilder_inherent_extrinsics
, passing as input a list of intrinsics. This pure call returns a list of extrinsics. - Zero or more runtime calls to
BlockBuilder_apply_extrinsic
, passing as input an extrinsic. This must be done once per extrinsic returned by the previous step, plus once for each transaction to push in the block. - A runtime call to
BlockBuilder_finalize_block
, which returns the newly-created unsealed block header.
The body of the newly-generated block consists in the extrinsics pushed using
BlockBuilder_apply_extrinsic
(including the intrinsics).
Re-exports§
pub use runtime_call::Nibble;
pub use runtime_call::StorageChanges;
pub use runtime_call::TrieChange;
pub use runtime_call::TrieChangeStorageValue;
pub use runtime_call::TrieEntryVersion;
Structs§
- More transactions can be added.
- Obtaining the Merkle value of the closest descendant of a trie node is required in order to continue.
- Configuration for a block generation.
- The list of inherent extrinsics are needed in order to continue.
- Fetching the key that follows a given one in the parent storage is required in order to continue.
- Setting the value of an offchain storage value is required.
- Loading a storage value from the parent storage is required in order to continue.
- Block successfully verified.
Enums§
- Current state of the block building process.
- Extra configuration depending on the consensus algorithm.
- Reason why a dispatch call failed.
- Error that can happen during the block production.
- An invalid transaction validity.
- Errors that can occur while checking the validity of a transaction.
- An unknown transaction validity.
Functions§
- Start a block building process.