Skip to content

feat(tests): EIP-7708 - finalization burn log ordering + coinbase fee no-log#2717

Merged
marioevz merged 4 commits intoethereum:eips/amsterdam/eip-7708from
spencer-tb:tests/eip-7708-finalization-burn-log-ordering
Apr 20, 2026
Merged

feat(tests): EIP-7708 - finalization burn log ordering + coinbase fee no-log#2717
marioevz merged 4 commits intoethereum:eips/amsterdam/eip-7708from
spencer-tb:tests/eip-7708-finalization-burn-log-ordering

Conversation

@spencer-tb
Copy link
Copy Markdown
Contributor

@spencer-tb spencer-tb commented Apr 19, 2026

🗒️ Description

Adds three focused tests filling EIP-7708 coverage gaps reported in #2691 #2692, and #2717 (review) .

test_finalization_burn_logs_multi_account_ordering

Verifies finalization Burn logs are emitted in lexicographical address order when multiple accounts are marked for deletion in the same tx:

  • N accounts are created in the same tx via CREATE and immediately SELFDESTRUCT'd (ETH sent to a shared beneficiary, zeroing their balance).
  • N payer contracts then fund each destroyed account in REVERSE sorted address order with a distinct nonzero amount.
  • At finalization each destroyed account has a unique nonzero residual balance, so exactly one Burn log per account.
  • Expected receipt lists burn logs in sorted address order, so a client emitting them in call order (reverse sorted) or creation order would fail.

test_call_with_value_to_coinbase_no_priority_fee_log

Verifies no Transfer log is emitted for the coinbase priority fee payment:

  • A contract executes CALL with nonzero value to the coinbase address.
  • The tx pays a nonzero priority fee to that same coinbase.
  • Expected receipt has exactly one Transfer log (for the CALL). An implementation that over-logs protocol-level balance changes would emit an extra log for the fee and fail.

test_finalization_burn_log_single_account_multiple_transfers

Verifies finalization emits exactly one Burn log for a single to-be-deleted account even when it receives multiple ETH transfers after SELFDESTRUCT in the same tx:

  • One account is created in the tx via CREATE and immediately SELFDESTRUCT'd to a beneficiary, zeroing its balance.
  • N payer contracts then each fund that same destroyed account with a distinct nonzero amount.
  • At finalization the destroyed account has one residual balance equal to the sum of those transfers.
  • Expected receipt contains exactly one Burn log for that account with the combined amount, so a client emitting one Burn log per transfer would fail.

🔗 Related Issues or PRs

✅ 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).

Adds a dedicated test that proves finalization burn logs are emitted
in lexicographical address order when multiple accounts are marked for
deletion in the same transaction.

Parametrized over N in {2, 5}. N accounts are created and
SELFDESTRUCT'd in the same tx, then funded via payer contracts called
in REVERSE sorted address order with distinct nonzero amounts. Each
destroyed account ends with a unique nonzero balance at finalization,
so ordering by address vs. by call order is always distinguishable.

Addresses issue ethereum#2691.
@spencer-tb spencer-tb added C-feat Category: an improvement or new feature A-tests Area: Consensus tests. labels Apr 19, 2026
@spencer-tb spencer-tb requested a review from Carsons-Eels April 19, 2026 13:59
Adds a dedicated test proving the coinbase priority fee payment does
not produce a Transfer log.

A contract CALLs the coinbase address with nonzero value while the tx
pays a nonzero priority fee to that same coinbase. Only the
CALL-with-value must produce a Transfer log; the priority fee credit
happens outside the EVM as a protocol-level balance change.

An implementation that hooks every balance addition (instead of only
CALL / SELFDESTRUCT / tx-level value transfers) would emit an extra
Transfer log for the fee and fail the exact-log assertion.

Addresses issue ethereum#2692.
@spencer-tb spencer-tb changed the title feat(tests): EIP-7708 - multi-account finalization burn log ordering feat(tests): EIP-7708 - finalization burn log ordering + coinbase fee no-log Apr 19, 2026
@spencer-tb
Copy link
Copy Markdown
Contributor Author

cc @chfast

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.26%. Comparing base (bf16746) to head (6fe6843).
⚠️ Report is 328 commits behind head on eips/amsterdam/eip-7708.

