refactor(tests): tx_gas and cold_gas for gas_test generator#2083
refactor(tests): tx_gas and cold_gas for gas_test generator#2083LouisTsai-Csie merged 2 commits intoethereum:forks/amsterdamfrom
tx_gas and cold_gas for gas_test generator#2083Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2083 +/- ##
===================================================
+ Coverage 88.17% 88.62% +0.45%
===================================================
Files 577 577
Lines 35659 35659
Branches 3490 3490
===================================================
+ Hits 31442 31604 +162
+ Misses 3654 3492 -162
Partials 563 563
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:
|
1fbe395 to
bd64982
Compare
|
@spencer-tb I think this is going to be affected by EIP-8037, could you take a look pls? |
|
I think we could use gas_costs = fork.gas_costs()
opcode_gas_cost = gas_costs.GAS_BASE
opcode_pop_cost = gas_costs.GAS_BASE
opcode_push_cost = gas_costs.GAS_VERY_LOW
gas_single_gas_run = (
2 * opcode_gas_cost
+ opcode_pop_cost
+ gas_costs.GAS_WARM_ACCOUNT_ACCESS
+ 6 * opcode_push_cost
)Some example: the code execution-specs/tests/benchmark/stateful/bloatnet/test_multi_opcode.py Lines 488 to 506 in c74dfbe the gas accounting execution-specs/tests/benchmark/stateful/bloatnet/test_multi_opcode.py Lines 512 to 516 in c74dfbe |
|
Applied the suggestion about |
|
@LouisTsai-Csie @spencer-tb @marioevz - gentle ping on this - should I try to get this rebased and mergeable or is there anything blocking this? |
|
@pdobacz I am sorry for late response, could you please rebase again, and let me know when it is ready for review again? I would keep track of this issue to merge, thank you |
|
@LouisTsai-Csie np, done! |
LouisTsai-Csie
left a comment
There was a problem hiding this comment.
LGTM, thank you!
tx_gas and cold_gas for gas_test generator
🗒️ Description
gas_testgenerator had some gas values hardcoded and wasn't immune to gas repricings. This PR should provide tx_gas based on forks gas_cost values.Also, it allows to specify
cold_gas=0to test opcodes like REVERT, and unlocks some standard gas cost tests🔗 Related Issues or PRs
N/A.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.