-
Notifications
You must be signed in to change notification settings - Fork 146
feat(tests): add benchmark for the worst initcode jumpdest analysis #1646
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: main
Are you sure you want to change the base?
Conversation
6b017c7
to
f9b75b4
Compare
Benchmarking EIP-7907: Meter Contract Code Size And Increase LimitThis test can be used to benchmark EIP-7907. The implementation must allow initcodes longer than the Prague limit. Generated state test: worst_initcode_jumpdest_analysis.json ResultsevmoneIt looks like increasing the limit causes the test to be executed ~6x longer, but this is still ~192Mgas/s in the worst case.
Geth[
{
"name": "tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Osaka-state_test-605b5b-initcode_size_49152]",
"pass": true,
"stateRoot": "0x6ce6519d6ba9af1d21bfff604bdd25e2912a5f79a5cd7ee35abc7db1a1c76b31",
"fork": "Osaka",
"benchStats": {
"time": 102958028,
"allocs": 110530,
"bytesAllocated": 123316072,
"gasUsed": 72000000
}
},
{
"name": "tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Osaka-state_test-615b5b-initcode_size_49152]",
"pass": true,
"stateRoot": "0x6ce6519d6ba9af1d21bfff604bdd25e2912a5f79a5cd7ee35abc7db1a1c76b31",
"fork": "Osaka",
"benchStats": {
"time": 97807776,
"allocs": 110570,
"bytesAllocated": 123322833,
"gasUsed": 72000000
}
},
{
"name": "tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Osaka-state_test-615b5b5b-initcode_size_49152]",
"pass": true,
"stateRoot": "0x6ce6519d6ba9af1d21bfff604bdd25e2912a5f79a5cd7ee35abc7db1a1c76b31",
"fork": "Osaka",
"benchStats": {
"time": 89937716,
"allocs": 110541,
"bytesAllocated": 123318193,
"gasUsed": 72000000
}
},
{
"name": "tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Osaka-state_test-00-initcode_size_49152]",
"pass": true,
"stateRoot": "0x6ce6519d6ba9af1d21bfff604bdd25e2912a5f79a5cd7ee35abc7db1a1c76b31",
"fork": "Osaka",
"benchStats": {
"time": 71727318,
"allocs": 110613,
"bytesAllocated": 123327866,
"gasUsed": 72000000
}
},
{
"name": "tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Osaka-state_test-5b-initcode_size_49152]",
"pass": true,
"stateRoot": "0x6ce6519d6ba9af1d21bfff604bdd25e2912a5f79a5cd7ee35abc7db1a1c76b31",
"fork": "Osaka",
"benchStats": {
"time": 69766863,
"allocs": 110608,
"bytesAllocated": 123328256,
"gasUsed": 72000000
}
},
{
"name": "tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Osaka-state_test-605b-initcode_size_49152]",
"pass": true,
"stateRoot": "0x6ce6519d6ba9af1d21bfff604bdd25e2912a5f79a5cd7ee35abc7db1a1c76b31",
"fork": "Osaka",
"benchStats": {
"time": 102013648,
"allocs": 110550,
"bytesAllocated": 123313963,
"gasUsed": 72000000
}
}
] |
f9b75b4
to
5f1d2b2
Compare
@chfast if there is a 6x performance degradation does this mean the initcode pricing from 3860 is too cheap? One would assume this extra initcode analysis is paid for? (2 gas per 32 bytes is thus too cheap for initcode analysis?) |
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.
Apart from the #1649 discussion, LGTM!
Cycles:
tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Cancun-blockchain_test_from_state_test-615b5b-initcode_size_49152]-1 255986171
tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Cancun-blockchain_test_from_state_test-605b-initcode_size_49152]-1 330872313
tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Cancun-blockchain_test_from_state_test-615b5b5b-initcode_size_49152]-1 381150402
tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Cancun-blockchain_test_from_state_test-00-initcode_size_49152]-1 406269727
tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Cancun-blockchain_test_from_state_test-605b5b-initcode_size_49152]-1 473544495
tests/zkevm/test_worst_bytecode.py::test_worst_initcode_jumpdest_analysis[fork_Cancun-blockchain_test_from_state_test-5b-initcode_size_49152]-1 758025210
2303aa9
to
4fc2d6b
Compare
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.
Double checked the cycles with the last time I reported and looks good.
4fc2d6b
to
e4eba6b
Compare
🗒️ Description
Add a benchmark where we place a very long initcode in the memory and then invoke
CREATE
instructions with this initcode up to the block gas limit. The initcode itself have minimal execution time but forces the EVM to perform the full jumpdest analysis on the parametrized byte pattern. The initicode is slightly modified betweenCREATE
invocations to prevent caching.🔗 Related Issues
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.