-
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(batch): Improve batch verifier async, correctness, and performance #4750
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4750 +/- ##
==========================================
+ Coverage 78.86% 79.00% +0.14%
==========================================
Files 306 305 -1
Lines 37664 37897 +233
==========================================
+ Hits 29704 29941 +237
+ Misses 7960 7956 -4 |
I'm running a full sync here, to see if these fixes help: |
This comment was marked as outdated.
This comment was marked as outdated.
Also use a new verifier channel for each batch.
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.
I think this looks ok but i am not approving yet in case you want to do #4776 on top of this branch first. Feel free to admin merge or let me know how you will want to handle it and ill approve where needed.
I admin-merged this separately from PR #4776, just in case we need to debug them as separate commits. |
Motivation
Zebra's tower-batch has some async performance issues, and contains some buggy and risky code.
We should replace it with more robust code.
Close #4738
Close #4740
Close #4729 (by using a channel that never lags)
Close #4728 (by removing the log entirely)
API Reference
tokio::spawn_blocking()
:https://docs.rs/tokio/latest/tokio/task/fn.spawn_blocking.html
Solution
Improve tower-batch async fairness:
tokio-console
Improve error handling in tower-batch:
Improve channel limit handling in tower-batch:
Improve channel limit handling in zebra-consensus:
Run all verifier cryptography on blocking CPU-bound threads
tokio
threadstokio
threadsRelated fixes:
v5_with_sapling_spends
test (but it's still missing NU5 test vectors)Review
This is blocking
halo2
batch verification, so it would be good to get it in soon.This might fix some bugs we're seeing during syncing.
Reviewer Checklist