-
Notifications
You must be signed in to change notification settings - Fork 9
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
Additional EVM optimizations #850
Conversation
Could we do this based on a cell like |
Yes, we could. |
Hm, but then how do I formulate these? Structurally as well, with the
|
I think I would like to merge this as-is. It works as intended and it's different from cell-based rules like those for |
It would appear that the
|
f9b367e
to
8058a00
Compare
Some interesting updates. There are essentially three version of this optimization:
The results on our largest real-world engagement as follows:
and we see that V2 and V3 outperform V1, and that V3 is consistently slightly faster than V2. In addition, V2 exhibits a slowdown with respect to V1/V3 of ~3% when stack checks are turned on, probably due to the combination of an additional cell and additional high-priority rules that are always checked. V1, given these results, is out of the picture. The pros of the V2 approach are that we don't have to rekompile between runs of the same proof with and without stack checks. A semi-pro is that it the speed-up is comparable to V2. The cons are that we introduce a new cell into the configuration and that there is a slowdown when stack checks are turned on. The pros of the V3 approach are that it is the fastest, and that there is no slowdown when stack checks are turned back on. The cons are that one does have to rekompile if one wants to use re-run a proof stack checks. The mitigation of that con is that our working hypothesis is strong and that we would want to re-run a proof with stack checks very rarely. Given this data, my choice is V3. Thoughts? |
8058a00
to
f9b367e
Compare
We are going with V2 in the end, everything is in place and CI is passing. @ehildenb |
I approved, but something to fix. When doing
We should also add a test of |
If these rules are included in I am also not quite understanding in which context All of this indicates to me that these rules should perhaps be added to KEVM (just like the |
I can confirm that the |
When it comes to testing |
This PR introduces optional additional optimizations for some of the EVM opcodes. It eliminates the word stack overflow and underflow checks, relying on the hypothesis that EVM bytecode coming from Solidity will not cause a stack overflow or underflow. The speed-up on our real-world engagements ranges between 5% and 20%, as per the following tables: