pub struct Environment {Show 27 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 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 the simulation RPCs (eth_call, eth_estimateGas, 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.
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§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Environment
impl Debug for Environment
Source§impl Default for Environment
impl Default for Environment
Source§fn default() -> Environment
fn default() -> 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.