-
Notifications
You must be signed in to change notification settings - Fork 94
feat: remove MaxPrecompileCalls #381
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
Would be helpful to have some sort of benchmarking done to see what a reasonable limit here would be. Do you have any immediate reason to lift it now? |
yeah absolutely, do you already have some rough ideas on how to benchmark it? do i just run a contract function that invokes a precompile N times and monitor memory usage?
not really, i used to in the past, but i ended up rewriting my precompile in a way that allows to batch operations |
This sounds pretty reasonable. A graph that shows memory increasing over N precompile calls would be pretty useful to have. |
Hey @vladjdk, here's what I did (a bit cumbersome and "manual" but it was the quickest way I found, I'm not very familiar with all the codebase):
I run the test 3 times to average out the memory usages, using pprof, like this:
and here are the results I collected:
I couldn't do more that 100 precompile calls because it would exceed the gas allowance of 250.000 when estimating gas fees. The interesting thing I see is that the more precompile calls the less memory they use (at least after the initial 20-50 calls), then the cost becomes fixed. In my opinion the gas cost already prevents abuse so a limit is not really needed, but we could leave it to a high number (e.g. 100). Is that enough data for you to take a decision? |
@Pitasi conflicts right now |
5d9f171
to
11de2c7
Compare
resolved |
btw fyi the test i removed "should revert the changes and NOT delegate - failed tx - max precompile calls reached" was not working anyway because the first staking call always reverts :) so the test was expecting a revert after 7 calls, but it actually is receiving a revert after the first one |
5ba1ca3
to
695e9e1
Compare
@Pitasi we're thinking of merging this in to enable the more complex precompile reversion test cases. Few questions:
I'm debating whether we should increase the limit or outright remove it. |
695e9e1
to
3a6d15f
Compare
Description
Closes: #135
This should not have a huge impact, after #244.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
main
branchReviewers Checklist
All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.
I have...
Unreleased
section inCHANGELOG.md