fix(eip-8141): account block execution gas before refund - #3443
Conversation
8adc4c8 to
6798542
Compare
9f0f995 to
9f2e228
Compare
chugarchugarr
left a comment
There was a problem hiding this comment.
@spencer-tb @gurukamath @LouisTsai-Csie — this catches an EIP-8141 × EIP-7778 accounting interaction where storage refunds were also reducing block execution gas.
The payer/receipt remain post-refund; block execution gas remains pre-refund. Regression coverage is included, and the PR is currently waiting on fork-workflow approval before upstream CI can run.
Would one of you mind approving the workflows / taking a look at the accounting boundary?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-8141 #3443 +/- ##
==========================================================
Coverage ? 93.41%
==========================================================
Files ? 576
Lines ? 33091
Branches ? 2911
==========================================================
Hits ? 30911
Misses ? 1533
Partials ? 647
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Status update: I closed my unrelated open execution-specs contributions, so this is now my sole active upstream PR here. Head @spencer-tb @gurukamath @LouisTsai-Csie — requesting one narrow human review of the accounting boundary: payer/receipt gas remains post-refund while block execution gas remains pre-refund under EIP-7778. A direct rejection or narrowing is as useful as approval; I am making no acceptance claim before that review. |
gurukamath
left a comment
There was a problem hiding this comment.
This is an implementation of the spec update that was recently merged. See PR
We need to bump the spec commit hash under tests/amsterdam/eip8141_frame_transactions/spec.py to 7d1c8bfb945cbb53479217df3bf1da67b3aa445b
|
@gurukamath — pinned The fork workflows were reset by the new commit and are awaiting approval again. I’m keeping the two inline suggestions (move the derivation into |
00f2cf1 to
ce7e32f
Compare
|
Both outstanding inline review points are now answered and resolved on current head
The spec pin was also updated earlier to the merged EIP commit. Requesting re-review of the current head; no acceptance claim until that happens. |
chugarchugarr
left a comment
There was a problem hiding this comment.
@gurukamath — all three review items are now incorporated on head ce7e32f8f7ac6e7cbdfaf87779b787c6f4e40406: (1) the spec pin is 7d1c8bfb945cbb53479217df3bf1da67b3aa445b; (2) payer-facing gas_used is derived inside settle_frame_transaction_gas and carried by FrameTransactionGasSettlement; and (3) the storage-refund settlement test covers all three calldata-floor orderings you listed. The PR is mergeable. The only current blocker is that the fork-triggered render, Python Specification, and Build Docs runs on this head are action_required, so they need upstream authorization before CI can execute. Ready for re-review.
| [ | ||
| pytest.param(0, "below_post_refund", id="post_refund_above_floor"), | ||
| pytest.param( | ||
| 768, |
There was a problem hiding this comment.
Can we derive these calldata lengths on the fly, like we do in tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_gas_accounting.py::test_varying_calldata_costs?
There was a problem hiding this comment.
Updated in afb204ec: test_storage_refund_settlement now derives the calldata for each of the three floor orderings on the fly instead of hard-coding padding lengths, following the existing EIP-7778 test pattern. The commit changes only this test file; the new upstream workflows are awaiting authorization.
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>
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>
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>
Description
Fix EIP-8141 frame-transaction block gas accounting so storage refunds reduce payer-facing gas without reducing block execution gas, as required by EIP-7778.
The payer and receipt remain post-refund. At the block-processing boundary:
Reviewer-requested changes incorporated
Current head:
ce7e32f8f7ac6e7cbdfaf87779b787c6f4e40406.All three items from
@gurukamath's review are incorporated:tests/amsterdam/eip8141_frame_transactions/spec.pyis pinned to merged EIP update commit7d1c8bfb945cbb53479217df3bf1da67b3aa445b.gas_usedis derived insidesettle_frame_transaction_gasand carried byFrameTransactionGasSettlementrather than reconstructed inline inprocess_frame_transaction.test_storage_refund_settlementcovers all three calldata-floor orderings: post-refund above floor, floor between pre/post refund, and floor above pre-refund.The two inline review threads have been answered and resolved, and re-review has been requested. No acceptance claim is being made before that review completes.
Verification state
The earlier focused validation (
9 passed, Ruff check/format check, andgit diff --check) predates the final reviewer-requested refinements and is preserved as prior evidence rather than represented as exact-current-head CI.On current head, the upstream fork-triggered
render,Python Specification, andBuild Docsworkflow runs are allaction_required; they require upstream authorization before they can execute. There is therefore no author-side CI action remaining on this head.Base
eips/amsterdam/eip-8141at6798542ebd017b683b688489d770bf206c8bd3ba.