-
Notifications
You must be signed in to change notification settings - Fork 146
feat(tests): Update benchmark test to query newly introduced max_code_size()
from fork config
#1649
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
feat(tests): Update benchmark test to query newly introduced max_code_size()
from fork config
#1649
Conversation
max_code_size()
from fork config
@jsign I'm coming to this test from the EIP-7907 discussions (not zk related). I'm wondering how this benchmark should be ran? It thus includes the pre-setup of deploying these large contracts. It is clear that the final block contains the actual data we care about, but I'm not sure if test executors have a direct way to measure this. Should I just hack in a performance timer to measure the time it takes to execute the last block? |
AFAIK, today test executors never have a special consideration for benchmark-like tests, so I think if you want to measure wall-clock time I think you prob have to do a hack yes. |
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.
LGTM, it just needs a rebase to fix CI and conflicts.
Thanks for implementing this :)
I'll get this one ready for review either tonight or tomorrow 😄 👍 (But also feel free to pick this up and get it over the finish line, this comment to edit the predeploy gas limit back to the original high limit: #1649 (comment) should be taken into account) |
1574a08
to
d5b19d2
Compare
Have also edited the other tests which now depend on the max code size to read it from the fork. Could, once this is merged, all other PRs which have the @jsign also see my comment on the "changed" gas limit here: #1649 (comment). I think it is more clear to make this a formula, but I am also fine by hardcoding a very high gas limit. @marioevz Typecheck correctly complains that my |
@jochem-brouwer, replied the thread we had! (but overall lgtm). Do you mind remembering before merging (or when fully ready) to ping me so I fill these changed tests and I double check cycles as a last check to not see any difference?
Agree, I can do that after this is merged. |
I want to get this PR merged, but I need to solve this |
Makes sense to me, default from frontier should be 24 KiB, and every test that uses this parameter should take this into account, although I doubt it will even be a problem. |
d5e6317
to
a14cb3d
Compare
Before this gets merged, could @jsign gives this an explicit ✔️ after:
To see if I did not mess up any tests 😄 👍 Ready for review! 🚀 |
I removed the EIP 7907 config from Osaka also, for experimenting this is fine but I don't think we want to activate it by default (?) |
I'll do a full run of current master vs this branch to compare them and report back! |
@jochem-brouwer, something feels odd since seems like filling tests in this branch takes way longer than in What I'm using to fill: I think that shouldn't be the case, no? |
Definitely not! I do not have time to look at it today, but will pick this up tomorrow. What filler are you using? Standard EELS? How many tests does this pick up? The gas limit is set as 36M which is reasonable this might therefore also have found a performance degradation in the filler? However my hunch says it has to do with the tests I raised the gas limit above the setting you provided. Maybe I messed up the calculation and it generates way too many contracts and because of the raised gas limit this is thus possible? Likely has to do with a test with elevated gas limits. |
I'm using geth as a filler, but in theory shouldn't matter since I also used it for the
Yep, I suspect the same. Probably related with the only test that now calculates differently the number of contracts and maybe something odd there! |
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.
Compared cycles and all looks good 👍 (assuming latest Mario code change is applied)
Co-authored-by: Paweł Bylica <[email protected]>
Co-authored-by: Paweł Bylica <[email protected]>
Co-authored-by: Paweł Bylica <[email protected]>
…fork-based max code size
Co-authored-by: Mario Vega <[email protected]>
608a439
to
0ed1dc1
Compare
Once CI passes I will merge this one, the rebase conflicts with the max code sizes are getting annoying. After merge thus read max code size from fork instead of using a constant (will be enforced (likely) on existing files but should also be done on new test files) |
🗒️ Description
This PR expands the benchmark test which queries as many other accounts (
EXTCODE*
andCALL*
operations) by also providing a max code size setting in the fork.max_code_size()
to forksmax_initcode_size()
to forksNote that the deposit costs for the EIP-7907 are much higher (relative) than the original costs. This includes the 200 gas/byte code deposit cost, but also the quadratic memory expansion cost.
The cost of querying one such contract (the "loop cost" of the benchmark) is calculated as 2687 gas/contract. The deposit however costs at least 52M gas due to the 200 gas/byte deposit cost of the 0x40000 bytes. So the cost to deposit such contract vs. querying it is about
20_000
times higher 👀🔗 Related Issues
max_initcode_size()
as wellExpands the benchmark to also include the bumped sizes in https://eips.ethereum.org/EIPS/eip-7907max_initcode_size
ormax_code_size
for Osaka has to be manually edited to return that value✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.