Skip to content

execution/protocol: fix EIP-7702 AUTH_BASE state-gas over-refund on Amsterdam#21555

Closed
awskii wants to merge 1 commit into
mainfrom
awskii/amsterdam-7702-authbase-state-gas
Closed

execution/protocol: fix EIP-7702 AUTH_BASE state-gas over-refund on Amsterdam#21555
awskii wants to merge 1 commit into
mainfrom
awskii/amsterdam-7702-authbase-state-gas

Conversation

@awskii

@awskii awskii commented Jun 1, 2026

Copy link
Copy Markdown
Member

verifyAuthorities refunded the EIP-8037 per-auth AUTH_BASE state gas for any delegation clear (auth.Address == 0x0), even when the authority had no pre-existing delegation. AUTH_BASE = STATE_BYTES_PER_AUTH_BASE (23) * CPSB (1530, cost-per-state-byte) = params.StateGasAuthBase = 35190. Clearing/overwriting an existing indicator writes no new state, but a no-op clear of an undelegated authority must keep the charge.

Result: Amsterdam blocks under-charged by one AUTH_BASE per undelegated-clearing auth → import fails with gas used = header - 35190.

Fix: refund AUTH_BASE only when hasDelegation.

Verified on EEST zkevm@v0.4.0 for_amsterdam: 12 distinct gas mismatches → 0. make lint clean.

…msterdam

verifyAuthorities refunded the EIP-8037 per-auth AUTH_BASE state gas
(23*CPSB = 35190) for any delegation clear (auth.Address == 0x0), even
when the authority had no pre-existing delegation. Clearing/overwriting an
existing indicator writes no new state, but a no-op clear of an undelegated
authority must keep the charge. Erigon under-charged Amsterdam blocks by one
AUTH_BASE per undelegated-clearing auth (gas used = header - 35190),
failing EEST zkevm 7702 fixtures. Refund AUTH_BASE only when hasDelegation.
@awskii awskii requested review from mh0lt and yperbasis as code owners June 1, 2026 11:01
@yperbasis yperbasis requested a review from taratorio June 1, 2026 11:03
@yperbasis yperbasis added the Glamsterdam https://eips.ethereum.org/EIPS/eip-7773 label Jun 1, 2026
@yperbasis yperbasis added this to the 3.6.0 milestone Jun 1, 2026
@awskii

awskii commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

zkevm corpus conflicts with bal@v7.2.0 within eest-spec-blocktests-devnet; these 2 suites encodes 2 different rules for EIP-8037. I suppose we are going to skip 13 tests in zkevm for that until Reth doesnt update zkevm corpus - (reth was a sole zkevm suite producer)

@awskii

awskii commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

spec change between May 13–18: AUTH_BASE-on-undelegated-clear went from charge (zkevm@v0.4.0) to refund (bal@v7.2.0) which was issued 5 days later.

@awskii awskii closed this Jun 1, 2026
@yperbasis yperbasis removed this from the 3.6.0 milestone Jun 1, 2026
@awskii awskii deleted the awskii/amsterdam-7702-authbase-state-gas branch June 1, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Glamsterdam https://eips.ethereum.org/EIPS/eip-7773

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants