Skip to content

feat(tests): EIP-8037 CREATE-tx collision refunds state-gas reservoir#2875

Merged
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:feat/eip-8037-create-tx-collision-high-gas
Jun 10, 2026
Merged

feat(tests): EIP-8037 CREATE-tx collision refunds state-gas reservoir#2875
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:feat/eip-8037-create-tx-collision-high-gas

Conversation

@chfast

@chfast chfast commented May 19, 2026

Copy link
Copy Markdown
Member

🗒️ Description

Add test_create_tx_collision_refunds_reservoir: a depth-0 CREATE-tx with gas_limit > TX_MAX_GAS_LIMIT that collides at the deterministic CREATE address. The existing collision test uses gas_limit near the intrinsic, so the state-gas reservoir is empty and the reservoir-preservation path is untested.

Block-level gas_used is the same under both buggy and correct behaviors; the sender's post-balance is the discriminator. A buggy implementation that drops the reservoir on collision overcharges the sender by reservoir * gas_price.

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

marioevz
marioevz previously approved these changes Jun 9, 2026

@marioevz marioevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just one comment. Also we need to rebase and merge to forks/amsterdam

Comment thread tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py Outdated
Add `test_create_tx_collision_refunds_reservoir`: a depth-0 CREATE-tx
with `gas_limit > TX_MAX_GAS_LIMIT` that collides at the deterministic
CREATE address. The existing collision test uses `gas_limit` near the
intrinsic, so the state-gas reservoir is empty and the
reservoir-preservation path is untested.

Block-level `gas_used` is the same under both buggy and correct
behaviors; the sender's post-balance is the discriminator. A buggy
implementation that drops the reservoir on collision overcharges the
sender by `reservoir * gas_price`.
@chfast chfast force-pushed the feat/eip-8037-create-tx-collision-high-gas branch from 84686b2 to 235e5a1 Compare June 10, 2026 07:18
@chfast chfast changed the base branch from devnets/bal/7 to forks/amsterdam June 10, 2026 07:18
@chfast chfast dismissed marioevz’s stale review June 10, 2026 07:18

The base branch was changed.

@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! @marioevz's comments are addressed.

@spencer-tb spencer-tb closed this Jun 10, 2026
@spencer-tb spencer-tb reopened this Jun 10, 2026
@spencer-tb

Copy link
Copy Markdown
Contributor

Closed/reopened to trigger CI. It hit a race cond.

@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 (235e5a1).
⚠️ Report is 2 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2875      +/-   ##
===================================================
- 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 8ccd21f 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.

3 participants