Skip to content

feat(test-benchmark): devnet-7 compatibility for stateful benchmark - #2885

Closed
LouisTsai-Csie wants to merge 194 commits into
ethereum:devnets/bal/7from
LouisTsai-Csie:devnet-7-bench
Closed

feat(test-benchmark): devnet-7 compatibility for stateful benchmark#2885
LouisTsai-Csie wants to merge 194 commits into
ethereum:devnets/bal/7from
LouisTsai-Csie:devnet-7-bench

Conversation

@LouisTsai-Csie

@LouisTsai-Csie LouisTsai-Csie commented May 20, 2026

Copy link
Copy Markdown
Contributor

🗒️ Description

This is the branch for benchmarking on devnet-7. It should not be merged before the following issue being resolved:

  • Three commits being reverted, since they are conflicting the existing benchmark implementation (Done ✅ )
  • commit: 97870e8
  • commit: 0d06ba2
  • commit: 0cd4522

Details of each commit:

  • commit 765f607: there are several cache strategies, now we only need NO_CACHE variant, this commit remove all the other combination.
  • commit 3c11409: use dynamic gas cost calculation instead of hardcoding cost.
  • commit 159d43b: same as commit 3c11409
  • commit 2eee485: Update pre-funding account, originally we use 0x111...111 as initial pkey, but it is already occupied, update it to use a more random seed. Related PR feat: add extra withdrawal request for pre-funding NethermindEth/gas-benchmarks#146 could be found in gas-benchmarks.
  • commit 8a911bb: refactor test_sstore_bloated benchmark to support eip-8037 state gas calculation.
  • commit 15ee1b1 and ea8c452: there were some linting issue in devnets/bal/7 branch. These commits used for fixing the linting issue.

For commit 765f607, 3c11409 and 8a911bb, they are already reviewed and merged into devnets/bal/3. This PR cherry-picks them to make sure benchmark test implementation is up-to-date to the latest spec.

Then the linting issue should be fixed, which is included in this PR #2884 , and then rebase this PR, review and merge.

🔗 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-->

Carsons-Eels and others added 30 commits April 20, 2026 22:54
fix(spec-specs): correct CR issues, fix formatting

fix(spec-specs): inline `execute_code()` to `process_message()`

chore(spec-specs): backport changes

fix(spec-specs): trim out whitespace in topic hash to match tests

feat(spec-specs): add selfdestruct event topic and logging function

feat(spec-specs): selfdestruct to self emits selfdestruct event

feat(spec-specs): define call success constant

feat(spec-specs): emit selfdestruct finalization log for remaining balance
test(test-tests): add selfdestruct topic and use empty account

test(test-tests): add nested calls log ordering test

feat(test-tests): add selfdestruct finalization test

fix(test-tests): use spaces in event signature to match spec
…e charges (ethereum#2059)

* fix(spec-specs): Move account closure log emission before priority fee charges

* fix(spec-specs): formatting and spelling tweaks

* fix(spec-specs): remove duplicate WriteInStaticContext check

* refactor(spec-specs): align memory expansion with other opcodes

* fix(testing/test): Fix unit test expectation

* refactor(spec-specs): move post-mining coinbase balance calculation

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
* feat(test-specs): add/refactor tests, add mainnet marked, checklist, coverage check

* feat(test-specs): add fork transition test for selfdestruct logs

* fix: tests

* chore(test-specs): fix fork transition tests

* test(test-specs): add code deposit oog test case

---------

Co-authored-by: carsons-eels <carson@ethereum.org>
Co-authored-by: Mario Vega <marioevz@gmail.com>
)

* fix(spec,text): Updates to EIP-7708 spec for bal-devnet-2

- fix(spec,test): EIP-7708 emit selfdestruct logs only in same tx
- fix(spec,test): EIP-7708, only emit on transfers to other accounts
- Add more tests that match these edge cases

* feat(test): tests for finalization selfdest + bal transfer in lexicographic order

* fix: changes from comments on PR ethereum#2086

* add more variants to test_selfdestruct_same_tx_via_call

* fix: docstring

* refactor: improvements from comments on PR ethereum#2086

