From b1a7aae5d7f7365845f35d29585d2fe86db5c30a Mon Sep 17 00:00:00 2001 From: panos Date: Fri, 3 Apr 2026 19:16:24 +0800 Subject: [PATCH] fix(evm): remove unnecessary EIP-7825 tx gas limit cap override MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The manual `tx_gas_limit_cap = Some(header.gas_limit())` override was added when all MorphHardfork variants incorrectly mapped to SpecId::OSAKA, causing revm to enforce the EIP-7825 cap (2^24) on pre-Osaka blocks. Now that the hardfork-to-SpecId mapping is correct (Bernoulli/Curie/Morph203 → CANCUN, Viridian → PRAGUE, Emerald/Jade → OSAKA), revm's default behavior handles this properly: - Pre-OSAKA specs: tx_gas_limit_cap = u64::MAX (no cap) - OSAKA+: tx_gas_limit_cap = eip7825::TX_GAS_LIMIT_CAP The only mainnet transaction exceeding the EIP-7825 cap is in block 16102224 (tx 0x600e75...bad7aa6, gas_limit=20,001,453), which occurred during the Morph203 era (CANCUN spec) where no cap applies. --- crates/evm/src/config.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/crates/evm/src/config.rs b/crates/evm/src/config.rs index 8adeaa3..1b2f059 100644 --- a/crates/evm/src/config.rs +++ b/crates/evm/src/config.rs @@ -38,10 +38,6 @@ impl ConfigureEvm for MorphEvmConfig { .with_spec(spec); cfg_env.disable_eip7623 = true; - // Disable EIP-7825 transaction gas limit cap - // Morph allows transactions with gas limit > 16777216 (EIP-7825 cap) - cfg_env.tx_gas_limit_cap = Some(header.gas_limit()); - let fee_recipient = self .chain_spec() .fee_vault_address() @@ -87,10 +83,6 @@ impl ConfigureEvm for MorphEvmConfig { .with_spec(spec); cfg_env.disable_eip7623 = true; - // Disable EIP-7825 transaction gas limit cap - // Morph allows transactions with gas limit > 16777216 (EIP-7825 cap) - cfg_env.tx_gas_limit_cap = Some(attributes.gas_limit); - let fee_recipient = self .chain_spec() .fee_vault_address() @@ -255,17 +247,6 @@ mod tests { assert!(env.cfg_env.disable_eip7623); } - #[test] - fn test_evm_env_tx_gas_limit_cap_matches_header() { - let chain_spec = create_test_chainspec(); - let config = MorphEvmConfig::new_with_default_factory(chain_spec); - - let header = create_morph_header(100, 1000); - let env = config.evm_env(&header).unwrap(); - - assert_eq!(env.cfg_env.tx_gas_limit_cap, Some(30_000_000)); - } - #[test] fn test_next_evm_env_increments_block_number() { let chain_spec = create_test_chainspec();