Crate reth_primitives_traits

Source
Expand description

Commonly used types and traits in Reth.

This crate contains various primitive traits used across reth’s components. It provides the Block trait which is used to represent a block and all its components. A Block is composed of a Header and a BlockBody. In ethereum (and optimism), a block body consists of a list of transactions, a list of uncle headers, and a list of withdrawals. For optimism, uncle headers and withdrawals are always empty lists.

§Feature Flags

  • arbitrary: Adds proptest and arbitrary support for primitive types.
  • op: Implements the traits for various op-alloy types.
  • reth-codec: Enables db codec support for reth types including zstd compression for certain types.
  • serde: Adds serde support for all types.
  • secp256k1: Adds secp256k1 support for transaction signing/recovery. (By default the no-std friendly k256 is used)

Re-exports§

pub use constants::gas_units::format_gas;
pub use constants::gas_units::format_gas_throughput;
pub use account::Account;
pub use account::Bytecode;
pub use receipt::FullReceipt;
pub use receipt::Receipt;
pub use transaction::execute::FillTxEnv;
pub use transaction::signed::FullSignedTx;
pub use transaction::signed::SignedTransaction;
pub use transaction::FullTransaction;
pub use transaction::Transaction;
pub use block::body::BlockBody;
pub use block::body::FullBlockBody;
pub use block::header::BlockHeader;
pub use block::header::FullBlockHeader;
pub use block::Block;
pub use block::FullBlock;
pub use header::test_utils;arbitrary or test-utils
pub use header::HeaderError;
pub use header::SealedHeader;
pub use size::InMemorySize;
pub use node::BodyTy;
pub use node::FullNodePrimitives;
pub use node::HeaderTy;
pub use node::NodePrimitives;
pub use node::ReceiptTy;

Modules§

account
Minimal account
block
Block abstraction.
constants
Common constants. Ethereum protocol-related constants
crypto
Crypto utilities.
header
Common header types
node
Node traits
receipt
Receipt abstraction
serde_bincode_compatserde-bincode-compat
Bincode-compatible serde implementations for common abstracted types in Reth.
size
Heuristic size trait
transaction
Transaction abstraction

Structs§

GotExpected
A pair of values, one of which is expected and one of which is actual.
GotExpectedBoxed
A pair of values, one of which is expected and one of which is actual.
Header
Ethereum Block header
Log
A log consists of an address, and some log data.
LogData
An Ethereum event log object.
StorageEntry
Account storage entry.
WithEncoded
Generic wrapper with encoded Bytes, such as transaction data.

Traits§

MaybeCompactreth-codec
Helper trait that requires database encoding implementation since reth-codec feature is enabled.
MaybeSerdeserde
Helper trait that requires de-/serialize implementation since serde feature is enabled.
MaybeSerdeBincodeCompatserde-bincode-compat
Helper trait that requires serde bincode compatibility implementation.

Functions§

logs_bloom
Compute the logs bloom filter for the given logs.