MCPcopy Create free account
hub / github.com/base/base / validate_env

Method validate_env

crates/common/evm/src/handler.rs:81–102  ·  view source on GitHub ↗
(&self, evm: &mut Self::Evm)

Source from the content-addressed store, hash-verified

79 type HaltReason = BaseHaltReason;
80
81 fn validate_env(&self, evm: &mut Self::Evm) -> Result<(), Self::Error> {
82 // Do not perform any extra validation for deposit transactions, they are pre-verified on L1.
83 let ctx = evm.ctx();
84 let tx = ctx.tx();
85 let tx_type = tx.tx_type();
86 if tx_type == DEPOSIT_TRANSACTION_TYPE {
87 // Do not allow for a system transaction to be processed if Regolith is enabled.
88 if tx.is_system_transaction()
89 && evm.ctx().cfg().spec().is_enabled_in(BaseUpgrade::Regolith)
90 {
91 return Err(BaseTransactionError::DepositSystemTxPostRegolith.into());
92 }
93 return Ok(());
94 }
95
96 // Check that non-deposit transactions have enveloped_tx set
97 if tx.enveloped_tx().is_none() {
98 return Err(BaseTransactionError::MissingEnvelopedTx.into());
99 }
100
101 self.mainnet.validate_env(evm)
102 }
103
104 fn tx_gas(&self, evm: &mut Self::Evm, init_and_floor_gas: &InitialAndFloorGas) -> GasTracker {
105 let ctx = evm.ctx_ref();

Callers

nothing calls this directly

Calls 8

ctxMethod · 0.80
is_enabled_inMethod · 0.80
txMethod · 0.45
tx_typeMethod · 0.45
is_system_transactionMethod · 0.45
specMethod · 0.45
cfgMethod · 0.45
enveloped_txMethod · 0.45

Tested by

no test coverage detected