Skip to content

feat(spec-specs, tests): EIP-8037 more refund fixes#2823

Merged
spencer-tb merged 6 commits into
ethereum:devnets/bal/7from
spencer-tb:feat/eip-8037-create-tx-failure-intrinsic-refund
May 8, 2026
Merged

feat(spec-specs, tests): EIP-8037 more refund fixes#2823
spencer-tb merged 6 commits into
ethereum:devnets/bal/7from
spencer-tb:feat/eip-8037-create-tx-failure-intrinsic-refund

Conversation

@spencer-tb

@spencer-tb spencer-tb commented May 7, 2026

Copy link
Copy Markdown
Contributor

🗒️ Description

Addresses 3 points for the EIP-8037 bal-devnet-7 updates in #2804.

  • Fixes creation tx halt/revert to correctly refund intrinsic state gas. A creation transaction that halts or reverts at the top level, now refunds the STATE_BYTES_PER_NEW_ACCOUNT * COST_PER_STATE_BYTE portion of the intrinsic state gas back to the sender, since no contract account is ever created. The regular component of the intrinsic gas stays consumed -> ece6916

  • Fixes a double charge of state gas on halt/revert. When an inline refund (SSTORE 0 to x to 0 or a CREATE silent failure) was applied inside a failing subcall, it was canceled at the failure boundary instead of being returned to the caller's reservoir, essentially charging the user twice, once for the original charge and again when the refund was dropped. Fixed for both same frame and cross frame variants -> b22aa09

  • Adds an explicit test for the creation tx address collision path, that verifies the intrinsic state gas refund flows through the address collision error path the same way it does on halt/revert -> 913827c

✅ 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).

@spencer-tb spencer-tb changed the title feat(spec-specs, tests): EIP-8037 creation-tx halt/revert refunds intrinsic NEW_ACCOUNT feat(spec-specs, tests): EIP-8037 creation-tx halt/revert refunds intrinsic NEW_ACCOUNT and drop double refund on incorporate_child_on_error May 7, 2026
@spencer-tb spencer-tb force-pushed the feat/eip-8037-create-tx-failure-intrinsic-refund branch from 165ba69 to 154ca13 Compare May 7, 2026 19:13
@spencer-tb spencer-tb changed the title feat(spec-specs, tests): EIP-8037 creation-tx halt/revert refunds intrinsic NEW_ACCOUNT and drop double refund on incorporate_child_on_error feat(spec-specs, tests): EIP-8037 more refund fixes May 7, 2026
@spencer-tb spencer-tb force-pushed the feat/eip-8037-create-tx-failure-intrinsic-refund branch 3 times, most recently from 12d6495 to a3188a4 Compare May 7, 2026 19:42
@spencer-tb spencer-tb force-pushed the feat/eip-8037-create-tx-failure-intrinsic-refund branch from a3188a4 to 7897291 Compare May 7, 2026 19:44
@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (devnets/bal/7@5416cbb). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             devnets/bal/7    #2823   +/-   ##
================================================
  Coverage                 ?   85.58%           
================================================
  Files                    ?      630           
  Lines                    ?    39600           
  Branches                 ?     3936           
================================================
  Hits                     ?    33891           
  Misses                   ?     5084           
  Partials                 ?      625           
Flag Coverage Δ
unittests 85.58% <100.00%> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@fselmo

fselmo commented May 7, 2026

Copy link
Copy Markdown
Contributor

lgtm! I extended the tests a bit and PR'd it here: spencer-tb#7

Lmk what you think, feel free to take or leave. Extended to more call opcodes, adds an intermediate revert test, and uses header_verify to verify block gas accounting

@fselmo fselmo 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, extended testing a bit here if you want to bring it in here before merging: spencer-tb#7

@spencer-tb spencer-tb merged commit eb80b43 into ethereum:devnets/bal/7 May 8, 2026
27 checks passed
fselmo added a commit to fselmo/execution-specs that referenced this pull request May 8, 2026
fselmo added a commit to fselmo/execution-specs that referenced this pull request May 8, 2026
fselmo added a commit to fselmo/execution-specs that referenced this pull request May 8, 2026
spencer-tb added a commit to spencer-tb/execution-specs that referenced this pull request May 22, 2026
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