Expand description
§alloy-consensus
Ethereum consensus interface.
This crate contains constants, types, and functions for implementing Ethereum EL consensus and communication. This includes headers, blocks, transactions, EIP-2718 envelopes, EIP-2930, EIP-4844, and more.
In general a type belongs in this crate if it is committed to in the EL block header. This includes:
- transactions
- blocks
- headers
- receipts
- EIP-2718 envelopes.
§Provenance
Much of this code was ported from reth-primitives as part of ongoing alloy migrations.
Re-exports§
- pub use constants::EMPTY_OMMER_ROOT_HASH;
- pub use transaction::EthereumTxEnvelope;
- pub use transaction::EthereumTypedTransaction;
- pub use transaction::SignableTransaction;
- pub use transaction::Transaction;
- pub use transaction::TransactionEnvelope;
- pub use transaction::TxEip1559;
- pub use transaction::TxEip2930;
- pub use transaction::TxEip4844;
- pub use transaction::TxEip4844Variant;
- pub use transaction::TxEip4844WithSidecar;
- pub use transaction::TxEip7702;
- pub use transaction::TxEnvelope;
- pub use transaction::TxLegacy;
- pub use transaction::TxType;
- pub use transaction::TypedTransaction;
- pub use extended::Extended;
Modules§
- conditional
- Helpers for conditional transactions.
- constants
- Ethereum protocol-related constants
- crypto
- Cryptographic algorithms
- error
- Helper errors.
- extended
- Extended transaction types
- proofs
- Helper function for calculating Merkle proofs and hashes.
- serde_bincode_ compat serdeandserde-bincode-compat
- Bincode-compatible serde implementations for consensus types.
- transaction
- Transaction types.
- utils
- Utilities for working with EIP-4844 field elements and implementing
SidecarCoder.
Structs§
- Account
- Represents an TrieAccount in the account trie.
- BlobTransaction Sidecar 
- This represents a set of blobs, and its corresponding commitments and proofs.
- Block
- Ethereum full block.
- BlockBody 
- A response to GetBlockBodies, containing bodies if any bodies were found.
- Header
- Ethereum Block header
- HeaderInfo 
- Essential info extracted from a header.
- Receipt
- Receipt containing result of transaction execution.
- ReceiptWith Bloom 
- Receiptwith calculated bloom filter.
- Receipts
- A collection of receipts organized as a two-dimensional vector.
- Sealed
- A consensus hashable item, with its memoized hash.
- SidecarBuilder 
- Build a BlobTransactionSidecarfrom an arbitrary amount of data.
- Signed
- A transaction with a signature and hash seal.
- SimpleCoder 
- Simple coder that only uses the last 31 bytes of each blob. This is the
default coder for the SidecarBuilder.
- TrieAccount 
- Represents an TrieAccount in the account trie.
Enums§
- BlobTransaction Validation Error kzg
- An error that can occur when validating a BlobTransactionSidecar::validate.
- Eip658Value 
- Captures the result of a transaction execution.
- EnvKzgSettings kzg
- KZG settings.
- ReceiptEnvelope 
- Receipt envelope, as defined in EIP-2718.
Constants§
- EMPTY_ROOT_ HASH 
- Root hash of an empty trie.
Traits§
- BlockHeader 
- Trait for extracting specific Ethereum block data from a header
- Eip2718Encodable Receipt 
- Receipt type that knows its EIP-2718 encoding.
- EthBlock
- A trait for ethereum like blocks.
- RlpDecodableReceipt 
- Receipt type that knows how to decode itself with a Bloomvalue.
- RlpEncodableReceipt 
- Receipt type that knows how to encode itself with a Bloomvalue.
- Sealable
- Sealeable objects.
- SidecarCoder 
- A strategy for coding and decoding data into sidecars.
- TxReceipt
- Receipt is the result of a transaction execution.
- Typed2718
- A trait that helps to determine the type of the transaction.
Type Aliases§
- Blob
- A Blob serialized as 0x-prefixed hex string
- Bytes48
- A commitment/proof serialized as 0x-prefixed hex string
Derive Macros§
- TransactionEnvelope 
- Derive macro for creating transaction envelope types.