Additional details and impacted files
@@                     Coverage Diff                     @@
##           eips/amsterdam/eip-7708    #2717      +/-   ##
===========================================================
+ Coverage                    86.14%   86.26%   +0.11%     
===========================================================
  Files                          599      599              
  Lines                        39491    37016    -2475     
  Branches                      3782     3802      +20     
===========================================================
- Hits                         34021    31930    -2091     
+ Misses                        4848     4522     -326     
+ Partials                       622      564      -58     
Flag Coverage Δ
unittests 86.26% <ø> (+0.11%) ⬆️

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.

Copy link
Copy Markdown
Member

@chfast chfast left a comment

Choose a reason for hiding this comment

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

Description looks good.

Can you also check if we have the "final burn" test were there are multiple ETH transfers to the single to-be-destructed account?

@spencer-tb spencer-tb force-pushed the tests/eip-7708-finalization-burn-log-ordering branch from b7d3f05 to bd3b41b Compare April 20, 2026 10:21
@spencer-tb spencer-tb requested a review from marioevz April 20, 2026 10:44
@spencer-tb
Copy link
Copy Markdown
Contributor Author

Description looks good.

Can you also check if we have the "final burn" test were there are multiple ETH transfers to the single to-be-destructed account?

Thanks! Added and updated the PR description!

Copy link
Copy Markdown
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

LGTM, I pushed a couple of small fixes.

@marioevz marioevz merged commit 42b54ae into ethereum:eips/amsterdam/eip-7708 Apr 20, 2026
18 checks passed
spencer-tb added a commit to spencer-tb/execution-specs that referenced this pull request Apr 20, 2026
… no-log (ethereum#2717)

* feat(tests): EIP-7708 - multi-account finalization burn log ordering

Adds a dedicated test that proves finalization burn logs are emitted
in lexicographical address order when multiple accounts are marked for
deletion in the same transaction.

Parametrized over N in {2, 5}. N accounts are created and
SELFDESTRUCT'd in the same tx, then funded via payer contracts called
in REVERSE sorted address order with distinct nonzero amounts. Each
destroyed account ends with a unique nonzero balance at finalization,
so ordering by address vs. by call order is always distinguishable.

Addresses issue ethereum#2691.

* feat(tests): EIP-7708 - coinbase priority fee must not emit transfer log

Adds a dedicated test proving the coinbase priority fee payment does
not produce a Transfer log.

A contract CALLs the coinbase address with nonzero value while the tx
pays a nonzero priority fee to that same coinbase. Only the
CALL-with-value must produce a Transfer log; the priority fee credit
happens outside the EVM as a protocol-level balance change.

An implementation that hooks every balance addition (instead of only
CALL / SELFDESTRUCT / tx-level value transfers) would emit an extra
Transfer log for the fee and fail the exact-log assertion.

Addresses issue ethereum#2692.

* feat(tests): add single account multi transfer test

* fix(tests): minor nit

---------

Co-authored-by: marioevz <marioevz@gmail.com>
Carsons-Eels pushed a commit to Carsons-Eels/execution-specs that referenced this pull request Apr 27, 2026
… no-log (ethereum#2717)

* feat(tests): EIP-7708 - multi-account finalization burn log ordering

Adds a dedicated test that proves finalization burn logs are emitted
in lexicographical address order when multiple accounts are marked for
deletion in the same transaction.

Parametrized over N in {2, 5}. N accounts are created and
SELFDESTRUCT'd in the same tx, then funded via payer contracts called
in REVERSE sorted address order with distinct nonzero amounts. Each
destroyed account ends with a unique nonzero balance at finalization,
so ordering by address vs. by call order is always distinguishable.

Addresses issue ethereum#2691.

* feat(tests): EIP-7708 - coinbase priority fee must not emit transfer log

Adds a dedicated test proving the coinbase priority fee payment does
not produce a Transfer log.

A contract CALLs the coinbase address with nonzero value while the tx
pays a nonzero priority fee to that same coinbase. Only the
CALL-with-value must produce a Transfer log; the priority fee credit
happens outside the EVM as a protocol-level balance change.

An implementation that hooks every balance addition (instead of only
CALL / SELFDESTRUCT / tx-level value transfers) would emit an extra
Transfer log for the fee and fail the exact-log assertion.

Addresses issue ethereum#2692.

* feat(tests): add single account multi transfer test

* fix(tests): minor nit

---------

Co-authored-by: marioevz <marioevz@gmail.com>
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-feat Category: an improvement or new feature P-high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants