Skip to content

refactor(test-benchmark): update test_account_access, add keccak256 overhead scenario#2947

Draft
LouisTsai-Csie wants to merge 13 commits into
ethereum:forks/amsterdamfrom
LouisTsai-Csie:refactor-account-access-bench
Draft

refactor(test-benchmark): update test_account_access, add keccak256 overhead scenario#2947
LouisTsai-Csie wants to merge 13 commits into
ethereum:forks/amsterdamfrom
LouisTsai-Csie:refactor-account-access-bench

Conversation

@LouisTsai-Csie

@LouisTsai-Csie LouisTsai-Csie commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

🗒️ Description

The original test_account_access targets contracts created by the Bittrex controller factory. This requires CREATE address calculations, introducing significant overhead and it is hard to precisely control over EXP and KECCAK256 inputs.

We introduced several changes in this PR:

  • Move the test_account_access from test_single_opcode.py to test_account_query.py
  • Remove the EXISTING_CONTRACT parametrization, adding EXISTING_CONTRACT_MINIMAL, EXISTING_CONTRACT_SAME and EXISTING_CONTRACT_DIFF parametrization.

deployed contract and initcode for each parametrization:

EXISTING_CONTRACT_MINIMAL
initcode: RETURN(PUSH1(0), PUSH1(1))
deployed code: STOP

EXISTING_CONTRACT_SAME
initcode:

seed 32 bytes of JUMPDEST (5b) at mem[0]
for size in 32, 64, ..., 16384:
    MCOPY mem[0:size] -> mem[size:2*size] # doubles filled region

mem[0] = 0x00 # MSTORE8: STOP

RETURN mem[0:max_code_size]

deployed code:

STOP JUMPDEST JUMPDEST ... ... ... JUMPDEST (fill until max code size)

EXISTING_CONTRACT_DIFF
initcode:

seed 32 bytes of JUMPDEST (5b) at mem[0]
for size in 32, 64, ..., 16384:
    MCOPY mem[0:size] -> mem[size:2*size] # doubles filled region

mem[0] = ADDRESS # MSTORE: ADDRESS

RETURN mem[0:max_code_size]

deployed code:

STOP STOP ... STOP ADDRESS JUMPDEST ... ... ... JUMPDEST (fill until max code size)

  • code[0:12] = STOP
  • code[12:32] = code address, which should be different for each contract

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

@LouisTsai-Csie LouisTsai-Csie self-assigned this Jun 2, 2026
@LouisTsai-Csie LouisTsai-Csie added C-refactor Category: refactor A-test-benchmark Area: execution_testing.benchmark and tests/benchmark labels Jun 2, 2026
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.53%. Comparing base (26ff8a6) to head (4f7cf29).
⚠️ Report is 2 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2947   +/-   ##
================================================
  Coverage            90.53%   90.53%           
================================================
  Files                  535      535           
  Lines                32893    32895    +2     
  Branches              3021     3022    +1     
================================================
+ Hits                 29780    29782    +2     
  Misses                2595     2595           
  Partials               518      518           
Flag Coverage Δ
unittests 90.53% <ø> (+<0.01%) ⬆️

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.

@LouisTsai-Csie LouisTsai-Csie marked this pull request as ready for review June 9, 2026 09:33
@LouisTsai-Csie LouisTsai-Csie force-pushed the refactor-account-access-bench branch from 9561e54 to b5832cd Compare June 9, 2026 09:37
@LouisTsai-Csie

Copy link
Copy Markdown
Collaborator Author

I've rebased the PR and updated the description, please review and integrate contract deployment into state-actor. cc @jochem-brouwer

@LouisTsai-Csie LouisTsai-Csie requested review from marioevz and spencer-tb and removed request for marioevz June 9, 2026 13:31
@LouisTsai-Csie LouisTsai-Csie force-pushed the refactor-account-access-bench branch from b5832cd to 2e62fa1 Compare June 11, 2026 07:37
@LouisTsai-Csie LouisTsai-Csie force-pushed the refactor-account-access-bench branch from 22b4ee8 to be28fa8 Compare June 12, 2026 07:37
@LouisTsai-Csie LouisTsai-Csie force-pushed the refactor-account-access-bench branch 3 times, most recently from 99ae842 to 6ef4781 Compare June 12, 2026 10:20
@LouisTsai-Csie LouisTsai-Csie force-pushed the refactor-account-access-bench branch from 6ef4781 to 4f7cf29 Compare June 12, 2026 10:29
@LouisTsai-Csie LouisTsai-Csie marked this pull request as draft June 12, 2026 12:34
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.

1 participant