feat(contracts): enforce EIP-7825 gas cap in NUT bundle validation#20205
Open
lumoswiz wants to merge 4 commits intoethereum-optimism:developfrom
Open
feat(contracts): enforce EIP-7825 gas cap in NUT bundle validation#20205lumoswiz wants to merge 4 commits intoethereum-optimism:developfrom
lumoswiz wants to merge 4 commits intoethereum-optimism:developfrom
Conversation
Contributor
|
/ci authorize 0885ccf |
0xiamflux
reviewed
Apr 21, 2026
0xniha
reviewed
Apr 21, 2026
… bundle gasLimit check
maurelian
approved these changes
Apr 22, 2026
Contributor
|
/ci authorize 51ae847 |
0xiamflux
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a per-transaction gas limit cap check to
GenerateNUTBundle.assertValidOutputso any NUT bundle transaction whosegasLimitexceeds the EIP-7825 Osaka cap (2**24 = 16_777_216) is rejected at bundle-generation time rather than at execution.assertValidOutputwas promoted frominternaltopublicso that tests can invoke it directly against a mutated bundle.Tests
Full negative-path coverage for every branch in
assertValidOutputwas added totest/scripts/GenerateNUTBundle.t.sol. Each test follows the same pattern:script.run()to produce a valid bundlescript.assertValidOutputreverts with the expected error messageThe count-mismatch test uses assembly to rewrite the in-memory array length rather than rebuilding the array. Shrink-only because growing would blow up the ABI encoding on the external call to
assertValidOutput.Additional context
Issue #20109 calls for two checks: the EIP-7825 upper cap and an op-geth gas floor check. This PR currently implements the upper cap only. I'm opening as a draft and plan to land the floor check in the same PR once I've synced with @0xniha on the intended approach to implementing the op-geth gas floor.
Resolved by #20075
Metadata
Closes #20109