Skip to content

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

Draft
chfast wants to merge 1 commit into
ethereum:devnets/bal/7from
chfast:feat/eip-8037-state-intrinsic-required
Draft

feat(tests): EIP-8037 reject tx when gas_limit covers regular but not state intrinsic#2876
chfast wants to merge 1 commit into
ethereum:devnets/bal/7from
chfast:feat/eip-8037-state-intrinsic-required

Conversation

@chfast
Copy link
Copy Markdown
Member

@chfast chfast commented May 19, 2026

🗒️ 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 marked this pull request as draft May 19, 2026 17:02
@chfast
Copy link
Copy Markdown
Member Author

chfast commented May 19, 2026

Don't merge.

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