Crate reth_primitives

Source
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: Adds proptest and arbitrary support for primitive types.
  • test-utils: Export utilities for testing
  • reth-codec: Enables db codec support for reth types including zstd compression for certain types.

Re-exports§

Modules§

  • The Arbitrary trait crate.
  • Helper function for calculating Merkle proofs and hashes.
  • serde_bincode_compatserde-bincode-compat
    Bincode-compatible serde implementations for commonly used types in Reth.
  • Transaction types.

Macros§

Structs§

Enums§

Constants§

Statics§

Traits§

Functions§

  • Fn creates receipt [Compressor]
  • Fn creates receipt [Decompressor]
  • Fn creates tx [Compressor]
  • Fn creates tx [Decompressor]
  • Retrieves gas spent by transactions as a vector of tuples (transaction index, gas used). Retrieves gas spent by transactions as a vector of tuples (transaction index, gas used).
  • 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.
  • Compute the logs bloom filter for the given logs.
  • Converts a public key into an ethereum address by hashing the encoded public key with keccak256.
  • Recovers the address of the sender using secp256k1 pubkey recovery.
  • sign_messagesecp256k1
    Signs message with the given secret key. Returns the corresponding signature.
  • Generates a proptest strategy for constructing an instance of a header which is valid with respect to past and future forks.