Skip to content

fix(evm): remove unnecessary EIP-7825 tx gas limit cap override#79

Open
panos-xyz wants to merge 1 commit intomainfrom
worktree-fix+remove-eip7825-override
Open

fix(evm): remove unnecessary EIP-7825 tx gas limit cap override#79
panos-xyz wants to merge 1 commit intomainfrom
worktree-fix+remove-eip7825-override

Conversation

@panos-xyz
Copy link
Copy Markdown
Contributor

@panos-xyz panos-xyz commented Apr 3, 2026

Summary

  • Remove manual tx_gas_limit_cap = Some(header.gas_limit()) override from MorphEvmConfig
  • The override was a workaround for a now-fixed bug where all MorphHardfork variants incorrectly mapped to SpecId::OSAKA

Background

The override was added in commit 508ac07 when the hardfork-to-SpecId mapping was:

Bernoulli/Curie/Morph203/Viridian/Emerald/MPTFork → OSAKA (all OSAKA!)

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) with gas_limit = 20,001,453 that was valid under CANCUN spec but rejected by the incorrect OSAKA cap.

The mapping has since been corrected to:

Bernoulli/Curie/Morph203 → CANCUN
Viridian → PRAGUE
Emerald/Jade → OSAKA

With the correct mapping, revm's default tx_gas_limit_cap() handles this properly:

  • Pre-OSAKA: u64::MAX (no cap)
  • OSAKA+: eip7825::TX_GAS_LIMIT_CAP

The manual override is no longer needed.

Test plan

  • cargo check -p morph-evm passes
  • cargo test -p morph-evm — 26 tests pass
  • Verify node can sync past block 16,102,224 without the override

Summary by CodeRabbit

  • Refactor
    • Removed unused gas limit cap configuration code and associated tests.

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e8a6f7cf-02ce-4ecf-9816-f2957b96e7df

📥 Commits

Reviewing files that changed from the base of the PR and between 42d7ede and b1a7aae.

📒 Files selected for processing (1)
  • crates/evm/src/config.rs
💤 Files with no reviewable changes (1)
  • crates/evm/src/config.rs

📝 Walkthrough

Walkthrough

Configuration cleanup removing tx_gas_limit_cap assignments from EVM environment setup in both the main and next environment contexts, along with the corresponding validation test.

Changes

Cohort / File(s) Summary
Gas Limit Cap Configuration Removal
crates/evm/src/config.rs
Removed cfg_env.tx_gas_limit_cap assignments from evm_env and next_evm_env blocks, including explanatory comments. Deleted unit test test_evm_env_tx_gas_limit_cap_matches_header that validated the cap matched the header gas limit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • chengwenxi
  • anylots

Poem

🐰 The gas cap slips away like morning dew,
No more limits binding what we do,
The test bids farewell, its job now through,
Simpler configs, fresher and new! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: removing an unnecessary EIP-7825 tx gas limit cap override. It's concise, specific, and clearly reflects the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-fix+remove-eip7825-override

Warning

Review ran into problems

🔥 Problems

Timed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant