Skip to content

feat(tests, spec-specs): refill auth state gas on delegation clear for EIP-8037#2848

Merged
spencer-tb merged 2 commits into
ethereum:devnets/bal/7from
spencer-tb:feat/eip8037-auth-base-zero-refund
May 13, 2026
Merged

feat(tests, spec-specs): refill auth state gas on delegation clear for EIP-8037#2848
spencer-tb merged 2 commits into
ethereum:devnets/bal/7from
spencer-tb:feat/eip8037-auth-base-zero-refund

Conversation

@spencer-tb
Copy link
Copy Markdown
Contributor

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

🗒️ Description

Refill STATE_BYTES_PER_AUTH_BASE * CPSB to the state gas reservoir when an EIP-7702 authorization clears the delegation (auth.address == 0).

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

Cute Animal Picture

@spencer-tb spencer-tb added A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) C-feat Category: an improvement or new feature P-high A-tests Area: Consensus tests. labels May 13, 2026
@spencer-tb spencer-tb force-pushed the feat/eip8037-auth-base-zero-refund branch from a51386f to 1845edb Compare May 13, 2026 14:23
Comment thread src/ethereum/forks/amsterdam/vm/eoa_delegation.py Outdated
@spencer-tb spencer-tb force-pushed the feat/eip8037-auth-base-zero-refund branch from aba851a to 7de0d0f Compare May 13, 2026 14:32
@spencer-tb spencer-tb force-pushed the feat/eip8037-auth-base-zero-refund branch from 7de0d0f to dbc1cca Compare May 13, 2026 14:39
Copy link
Copy Markdown
Contributor

@fselmo fselmo left a comment

Choose a reason for hiding this comment

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

Yes, this covers empty -> empty (clear). Lgtm!

@spencer-tb spencer-tb merged commit bcb8dc5 into ethereum:devnets/bal/7 May 13, 2026
20 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

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

Additional details and impacted files
@@               Coverage Diff                @@
##             devnets/bal/7    #2848   +/-   ##
================================================
  Coverage                 ?   87.39%           
================================================
  Files                    ?      586           
  Lines                    ?    35946           
  Branches                 ?     3381           
================================================
  Hits                     ?    31414           
  Misses                   ?     3911           
  Partials                 ?      621           
Flag Coverage Δ
unittests 87.39% <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.

edg-l added a commit to lambdaclass/ethrex that referenced this pull request May 13, 2026
Mirrors EELS PR #2848 (tests-bal@v7.1.1, devnets/bal/7):
ethereum/execution-specs#2848

PR #2836 already refunded the 23-byte AUTH_BASE portion when the
authority's pre-state code slot held a delegation indicator. #2848
broadens the condition: when the auth is a clear (`auth.address ==
0x00`), no new indicator bytes are written regardless of pre-state
code, so the AUTH_BASE refill applies even against an authority with
no prior code.

Equivalent to EELS:
    if authority_account.code_hash != EMPTY_CODE_HASH
       or auth.address == NULL_ADDRESS:
        refund = STATE_BYTES_PER_AUTH_BASE * COST_PER_STATE_BYTE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) A-tests Area: Consensus tests. C-feat Category: an improvement or new feature P-high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants