Update EIP-8037: more state gas accounting changes#11532
Merged
eth-bot merged 5 commits intoApr 17, 2026
Conversation
Collaborator
|
✅ All reviewers have approved. |
This was referenced Apr 16, 2026
90f16bb to
77df4a8
Compare
4 tasks
77df4a8 to
8f7e203
Compare
eth-bot
approved these changes
Apr 17, 2026
Collaborator
eth-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
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.
Summary
Clarifies EIP-8037 state gas accounting based on outcomes from the gas repricings call (2026-04-16), following @misilva73's state gas accounting review.
Covers points 2 through 6. Points 1 and 7 have their own PRs:
Changes
2) SSTORE 0 to x to 0 refunds state gas to reservoir, 8356e2e
On SSTORE restoration, the state gas portion is refunded directly to
state_gas_reservoirat the X to 0 SSTORE (not viarefund_counter). This avoids the 20% refund cap preventing full state gas refunds at highcost_per_state_byte. The regular gas write-cost refund still goes throughrefund_counter.3) CREATE failure refunds account state gas to reservoir, c01515e
CREATE/CREATE2keeps "pay-before-execute". On silent failure (insufficient balance, nonce overflow, stack depth, address collision) or child revert/halt, the account-creation state gas is refunded to the reservoir. No account was created, so no state gas should be paid.4) SELFDESTRUCT same-tx refunds state gas at end of tx, a2a4e16
When an account is created and self-destructed in the same transaction (EIP-6780), at end of tx the following state gas is refunded to
state_gas_reservoir:112 * cost_per_state_byte32 * cost_per_state_byteper non-zero slotlen(code) * cost_per_state_byteThe refund is applied before
tx_gas_used_before_refundis computed so the sender is not charged for destroyed state. No double refund with point 2: 0 to X to 0 slots have final value 0 and are not counted.5) CALL with value to selfdestructed account in the same transaction, no change (clarification), f5410b7
Clarifies that a
CALLwith value to an account that was selfdestructed in the same transaction does not chargeGAS_NEW_ACCOUNTstate gas. The account is still present in the state with a nonce of 1 from the CREATE until the end of the transaction destruction, so it is neither empty nor nonexistent and the new account creation gate does not apply. Any value transferred to the account is burned when the end of the transaction destruction runs. Combined with point 4, the net state gas across the CREATE, SELFDESTRUCT, and CALL with value lifecycle is zero, matching the zero persisted state. No spec change.6) Immutable
intrinsic_state_gasfor EIP-7702, 8f7e203intrinsic_state_gasis immutable after transaction validation. When an EIP-7702 authorization targets an existing account, the112 * cost_per_state_byterefund goes directly tostate_gas_reservoir. Block accounting uses the original worst-caseintrinsic_state_gas. Also fixes the misleading heading as the section is about EIP-7702 authorizations, not EIP-2780.