Skip to content

feat(tests): EIP-7778 multi-tx mixed gas regimes block accounting#2871

Merged
LouisTsai-Csie merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:feat/eip-7778-three-tx-mixed-profiles
May 19, 2026
Merged

feat(tests): EIP-7778 multi-tx mixed gas regimes block accounting#2871
LouisTsai-Csie merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:feat/eip-7778-three-tx-mixed-profiles

Conversation

@chfast

@chfast chfast commented May 18, 2026

Copy link
Copy Markdown
Member

🗒️ Description

Add test_3tx_mixed_gas_regimes exercising the EIP-7778 identity block.gas_used == sum_i max(pre_refund_i, floor_i) across a block where each tx hits a different regime:

tx1: SSTORE-set fresh slot (no refund, pre_refund > floor)
tx2: SSTORE-clear x10 (normal refund, refund not clipped to floor)
tx3: 1000 zero-byte calldata to STOP (floor binds upward)

Per-tx sender balances are also asserted so the floor-binding tx locks in floor * gas_price (not pre_refund * gas_price), the multi-tx accumulator bug EIP-7778 prevents. The 2-tx test_multi_transaction_gas_accounting never combines a refund- bearing tx with a floor-binding tx in the same block.

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.16%. Comparing base (c6b7f17) to head (3dcebc0).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2871      +/-   ##
===================================================
+ Coverage            87.14%   87.16%   +0.01%     
===================================================
  Files                  586      586              
  Lines                35792    35792              
  Branches              3364     3364              
===================================================
+ Hits                 31192    31199       +7     
+ Misses                3950     3943       -7     
  Partials               650      650              
Flag Coverage Δ
unittests 87.16% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LouisTsai-Csie LouisTsai-Csie 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.

LGTM! Leave some comments but not blocking merging the PR.

)


@pytest.mark.execute(pytest.mark.skip(reason="Requires specific gas price"))

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.

Maybe this works, i am not very sure. But i remember there was a framework change that could fetch the real time gas reprice.

@marioevz could you help confirm if this is done in PR #1822

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I copied this from sibling tests.

Add `test_3tx_mixed_gas_regimes` exercising the EIP-7778 identity
`block.gas_used == sum_i max(pre_refund_i, floor_i)` across a block
where each tx hits a different regime:

  tx1: SSTORE-set fresh slot (no refund, pre_refund > floor)
  tx2: SSTORE-clear x10 (normal refund, refund not clipped to floor)
  tx3: 1000 zero-byte calldata to STOP (floor binds upward)

Per-tx sender balances are also asserted so the floor-binding tx
locks in `floor * gas_price` (not `pre_refund * gas_price`), the
multi-tx accumulator bug EIP-7778 prevents. The 2-tx
`test_multi_transaction_gas_accounting` never combines a refund-
bearing tx with a floor-binding tx in the same block.
@chfast chfast force-pushed the feat/eip-7778-three-tx-mixed-profiles branch from f538cd1 to 3dcebc0 Compare May 19, 2026 06:33
@LouisTsai-Csie LouisTsai-Csie added A-tests Area: Consensus tests. C-test Category: test labels May 19, 2026
@LouisTsai-Csie LouisTsai-Csie merged commit 31d7e69 into ethereum:forks/amsterdam May 19, 2026
18 checks passed
@chfast chfast deleted the feat/eip-7778-three-tx-mixed-profiles branch May 19, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tests Area: Consensus tests. C-test Category: test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants