execution/protocol: fix EIP-7702 AUTH_BASE state-gas over-refund on Amsterdam#21555
Closed
awskii wants to merge 1 commit into
Closed
execution/protocol: fix EIP-7702 AUTH_BASE state-gas over-refund on Amsterdam#21555awskii wants to merge 1 commit into
awskii wants to merge 1 commit into
Conversation
…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.
Member
Author
|
zkevm corpus conflicts with |
Member
Author
|
spec change between May 13–18: AUTH_BASE-on-undelegated-clear went from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
verifyAuthoritiesrefunded 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.0for_amsterdam: 12 distinct gas mismatches → 0.make lintclean.