* Update test to use dynamic addresses

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
… (ethereum#2106)

- Add CREATE2 support via with_all_create_opcodes marker
- Add tests for SELFDESTRUCT to coinbase - revealed a change needed since
  the last update was made to the EIP that should be included in the
  currect refspec (miner fees paid before finalization LOG2).
Co-authored-by: raxhvl <raxhvl@users.noreply.github.com>
…m#2211)

* ♻️ refactor: Rename selfdestruct log to burn

* 🥢 nit:

* chore(tests): fix stale selfdestruct references and rename to burn

---------

Co-authored-by: raxhvl <raxhvl@users.noreply.github.com>
Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
… 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>
Align EIP-7708 selfdestruct finalization test with the gas constant
rename on forks/amsterdam.
…unds (ethereum#1401)

* feat(specs): add eip-7778 implementation

* fix(specs) spliting receipt gas from block gas

* revert receipt_gas_used

* make sure that the calldata floor cost overwrites the tx gas before refund

* receipt gas used after refunds

* clarify variable naming @gurukamath

* revert to using gas used after refunds for cumulative gas in receipt and add gasSpent to receipt

* spec(amsterdam): fix code formatting

---------

Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
* fix(tests): fix legacy tests to run with eip-7778

* fix(tests): check gas_spent and gas_used after Amsterdam
* feat(spec-tests): add eip-7778 for calldata checks

* feat(spec-tests): post review - use code gas_cost function

Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com>
Co-authored-by: Mario Vega <marioevz@gmail.com>
The set iteration in `build_refund_tx` is non-deterministic due to
Python's hash randomization, causing fixture output to vary between
runs. Sort by enum value to ensure reproducible fixtures.
* feat(amsterdam): Implement EIP-7843 SLOTNUM opcode

* mario feedback
spencer-tb and others added 15 commits May 13, 2026 15:22
Add a `large_zero_calldata_and_access_list_insufficient_gas`
parametrize to `test_floor_cost_validation_with_access_list`,
paralleling the existing `large_calldata_and_access_list_insufficient_gas`
(non-zero bytes) and exercising the `intrinsic <= gas_limit < floor`
window with a 1,700-gas margin between regular intrinsic and floor
(vs. ~19,700 for the non-zero variant).

Closes ethereum#2800.
…bal/7

# Conflicts:
#	docs/writing_tests/test_markers.md
#	packages/testing/src/execution_testing/specs/blockchain.py
#	src/ethereum/forks/amsterdam/fork.py
#	src/ethereum/forks/amsterdam/vm/__init__.py
#	src/ethereum/forks/amsterdam/vm/instructions/system.py
#	src/ethereum/forks/amsterdam/vm/interpreter.py
#	tests/amsterdam/eip7708_eth_transfer_logs/spec.py
#	tests/amsterdam/eip7708_eth_transfer_logs/test_burn_logs.py
#	tests/amsterdam/eip7708_eth_transfer_logs/test_fork_transition.py
#	tests/amsterdam/eip7708_eth_transfer_logs/test_transfer_logs.py
#	tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_gas_accounting.py
#	tests/amsterdam/eip7843_slotnum/test_slotnum.py
#	tests/amsterdam/eip7954_increase_max_contract_size/test_fork_transition.py
#	tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
#	tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py
#	tests/cancun/eip6780_selfdestruct/test_selfdestruct.py
…hmark (ethereum#2771)

* refactor: failing 8037 benchmark cases

* refactor: auth tx limit

* fix: linitng issue

* chore: ignore local EIP-8037 notes in `markdownlint-cli2`

Add `.markdownlint-cli2.yaml` with an `ignores` list for the
`EIP8037_REMAINING_FAILURES.md`, `EIP8037_PORTED_STATIC_FAILURES.md`,
and `EIP8037_IMPLEMENTATION.md` working notes at the repo root.

* refactor: deploy contract gas limit accounting

* fix: gas accounting

* feat: add stub for new snapshot

---------

Co-authored-by: danceratopz <danceratopz@gmail.com>
@LouisTsai-Csie
LouisTsai-Csie changed the base branch from forks/amsterdam to devnets/bal/7 May 20, 2026 06:17
@LouisTsai-Csie
LouisTsai-Csie marked this pull request as draft May 20, 2026 06:18
Comment on lines +647 to +651
gas_limit=(
intrinsic_calc(authorization_list_or_count=1)
+ storage_init_code.gas_cost(fork)
+ 500_000
),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Remove the hardcoded gas limit, adjust to dynamic gas cost calculation and leave some buffer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This applies to other changes within the file.

@LouisTsai-Csie

Copy link
Copy Markdown
Contributor Author

Superseded by PR #2977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.