Skip to content

core: implement eip-7778: block gas accounting without refunds#33593

Merged
rjl493456442 merged 4 commits intoethereum:masterfrom
MariusVanDerWijden:eip-7778
Mar 4, 2026
Merged

core: implement eip-7778: block gas accounting without refunds#33593
rjl493456442 merged 4 commits intoethereum:masterfrom
MariusVanDerWijden:eip-7778

Conversation

@MariusVanDerWijden
Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden commented Jan 13, 2026

@@ -661,9 +661,11 @@ func (st *stateTransition) returnGas() {
st.evm.Config.Tracer.OnGasChange(st.gasRemaining, 0, tracing.GasChangeTxLeftOverReturned)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to update the enum comment? It currently says “returned to the chain,” which might be confusing post-Amsterdam. I figured I would point this out just in case.

// GasChangeTxLeftOverReturned is the amount of gas left over at the end of transaction's execution that will be returned
// to the chain. This change will always be a negative change as we "drain" left over gas towards 0. If there was no gas
// left at the end of execution, no such even will be emitted. The returned gas's value in Wei is returned to caller.
// There is at most one of such gas change per transaction.
GasChangeTxLeftOverReturned GasChangeReason = 4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should definitely be updated to indicate that the refunds are only to accounts and not the gas pool after Amsterdam.

@fjl fjl mentioned this pull request Jan 22, 2026
7 tasks
@MariusVanDerWijden MariusVanDerWijden force-pushed the eip-7778 branch 3 times, most recently from ad5c0ff to 7869c18 Compare January 26, 2026 15:23
@MariusVanDerWijden MariusVanDerWijden force-pushed the eip-7778 branch 3 times, most recently from 2af6f47 to 47490c3 Compare February 5, 2026 13:02
@MariusVanDerWijden MariusVanDerWijden force-pushed the eip-7778 branch 2 times, most recently from e7793cd to 273c3d6 Compare February 19, 2026 09:10
Copy link
Copy Markdown
Member Author

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjl493456442 rjl493456442 added this to the 1.17.2 milestone Mar 4, 2026
@rjl493456442 rjl493456442 merged commit 6d0dd08 into ethereum:master Mar 4, 2026
7 of 8 checks passed
rjl493456442 pushed a commit that referenced this pull request Mar 5, 2026
Fixes a regression in #33593 where a block gas limit > gasCap resulted
in more execution than the gas cap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants