Crate primitives
Expand description
§revm-primitives
EVM primitive types.
Modules§
- alloy-primitives
- kzg
c-kzg
orkzg-rs
Macros§
- Converts a sequence of string literals containing hex-encoded data into a new
Address
at compile time. - Converts a sequence of string literals containing hex-encoded data into a new
B256
at compile time. - Converts a sequence of string literals containing hex-encoded data into a new
Bytes
at compile time. - Converts a sequence of string literals containing hex-encoded data into a new
FixedBytes
at compile time. - Macro for converting sequence of string literals containing hex-encoded data into an array of bytes.
- spec_
to_ generic optimism
Structs§
- AccessList as defined in EIP-2930
- A list of addresses and storage keys that the transaction plans to access. Accesses outside the list are possible, but become more expensive.
- AccountInfo account information.
- An Ethereum address, 20 bytes in length.
- An unsigned EIP-7702 authorization.
- Structure holding block blob excess gas and it calculates blob fee.
- The block environment.
- Wrapper type around [
bytes::Bytes
] to support “0x” prefixed hex strings. - EVM configuration.
- Configuration environment with the chain spec id.
- Bytecode of delegated account, specified in EIP-7702
- EVM environment configuration.
- Evm environment with the chain spec id.
- EVM Object Format (EOF) container.
- This type keeps track of the current value of a storage slot.
- A byte array of fixed length (
[u8; N]
). - Handler configuration fields. It is used to configure the handler. It contains specification id and the Optimism related field if optimism feature is enabled.
- A map of valid
jump
destinations. - Stores the setup and parameters needed for computing KZG proofs.
- Legacy analyzed
- A log consists of an address, and some log data.
- An Ethereum event log object.
- Optimism
Fields optimism
Additional TxEnv fields for optimism. - Precompile execution output
- A recovered authorization.
- An Ethereum ECDSA signature.
- A signed EIP-7702 authorization.
- The transaction environment.
Enums§
- What bytecode analysis to perform.
- Authorization list for EIP-7702 transaction type.
- State of the
Bytecode
analysis. - EOF decode errors.
- Create scheme.
- Main EVM error.
- Bytecode errors.
- KZG Settings that allow us to specify a custom trusted setup. or use hardcoded default settings.
- Result of a transaction execution.
- Indicates that the EVM has experienced an exceptional halt. This causes execution to immediately end with all gas being consumed.
- Errors related to misconfiguration of a
crate::env::BlockEnv
. - Transaction validation error.
- Optimism
Invalid Transaction optimism
Transaction validation error for Optimism. - Output of a transaction execution.
- Precompile and its handlers.
- Precompile errors.
- Represents the outcome of an attempt to recover the authority from an authorization. It can either be valid (containing an
Address
) or invalid (indicating recovery failure). - SpecId
optimism
Specification IDs and their activation block. - Reason a transaction successfully completed.
- The
to
field of a transaction. Either a target address, or empty for a contract creation.
Constants§
- Controls the maximum rate of change for blob gas price.
- EIP-2935: Serve historical block hashes from state
- EIP-2935: Serve historical block hashes from state
- Number of block hashes that EVM can access in the past (pre-Prague).
- EIP-7702 Version Magic in u16 form.
- EOF Magic in u16 form.
- Hash of EF00 bytes that is used for EXTCODEHASH when called from legacy bytecode.
- Gas consumption of a single data blob (== blob byte size).
- The Keccak-256 hash of the empty string
""
. - Maximum consumable blob gas for data blobs per block.
- Max number of blobs per block
- EIP-170: Contract code size limit
- EIP-3860: Limit and meter initcode
- Minimum gas price for data blobs.
- The address of precompile 3, which is handled specially in a few places.
- Target consumable blob gas for data blobs per block (for 1559-like pricing).
- Target number of the blob per block.
- First version of the blob.
Statics§
- EIP-7702 magic number in array form.
- EOF magic number in array form.
Traits§
- Stateful precompile trait. It is used to create a arc precompile Precompile::Stateful.
- Mutable stateful precompile trait. It is used to create a boxed precompile in Precompile::StatefulMut.
Functions§
- Calculates the blob gas price from the header’s excess blob gas field.
- Calculates the
excess_blob_gas
from the parent header’sblob_gas_used
andexcess_blob_gas
. - Approximates
factor * e ** (numerator / denominator)
using Taylor expansion. - Simple interface to the
Keccak-256
hash function.
Type Aliases§
- 32-byte fixed byte-array type.
- Result of EVM execution.
- Generic result of EVM execution. Used to represent error and generic output.
- EVM State is a mapping from addresses to accounts.
- An account’s Storage is a mapping from 256-bit integer keys to EvmStorageSlots.
- A
HashMap
using the default hasher. - A
HashSet
using the default hasher. - 256-bit signed integer type, consisting of 4, 64-bit limbs.
- A precompile operation result.
- Arc over stateful precompile.
- Box over mutable stateful precompile
- Transaction destination
- Structure used for EIP-1153 transient storage.
- 256-bit unsigned integer type, consisting of 4, 64-bit limbs.