-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix(verify): Only verify halo2 proofs once per transaction #4752
Conversation
I'm running a full sync here: It should finish in around 6 hours. |
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.
Definitely good, no need to do this inside the loop. Nice find.
It seems this should be merged anyway even if it does not make the difference in time right now, it is a performance fix. |
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.
That's a great find!
…one per Action Co-authored-by: Marek <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #4752 +/- ##
==========================================
- Coverage 78.87% 78.86% -0.02%
==========================================
Files 306 306
Lines 37557 37545 -12
==========================================
- Hits 29624 29608 -16
- Misses 7933 7937 +4 |
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.
All looks good.
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 spec and the existing Halo2 verifier service, looks good!
When we push a new halo2::Item
to the batch verifier, it produces orchard::circuit::Instance
s from each Action in the transacton, and then the whole set of Instance
s is passed as input to verify()
a single Halo2
aggregate proof, so this change is correct.
Admin merged, as the full sync got stuck and we need the fix anyways. |
Motivation
There is only one aggregated halo2 proof per transaction, but Zebra is verifying the same proof for each action.
This uses a lot of RAM and CPU, and stops Zebra syncing to the tip.
Solution
Only verify the halo2 proof once per transaction.
Review
This bug is blocking almost all other work, it's urgent.
Reviewer Checklist