core: fix EIP-7778 receipt vs block gas separation#33756
Closed
qu0b wants to merge 2 commits intoethereum:bal-devnet-2from
Closed
core: fix EIP-7778 receipt vs block gas separation#33756qu0b wants to merge 2 commits intoethereum:bal-devnet-2from
qu0b wants to merge 2 commits intoethereum:bal-devnet-2from
Conversation
The miner accumulates result.UsedGas (post-refund) into the block header's GasUsed via ApplyTransactionWithEVM, but the validator accumulates receipt.GasUsed (which is result.MaxUsedGas = pre-refund for Amsterdam) into its local gas total. This causes every proposed block containing refund-generating transactions to be rejected with "invalid gas used" after the Gloas fork. Use result.MaxUsedGas (pre-refund gas) for block gas accumulation when Amsterdam is active, matching EIP-7778's requirement that block gas accounting excludes refunds. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…for EIP-7778 EIP-7778 requires block-level gas accounting to exclude refunds, but receipts must continue using post-refund CumulativeGasUsed. The previous fix only changed state_transition.go but left all callers using a single gas value for both purposes, causing receipt root mismatches with other clients (e.g., Besu). This commit introduces a dual return from ApplyTransactionWithEVM: - receipt: contains post-refund CumulativeGasUsed (unchanged behavior) - blockGasUsed: pre-refund gas for Amsterdam, post-refund otherwise All callers updated: state_processor, chain_makers, parallel processor, miner/worker, t8ntool, simulate, tracers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
Closing in favor of #33754 which contains the same fix. |
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
CumulativeGasUsed) from pre-refund gas (for blockheader.GasUsed) in EIP-7778 (Block Gas Accounting Without Refunds)ApplyTransactionWithEVMnow returns(receipt, blockGasUsed, error)— receipt uses post-refund gas,blockGasUseduses pre-refund for AmsterdamProblem
EIP-7778 requires block-level gas to exclude refunds, but receipts must continue using post-refund
CumulativeGasUsed. The previous fix changedstate_transition.goto returnMaxUsedGas(pre-refund), but this single value was used for both block gas and receipt gas, causing receipt root hash mismatches when validating blocks from other clients (e.g., Besu).Test plan
🤖 Generated with Claude Code