Skip to content

Conversation

@LouisTsai-Csie
Copy link
Collaborator

@LouisTsai-Csie LouisTsai-Csie commented Nov 11, 2025

🗒️ Description

Add extra SSTORE benchmark cases, more details linked in the issue #1755 .

🔗 Related Issues or PRs

Issue #1755

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e 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 adding an entry to CHANGELOG.md.
  • 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 Nov 11, 2025
@LouisTsai-Csie LouisTsai-Csie added A-test-benchmark Area: Tests Benchmarks—Performance measurement (eg. `tests/benchmark/*`, `p/t/s/e/benchmark/*`) P-high C-test Category: test labels Nov 11, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.08%. Comparing base (1078413) to head (3c7d208).
⚠️ Report is 3 commits behind head on forks/osaka.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##           forks/osaka    #1774   +/-   ##
============================================
  Coverage        86.08%   86.08%           
============================================
  Files              743      743           
  Lines            44072    44072           
  Branches          3891     3891           
============================================
  Hits             37938    37938           
  Misses            5656     5656           
  Partials           478      478           
Flag Coverage Δ
unittests 86.08% <ø> (ø)

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

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

Thanks some comments! :)


assert len(setup) - 1 == start_marker
assert len(setup) + len(loop) == end_marker
print(f"setup: {len(setup)}, loop: {len(loop)}, cleanup: {len(cleanup)}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove the print?

Suggested change
print(f"setup: {len(setup)}, loop: {len(loop)}, cleanup: {len(cleanup)}")

Comment on lines +533 to +534
if contract_idx == 0:
contract_gas_limit += gas_remainder
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we give the remainder to the first contract? Does the last contract make more sense?

for contract_idx in range(num_contracts):
initial_storage = Storage()

start_slot = contract_idx * slot_count
Copy link
Contributor

Choose a reason for hiding this comment

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

I think using slot_count instead of slots_per_contract creates storage gaps (for example contract 0 uses slots 0-9, contract 1 uses 100-109, contract 2 uses 200-209). With the latter we get, 0-9, 10-19, 20-29 etc

Suggested change
start_slot = contract_idx * slot_count
start_slot = contract_idx * slot_per_contract

Comment on lines +442 to +463
@pytest.mark.parametrize("slot_count", [50, 100])
@pytest.mark.parametrize("use_access_list", [True, False])
@pytest.mark.parametrize(
"contract_size",
[
pytest.param(0, id="just_created"),
pytest.param(1024, id="small"),
pytest.param(12 * 1024, id="medium"),
pytest.param(24 * 1024, id="xen"),
],
)
@pytest.mark.parametrize("sloads_before_sstore", [True, False])
@pytest.mark.parametrize("num_contracts", [1, 5, 10])
@pytest.mark.parametrize(
"initial_value,write_value",
[
pytest.param(0, 0, id="zero_to_zero"),
pytest.param(0, 0xDEADBEEF, id="zero_to_nonzero"),
pytest.param(0xDEADBEEF, 0, id="nonzero_to_zero"),
pytest.param(0xDEADBEEF, 0xBEEFBEEF, id="nonzero_to_nonzero"),
],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will create 384 seperate tests. Do we need this many here? Maybe we should remove some parameterization. I say this with the benchmark release process taking a long time in mind.

Maybe contract size and num contracts can have one element removed from each.

If these are required in your opinion please keep them. Just a thought.

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

Labels

A-test-benchmark Area: Tests Benchmarks—Performance measurement (eg. `tests/benchmark/*`, `p/t/s/e/benchmark/*`) C-test Category: test P-high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants