Skip to content

feat(tests): EIP-8037 reject tx when gas_limit covers regular but not state intrinsic#2876

Merged
spencer-tb merged 3 commits into
ethereum:forks/amsterdamfrom
chfast:feat/eip-8037-state-intrinsic-required
Jun 10, 2026
Merged

feat(tests): EIP-8037 reject tx when gas_limit covers regular but not state intrinsic#2876
spencer-tb merged 3 commits into
ethereum:forks/amsterdamfrom
chfast:feat/eip-8037-state-intrinsic-required

Conversation

@chfast

@chfast chfast commented May 19, 2026

Copy link
Copy Markdown
Member

🗒️ Description

EIP-8037 splits a transaction's intrinsic gas into a regular component and a state component (NEW_ACCOUNT for CREATE, NEW_ACCOUNT + AUTH_BASE per authorization for set_code). The sender must cover both: any gas_limit < regular + state is invalid with INTRINSIC_GAS_TOO_LOW.

The existing test_create_tx_intrinsic_gas_boundary pins gas_limit at the upper boundary (total - 1). This change adds two functions that pin gas_limit at the lower end of the rejected interval—regular and regular + 1—where an implementation that omits the state component from its pre-validate intrinsic check would erroneously accept the transaction:

  • test_create_tx_below_total_intrinsic (CREATE)
  • test_set_code_tx_below_total_intrinsic (set_code, N = 1, 2, 3 auths)

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

… state intrinsic

EIP-8037 splits a transaction's intrinsic gas into a regular component
and a state component (NEW_ACCOUNT for CREATE, NEW_ACCOUNT + AUTH_BASE
per authorization for set_code). The sender must cover both: any
`gas_limit < regular + state` is invalid with `INTRINSIC_GAS_TOO_LOW`.

The existing `test_create_tx_intrinsic_gas_boundary` pins gas_limit at
the upper boundary (`total - 1`). This change adds two functions that
pin gas_limit at the lower end of the rejected interval — `regular`
and `regular + 1` — where an implementation that omits the state
component from its pre-validate intrinsic check would erroneously
accept the transaction:

- `test_create_tx_below_total_intrinsic` (CREATE)
- `test_set_code_tx_below_total_intrinsic` (set_code, N = 1, 2, 3 auths)
@chfast chfast force-pushed the feat/eip-8037-state-intrinsic-required branch from ee5de04 to 6af8798 Compare June 10, 2026 07:25
@chfast chfast changed the base branch from devnets/bal/7 to forks/amsterdam June 10, 2026 07:25
@chfast chfast marked this pull request as ready for review June 10, 2026 07:25
spencer-tb
spencer-tb previously approved these changes Jun 10, 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!

Added suggestion for extra case!

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.52%. Comparing base (84e39e1) to head (b42f22d).
⚠️ Report is 2 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2876      +/-   ##
===================================================
- Coverage            90.53%   90.52%   -0.01%     
===================================================
  Files                  535      535              
  Lines                32897    32893       -4     
  Branches              3021     3021              
===================================================
- Hits                 29782    29778       -4     
  Misses                2596     2596              
  Partials               519      519              
Flag Coverage Δ
unittests 90.52% <ø> (-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.

@spencer-tb spencer-tb merged commit 4d47a44 into ethereum:forks/amsterdam Jun 10, 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.

2 participants