execution/protocol: EIP-7778: Block Gas Accounting without Refunds#18663
Merged
execution/protocol: EIP-7778: Block Gas Accounting without Refunds#18663
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements EIP-7778: Block Gas Accounting without Refunds, which changes how gas is accounted for in blocks by distinguishing between gas the user pays (with refunds) and gas counted toward block limits.
Changes:
- Introduces a
GasUsedstruct with separateReceiptandBlockfields to track different gas accounting methods - Replaces direct
GasUsedfield access withReceiptGasUsedandBlockGasUsedthroughout the codebase - Updates gas accounting logic to implement EIP-7778's Amsterdam fork rules
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| execution/vm/evmtypes/evmtypes.go | Splits GasUsed into ReceiptGasUsed and BlockGasUsed fields |
| execution/protocol/state_transition.go | Implements EIP-7778 gas accounting logic with new blockGasUsed tracking |
| execution/protocol/state_processor.go | Introduces GasUsed struct and updates ApplyTransaction signature |
| execution/protocol/block_exec.go | Updates ExecuteBlockEphemerally to use new GasUsed struct |
| rpc/transactions/tracing.go | Updates tracer calls to use ReceiptGasUsed |
| rpc/jsonrpc/*.go | Updates RPC handlers to use ReceiptGasUsed |
| execution/stagedsync/*.go | Updates block execution to use BlockGasUsed for validation |
| execution/tests/*.go | Updates test utilities to use ReceiptGasUsed |
| execution/types/receipt_test.go | Removes unused test code and import statements |
| execution/types/receipt.go | Removes DeriveFields method and adds CumulativeGasUsed helper |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mh0lt
approved these changes
Jan 30, 2026
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.
See https://eips.ethereum.org/EIPS/eip-7778, ethereum/execution-specs#2073