-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
refactor(protocol): optimize storage reads/writes in proveBlock #17532
Conversation
refactor(protocol): optimize storage reads/writes in proveBlock
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
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.
Looks okay, but there's a lot of logic related to these state transitions and it's too much for me to keep in my head just reviewing these PRs without going through all the logic again so I don't know for sure.
We do need to review the changes more carefully before pushing them. Please take your time. |
Brecht, please take another look. I made some new changes. |
This reverts commit 42c45d70a741ac879b90fbb778289f9475a96387.
This reverts commit d897500.
Most
proveBlock
transactions submit a new state transition for blocks. Previously we would fetch and compare storage values from the state transition ring buffer with the prover's values, updating each slot one by one.With the new optimization, we bypass fetching these values for new state transitions (because the slots' current values don't matter), instead opting to perform a direct storage save at the end.
This optimisation reduces gas by 20K.