pub struct Environment {Show 29 fields
pub origin: Address,
pub gas_limit: u64,
pub config: EVMConfig,
pub block_number: u64,
pub coinbase: Address,
pub timestamp: u64,
pub prev_randao: Option<H256>,
pub difficulty: U256,
pub slot_number: U256,
pub chain_id: U256,
pub base_fee_per_gas: U256,
pub base_blob_fee_per_gas: U256,
pub gas_price: U256,
pub block_excess_blob_gas: Option<u64>,
pub block_blob_gas_used: Option<u64>,
pub tx_blob_hashes: Vec<H256>,
pub tx_max_priority_fee_per_gas: Option<U256>,
pub tx_max_fee_per_gas: Option<U256>,
pub tx_max_fee_per_blob_gas: Option<U256>,
pub tx_nonce: u64,
pub block_gas_limit: u64,
pub is_privileged: bool,
pub fee_token: Option<Address>,
pub disable_balance_check: bool,
pub disable_nonce_check: bool,
pub disable_gas_allowance_check: bool,
pub disable_sender_eoa_check: bool,
pub disable_execution_gas_cap: bool,
pub is_system_call: bool,
}Expand description
Environmental information that the execution agent must provide.
Fields§
§origin: AddressThe sender address of the external transaction.
gas_limit: u64Gas limit of the Transaction
config: EVMConfig§block_number: u64§coinbase: AddressCoinbase is the block’s beneficiary - the address that receives the block rewards and fees.
timestamp: u64§prev_randao: Option<H256>§difficulty: U256§slot_number: U256§chain_id: U256§base_fee_per_gas: U256§base_blob_fee_per_gas: U256§gas_price: U256§block_excess_blob_gas: Option<u64>§block_blob_gas_used: Option<u64>§tx_blob_hashes: Vec<H256>§tx_max_priority_fee_per_gas: Option<U256>§tx_max_fee_per_gas: Option<U256>§tx_max_fee_per_blob_gas: Option<U256>§tx_nonce: u64§block_gas_limit: u64§is_privileged: bool§fee_token: Option<Address>§disable_balance_check: boolWhen true, skip balance deduction in deduct_caller. Used by the prewarmer
to avoid early reverts on insufficient balance so that warming touches more storage.
disable_nonce_check: boolWhen true, skip the sender nonce-mismatch validation. Used by the simulation
RPCs (eth_call, eth_estimateGas, eth_createAccessList): call objects may omit
the nonce, and no client enforces it there. The account nonce still increments
during execution. debug_traceCall relies on it too (geth’s
ToMessage(_, skipNonceCheck=true)): the synthetic call may run on top of a
mid-block state (txIndex) whose nonce differs from the value the caller
supplied, so enforcing the check would spuriously reject the trace.
disable_gas_allowance_check: boolWhen true, skip the gas limits that gate a transaction’s admission rather than
its execution: the block-level gas allowance and the EIP-7825 per-transaction cap.
Used by every simulation RPC (eth_call, eth_estimateGas, eth_createAccessList,
debug_traceCall), whose callers routinely pass a gas above either bound — tools
commonly pass the block gas limit — and still expect an answer, since nothing is
being submitted.
This exists so block_gas_limit can keep the block’s real value: that field is
observable through the GASLIMIT opcode and feeds the EIP-8037 cost-per-state-byte
formula, so raising it to bypass the allowance corrupts both.
disable_sender_eoa_check: boolWhen true, skip the EIP-3607 validation that rejects a sender carrying code.
Used by every simulation RPC (eth_call, eth_estimateGas, eth_createAccessList,
debug_traceCall). EIP-3607 exists because a contract has no private key, so no
valid signature should exist for its address; a simulated call carries no
signature at all and its from is just an assertion by the caller, so the rule
has nothing to protect there. Enforcing it breaks the common practice of
simulating a call whose sender is a contract, such as a smart contract wallet
previewing its own transaction. Transaction admission keeps enforcing it: the
mempool rejects such a sender outright, and block execution never sets this flag.
disable_execution_gas_cap: boolWhen true, the EIP-8037 cap on the execution dimension (Amsterdam+) is lifted: the
whole gas limit is execution gas and no state-gas reservoir is funded from it, so a
simulation given more than the per-transaction execution cap can actually spend it.
Set by eth_call and debug_traceCall only, as geth does, since nothing they run is
ever submitted. eth_estimateGas and eth_createAccessList keep the cap, because
their answers must hold for a transaction that can be included. Block execution
never sets it.
is_system_call: boolWhen true, the tx is a pre-execution system contract call (EIP-2935, EIP-4788,
EIP-7002, EIP-7251 etc.). Skips the block-level gas-allowance check since system
calls are allowed to exceed block_gas_limit (their 30M cap is a separate rule).
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§impl Debug for Environment
impl Debug for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.