Skip to content

refactor(test-benchmark): centralize benchmark helper utilities#3166

Merged
spencer-tb merged 9 commits into
ethereum:devnets/glamsterdam/6-benchmarksfrom
LouisTsai-Csie:organize-benchmark-helper
Jul 15, 2026
Merged

refactor(test-benchmark): centralize benchmark helper utilities#3166
spencer-tb merged 9 commits into
ethereum:devnets/glamsterdam/6-benchmarksfrom
LouisTsai-Csie:organize-benchmark-helper

Conversation

@LouisTsai-Csie

@LouisTsai-Csie LouisTsai-Csie commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Consolidates the three scattered helpers.py modules (tests/benchmark/compute/helpers.py, tests/benchmark/stateful/helpers.py, and the shared parts of tests/benchmark/stateful/eip7928_block_level_access_lists/helpers.py) into the existing shared package tests/benchmark/helper/, organized by domain:

Module Contents
numeric.py Numeric / stack helpers (neg, sar, make_dup, DEFAULT_BINOP_ARGS, …)
enums.py Parametrization enums (StorageAction, ReturnDataStyle, CacheStrategy, TransactionResult)
loops.py Loop-construction bytecode (DECREMENT_COUNTER_CONDITION)
precompile.py Precompile opcode targets, calculate_optimal_input_length
contract_factory.py CustomSizedContractInitcode / CustomSizedContractFactory, ContractDeploymentTransaction
transactions.py build_benchmark_txs, pack_transactions_into_blocks, build_cache_strategy_blocks
storage.py SSTORE initializers, StorageInitRange, build_sequential_storage_init, calldata/access-list generators
delegation.py EIP-7702 delegation setup, run_bloated_eoa_benchmark
  • primitives: numeric, enums)
  • building blocks: loops,precompile, contract_factory, transactions, storage, account_creator, account_sender_receiver
  • scenario runners: delegation

Cleanups included in the PR:

  • Removed unused symbols: CallDataOrigin, concatenate_parameters (also drops the cross-suite tests.osaka import it required), ALLOWANCE_SELECTOR, MINT_SELECTOR.
  • Moved the remaining ERC20 selectors into test_erc20.py, their only consumer.

No test logic changes within this PR, only code refactor.

Related Issues or PRs

Issue #2625

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

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

@LouisTsai-Csie LouisTsai-Csie added C-refactor Category: refactor A-test-benchmark Area: execution_testing.benchmark and tests/benchmark labels Jul 14, 2026
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (devnets/glamsterdam/6-benchmarks@cb85576). Learn more about missing BASE report.

Additional details and impacted files
@@                         Coverage Diff                         @@
##             devnets/glamsterdam/6-benchmarks    #3166   +/-   ##
===================================================================
  Coverage                                    ?   93.30%           
===================================================================
  Files                                       ?      624           
  Lines                                       ?    36986           
  Branches                                    ?     3383           
===================================================================
  Hits                                        ?    34508           
  Misses                                      ?     1695           
  Partials                                    ?      783           
Flag Coverage Δ
unittests 93.30% <ø> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

@spencer-tb spencer-tb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Refactor is clean. Easy to approve here!

@spencer-tb
spencer-tb merged commit f598615 into ethereum:devnets/glamsterdam/6-benchmarks Jul 15, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-benchmark Area: execution_testing.benchmark and tests/benchmark C-refactor Category: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants