Skip to content

feat(tests): extend block-gas inclusion boundary test to Osaka - #3076

Merged
spencer-tb merged 2 commits into
ethereum:forks/amsterdamfrom
chfast:tests/osaka/cumulative-block-gas-rejection
Jul 1, 2026
Merged

spencer-tb merged 2 commits into
ethereum:forks/amsterdamfrom
chfast:tests/osaka/cumulative-block-gas-rejection

Conversation

@chfast

@chfast chfast commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

🗒️ Description

The regular-gas cumulative inclusion gate probed by
test_tx_inclusion_at_regular_gas_block_limit_small (reject a tx whose
gas_limit exceeds block.gas_limit minus the cumulative gas used, strict

) is the pre-existing block-gas rule, not an EIP-8037 novelty, and its
construction (filler txs plus a bare-STOP excess tx) is fork-agnostic.
Lower its valid_from from EIP8037 to Osaka to add the missing
pre-Amsterdam fixtures.

The sibling test_tx_gas_larger_than_block_gas_limit does not cover this
boundary: its Op.INVALID txs consume their full gas, so the block's
final gas_used <= limit check, not the inclusion gate, decides validity.

Also pin the accepted case with header_verify(gas_used=block_gas_limit),
so the positive branch checks the produced block gas rather than only
that the block is valid.

Verified filling at Osaka (block_gas_limit=42_000; exceeds rejected with
GAS_ALLOWANCE_EXCEEDED) and Amsterdam (block_gas_limit=63_000).

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov

codecov Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (3f888bc) to head (2533fcc).
⚠️ Report is 9 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #3076      +/-   ##
===================================================
- Coverage            93.22%   93.22%   -0.01%     
===================================================
  Files                  624      624              
  Lines                36926    36939      +13     
  Branches              3377     3377              
===================================================
+ Hits                 34424    34436      +12     
- Misses                1708     1709       +1     
  Partials               794      794              
Flag Coverage Δ
unittests 93.22% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The regular-gas cumulative inclusion gate probed by
test_tx_inclusion_at_regular_gas_block_limit_small (reject a tx whose
gas_limit exceeds block.gas_limit minus the cumulative gas used, strict
>) is the pre-existing block-gas rule, not an EIP-8037 novelty, and its
construction (filler txs plus a bare-STOP excess tx) is fork-agnostic.
Lower its valid_from from EIP8037 to Osaka to add the missing
pre-Amsterdam fixtures.

The sibling test_tx_gas_larger_than_block_gas_limit does not cover this
boundary: its Op.INVALID txs consume their full gas, so the block's
final gas_used <= limit check, not the inclusion gate, decides validity.

Also pin the accepted case with header_verify(gas_used=block_gas_limit),
so the positive branch checks the produced block gas rather than only
that the block is valid.

Verified filling at Osaka (block_gas_limit=42_000; exceeds rejected with
GAS_ALLOWANCE_EXCEEDED) and Amsterdam (block_gas_limit=63_000).
@chfast
chfast force-pushed the tests/osaka/cumulative-block-gas-rejection branch from f583d02 to 4873cf1 Compare July 1, 2026 09:09
@chfast chfast changed the title feat(tests): reject tx exceeding remaining block gas (pre-Amsterdam) feat(tests): extend block-gas inclusion boundary test to Osaka Jul 1, 2026

@spencer-tb spencer-tb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks. I added a comment above the fork from range :)

@chfast

chfast commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

LGTM! Thanks. I added a comment above the fork from range :)

Thanks.

@spencer-tb
spencer-tb merged commit 6b35e90 into ethereum:forks/amsterdam Jul 1, 2026
18 checks passed
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.

3 participants