fix(evm): remove unnecessary EIP-7825 tx gas limit cap override#79
fix(evm): remove unnecessary EIP-7825 tx gas limit cap override#79
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughConfiguration cleanup removing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
tx_gas_limit_cap = Some(header.gas_limit())override fromMorphEvmConfigMorphHardforkvariants incorrectly mapped toSpecId::OSAKABackground
The override was added in commit
508ac07when the hardfork-to-SpecId mapping was:This caused revm to enforce the EIP-7825 tx gas limit cap (
2^24 = 16,777,216) on all blocks, even pre-Osaka ones. Block 16,102,224 contains a transaction (0x600e751e...bad7aa6) withgas_limit = 20,001,453that was valid under CANCUN spec but rejected by the incorrect OSAKA cap.The mapping has since been corrected to:
With the correct mapping, revm's default
tx_gas_limit_cap()handles this properly:u64::MAX(no cap)eip7825::TX_GAS_LIMIT_CAPThe manual override is no longer needed.
Test plan
cargo check -p morph-evmpassescargo test -p morph-evm— 26 tests passSummary by CodeRabbit