Expand description
Commonly used types in Reth.
This crate contains Ethereum primitive types and helper functions.
§Feature Flags
alloy-compat
: Adds compatibility conversions for certain alloy types.arbitrary
: Addsproptest
andarbitrary
support for primitive types.test-utils
: Export utilities for testingreth-codec
: Enables db codec support for reth types including zstd compression for certain types.
Re-exports§
pub use transaction::BlobTransaction;
pub use transaction::PooledTransactionsElement;
pub use transaction::PooledTransactionsElementEcRecovered;
pub use transaction::InvalidTransactionError;
pub use transaction::Transaction;
pub use transaction::TransactionMeta;
pub use transaction::TransactionSigned;
pub use transaction::TransactionSignedEcRecovered;
pub use transaction::TransactionSignedNoHash;
pub use transaction::TxHashOrNumber;
pub use transaction::TxType;
pub use transaction::EIP1559_TX_TYPE_ID;
pub use transaction::EIP2930_TX_TYPE_ID;
pub use transaction::EIP4844_TX_TYPE_ID;
pub use transaction::EIP7702_TX_TYPE_ID;
pub use transaction::LEGACY_TX_TYPE_ID;
pub use reth_static_file_types as static_file;
pub use revm_primitives;
pub use arbitrary;
arbitrary
pub use c_kzg as kzg;
c-kzg
Modules§
- The
Arbitrary
trait crate. - Ethereum protocol-related constants
- Helper function for calculating Merkle proofs and hashes.
- serde_
bincode_ compat serde-bincode-compat
Bincode-compatible serde implementations for commonly used types in Reth. - Transaction types.
Macros§
- Macro that defines different variants of a chain specific enum. See
crate::Hardfork
as an example.
Structs§
- An Ethereum account.
- This represents a set of blobs, and its corresponding commitments and proofs.
- Ethereum full block.
- A response to
GetBlockBodies
, containing bodies if any bodies were found. - Sealed block with senders recovered from transactions.
- Bytecode for an account.
- Ordered list of a chain hardforks that implement
Hardfork
. - A container for pretty-printing a list of hardforks.
- Represents a forward-compatible ENR entry for including the forkid in a node record via EIP-868. Forward compatibility is achieved via EIP-8.
- Filter that describes the state of blockchain and can be used to check incoming
ForkId
s for compatibility. CRC32
hash of all previous forks starting from genesis block.- A fork identifier as defined by EIP-2124. Serves as the chain compatibility identifier.
- Represents a transition from one fork to another
- A pair of values, one of which is expected and one of which is actual.
- A pair of values, one of which is expected and one of which is actual.
- Describes the current head block.
- Ethereum Block header
- A map of valid
jump
destinations. - A log consists of an address, and some log data.
- An Ethereum event log object.
- Receipt containing result of transaction execution.
Receipt
with calculated bloom filter.Receipt
reference type with calculated bloom filter.- A collection of receipts organized as a two-dimensional vector.
- A list of EIP-7685 requests.
- Reusable
Decompressor reth-codec
Reusable decompressor that uses its own internal buffer. - A block hash which may have a boolean requireCanonical field.
- Sealed Ethereum full block.
- Sealed block with senders recovered from transactions.
- A
Header
that is sealed at a precalculated hash, useSealedHeader::unseal()
if you want to modify header. - An Ethereum ECDSA signature.
- Account storage entry.
- Withdrawal represents a validator withdrawal from the consensus layer.
- Represents a collection of Withdrawals.
Enums§
- An error that can occur when validating a BlobTransactionSidecar::validate.
- A Block Identifier. https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1898.md
- A block Number (or tag - “latest”, “earliest”, “pending”)
- The name of an Ethereum hardfork.
- The condition at which a fork is activated.
- How to filter forks.
- Errors that can occur during header sanity checks.
- Ethereum execution layer requests.
- Segment of the data that can be moved to static files.
- Reason for rejecting provided
ForkId
.
Constants§
- Testnet genesis hash:
0x2f980576711e3617a5e4d83dd539548ec0f7792007d505a3d2e9674833af2d7c
- Ommer root of empty list:
0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347
- Holesky genesis hash:
0xb5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4
- Keccak256 over empty array:
0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470
- The Ethereum mainnet genesis hash:
0x0d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
- RECEIP
T_ COMPRESSOR reth-codec
Thread receipt compressor. - RECEIP
T_ DECOMPRESSOR reth-codec
Thread receipt decompressor. - Sepolia genesis hash:
0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9
- TRANSACTIO
N_ COMPRESSOR reth-codec
Thread Transaction compressor. - TRANSACTIO
N_ DECOMPRESSOR reth-codec
Thread Transaction decompressor.
Statics§
- Dev hardforks
- RECEIP
T_ DICTIONARY reth-codec
Compression/Decompression dictionary forReceipt
. - TRANSACTIO
N_ DICTIONARY reth-codec
Compression/Decompression dictionary forTransaction
.
Traits§
- Helper methods for Ethereum forks.
- Generic hardfork trait.
- Generic trait over a set of ordered hardforks
Functions§
- create_
receipt_ compressor reth-codec
Fn creates receipt [Compressor
] - create_
receipt_ decompressor reth-codec
Fn creates receipt [Decompressor
] - create_
tx_ compressor reth-codec
Fn creates tx [Compressor
] - create_
tx_ decompressor reth-codec
Fn creates tx [Decompressor
] - Retrieves gas spent by transactions as a vector of tuples (transaction index, gas used).
- generate_
valid_ header arbitrary
Generates a header which is valid with respect to past and future forks. This means, for example, that if the withdrawals root is present, the base fee per gas is also present. - Calculate receipt logs bloom.
- public_
key_ to_ address secp256k1
Converts a public key into an ethereum address by hashing the encoded public key with keccak256. - recover_
signer_ unchecked secp256k1
Recovers the address of the sender using secp256k1 pubkey recovery. - sign_
message secp256k1
Signs message with the given secret key. Returns the corresponding signature. - valid_
header_ strategy arbitrary
Generates a proptest strategy for constructing an instance of a header which is valid with respect to past and future forks.
Type Aliases§
- A block hash or a block number
- A block number and a hash
- Block number and hash of the forked block.