feat(test-benchmark): strengthen and consolidate TSTORE benchmark - #3441
feat(test-benchmark): strengthen and consolidate TSTORE benchmark#3441chfast wants to merge 1 commit into
Conversation
Rework test_tstore into a single parametrized worst-case benchmark: key = GAS (unique slot per op, no memory counter) or PUSH0 (fixed slot), value = COINBASE (a nonzero op) so each write actually inserts an entry. A zero value lets clients skip the insert and silently hide store growth, so the test asserts the block coinbase is nonzero. The tload parameter adds a transient read (TLOAD and TSTORE share the same 100 gas cost): - none: TSTORE only. - hit: seed the value once, store it under the key and read it back, feeding the result into the next TSTORE so the read is used, not discarded. - miss: store the key, then read a fresh, never-written key so TLOAD misses on the growing store; the value stays COINBASE (nonzero). This subsumes the bloatnet test_tstore_same_key (fixed key) and test_tstore_unique_keys (unique key), which are removed along with their now-empty module.
Benchmark results — geth & besuFilled fixture executed at Osaka, 300M gas via block-test Clients: geth
The Notes:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3441 +/- ##
===================================================
+ Coverage 93.54% 93.77% +0.22%
===================================================
Files 624 624
Lines 37074 36905 -169
Branches 3394 3326 -68
===================================================
- Hits 34681 34606 -75
+ Misses 1644 1597 -47
+ Partials 749 702 -47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Rework test_tstore into a single parametrized worst-case benchmark: key = GAS (unique slot per op, no memory counter) or PUSH0 (fixed slot), value = COINBASE (a nonzero op) so each write actually inserts an entry. A zero value lets clients skip the insert and silently hide store growth, so the test asserts the block coinbase is nonzero.
The tload parameter adds a transient read (TLOAD and TSTORE share the same 100 gas cost):
This subsumes the bloatnet test_tstore_same_key (fixed key) and test_tstore_unique_keys (unique key), which are removed along with their now-empty module.
Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.