-
Notifications
You must be signed in to change notification settings - Fork 375
feat: add extra sstore benchmark cases #1774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: forks/osaka
Are you sure you want to change the base?
feat: add extra sstore benchmark cases #1774
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
spencer-tb
left a comment
There was a problem hiding this 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)}") |
There was a problem hiding this comment.
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?
| print(f"setup: {len(setup)}, loop: {len(loop)}, cleanup: {len(cleanup)}") |
| if contract_idx == 0: | ||
| contract_gas_limit += gas_remainder |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
| start_slot = contract_idx * slot_count | |
| start_slot = contract_idx * slot_per_contract |
| @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"), | ||
| ], | ||
| ) |
There was a problem hiding this comment.
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.
🗒️ Description
Add extra SSTORE benchmark cases, more details linked in the issue #1755 .
🔗 Related Issues or PRs
Issue #1755
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture