Skip to content

Update EIP-8141: account block execution gas before refund (EIP-7778) - #12226

Merged
eth-bot merged 1 commit into
ethereum:masterfrom
AnkushinDaniil:daniil/eip8141-7778-block-gas
Aug 24, 2026
Merged

Update EIP-8141: account block execution gas before refund (EIP-7778)#12226
eth-bot merged 1 commit into
ethereum:masterfrom
AnkushinDaniil:daniil/eip8141-7778-block-gas

Conversation

@AnkushinDaniil

Copy link
Copy Markdown
Contributor

EIP-8141 adopts the two-dimensional gas model of EIP-8037 and activates on a fork that also includes EIP-7778 (Amsterdam). EIP-8037's "Integration with EIP-7778" section accounts the block execution dimension before the storage refund, so a refund lowers the payer's cost without freeing the block capacity the transaction occupied — the DoS bound EIP-7778 exists to keep.

The current EIP-8141 settlement accounts block_execution_gas_used from gas_used_after_refund (post-refund), so a frame transaction re-opens the refund-based block-limit circumvention that EIP-7778 closes for every other transaction type on the same fork.

This PR:

  • adds 7778 to requires:;
  • accounts the block execution dimension from gas_used_before_refund (block_execution_gas = max(gas_used_before_refund - tx_state_gas, calldata_floor_gas)), mirroring EIP-8037's EIP-7778 integration;
  • keeps the payer charge and receipt cumulative_gas_used on the post-refund gas_used unchanged; the state dimension stays net, since a state-gas refill is not a refund in the EIP-7778 sense.

Is the omission of the EIP-7778 integration a spec bug rather than an intended departure? EIP-8141's only documented departure from EIP-8037 is the calldata-floor payment rule; the refund/block-accounting integration appears to have been carried over from the pre-7778 form.

@github-actions github-actions Bot added c-update Modifies an existing proposal s-draft This EIP is a Draft t-core labels Aug 21, 2026
@eth-bot

eth-bot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

✅ All reviewers have approved.

@eth-bot eth-bot added the a-review Waiting on author to review label Aug 21, 2026

@lightclient lightclient left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch

@eth-bot
eth-bot enabled auto-merge (squash) August 24, 2026 02:03

@eth-bot eth-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot
eth-bot merged commit 7d1c8bf into ethereum:master Aug 24, 2026
10 checks passed
gurukamath added a commit to ethereum/execution-specs that referenced this pull request Sep 1, 2026
This implements the spec updates from this PR - ethereum/EIPs#12226

* fix(eip-8141): account block execution gas before refund

* test(eip-8141): bump reference spec for EIP-7778 integration

* fix(eip-8141): settle refund and floor accounting together

* test(eip-8141): derive refund floor cases dynamically

* style(test): format gas settlement test

* fix(tests): static checks

* fix(tests): pin search transaction nonce


---------

Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
gurukamath added a commit to ethereum/execution-specs that referenced this pull request Sep 2, 2026
This implements the spec updates from this PR - ethereum/EIPs#12226

* fix(eip-8141): account block execution gas before refund

* test(eip-8141): bump reference spec for EIP-7778 integration

* fix(eip-8141): settle refund and floor accounting together

* test(eip-8141): derive refund floor cases dynamically

* style(test): format gas settlement test

* fix(tests): static checks

* fix(tests): pin search transaction nonce


---------

Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
gurukamath added a commit to ethereum/execution-specs that referenced this pull request Sep 3, 2026
This implements the spec updates from this PR - ethereum/EIPs#12226

* fix(eip-8141): account block execution gas before refund

* test(eip-8141): bump reference spec for EIP-7778 integration

* fix(eip-8141): settle refund and floor accounting together

* test(eip-8141): derive refund floor cases dynamically

* style(test): format gas settlement test

* fix(tests): static checks

* fix(tests): pin search transaction nonce


---------

Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
gurukamath added a commit to ethereum/execution-specs that referenced this pull request Sep 3, 2026
This implements the spec updates from this PR - ethereum/EIPs#12226

* fix(eip-8141): account block execution gas before refund

* test(eip-8141): bump reference spec for EIP-7778 integration

* fix(eip-8141): settle refund and floor accounting together

* test(eip-8141): derive refund floor cases dynamically

* style(test): format gas settlement test

* fix(tests): static checks

* fix(tests): pin search transaction nonce


---------

Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a-review Waiting on author to review c-update Modifies an existing proposal s-draft This EIP is a Draft t-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants