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
Use batch validation for Sapling proofs and signatures #6048
Conversation
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.
Provisional ACK for f80a61df4fd2c6380a0f574672fdf5d53b89c7da (obviously after splitting into a separate PR) with a question.
f80a61d
to
fab9e9b
Compare
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.
testedACK; I can't make this an official github "approval" because I opened the PR, despite the fact that I didn't write it.
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.
utACK with suggestions.
This block has 470 transactions, containing a total of 452 Sapling spends and 1862 outputs, making for a nice benchmark of verification performance.
fab9e9b
to
828f566
Compare
Force-pushed to fix the gtest failure, and add a Sapling-full block benchmark. Average validation time for block 1723244 on my Ryzen 9 5950X:
The current PR therefore gives a reduction of 56.7%. Note that both of these are running on a single thread, so there are futher reductions we could get, either by splitting the batch items across multiple batches, or using threadpools inside the batch logic (which @ebfull is currently trying out). |
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.
utACK modulo updating librustzcash version.
Yeah, running gitian on https://github.com/nuttycom/zcash/tree/sapling-batch-validation (hash
and the relevant cargo lint failed:
|
Yep, that Gitian failure is expected because I did not fully update this PR to correctly use patching, since that is not what we will be deploying. I'm updating the PR right now to use the new crate releases. |
828f566
to
af59b2a
Compare
Force-pushed to use the published |
Re-ran the benchmarks from the first commit in this PR on my Ryzen 9 5950x:
Benchmark dataUnbatched[
{
"runningtime": 8.884456
},
{
"runningtime": 8.887702000000001
},
{
"runningtime": 8.880763
},
{
"runningtime": 8.86946
},
{
"runningtime": 8.870950000000001
},
{
"runningtime": 8.872097
},
{
"runningtime": 8.880618999999999
},
{
"runningtime": 8.871511999999999
},
{
"runningtime": 8.887917999999999
},
{
"runningtime": 8.873296
}
] Batched[
{
"runningtime": 1.900179
},
{
"runningtime": 1.88112
},
{
"runningtime": 1.882656
},
{
"runningtime": 1.888303
},
{
"runningtime": 1.879558
},
{
"runningtime": 1.892048
},
{
"runningtime": 1.882502
},
{
"runningtime": 1.880664
},
{
"runningtime": 1.881228
},
{
"runningtime": 1.880931
}
] |
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.
utACK af59b2a
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.
utACK
This is based on #6000
The original branch is str4d/zcash@sapling-batch-validation; opening this PR from my fork as I don't have permissions to push this back to @str4d's remote.