-
Notifications
You must be signed in to change notification settings - Fork 715
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
Check signature verif performance #3071
Comments
Operation verification occurs there:
I propose we simply create a vector of operations to verify(those not found in ed25519_dalek::verify_batch seems to come with all kinds of warnings on how to use it, so I propose we look into that only later if necessary. |
That's cool
Those warnings are the same as the ones on the nornal "verify" vs "verify_strict" so no extra danger here, and using it is probably a good idea for batches in rayon |
The underlying problem we have is that we don't batch operation announcement / asking properly (we do it only when asking ops for blocks). And using rayon on just 1 verif will actually decrease performance |
How about we switch to periodically sending announcements(as opposed to immediately), and the current call to |
It's a path to explore, but It should be studied a bit because it would have an impact on propagation latency |
Is sig verification actually slower compared to say testnet 11 ? Or similar or faster ? Parallelization will not reduce cpu usage, maybe even increase it a bit, but it will reduce latency, which I don't think is a problem here. |
Some benchmarks of ed25519_dalek signature verification:
Limit at batch_size = 5000:
It therefore boils down to batching and using batch_verif, and doing so in rayon to process each batch in parallel.
The more emphasis we put on A, the smaller the batch size should be. The more emphasis we put on B, the larger the batch size should be. => Optimized implementation done here: #3095 |
Bench with ed25519_dalek: 10 000 000 verifs in 377359 milliseconds. That's 190 milliseconds to verify a full block (5000 + 1 + 9 signatures)
TODO: are there faster crates implementing the same algo ?
TODO: is there a way to parallelize verif ?
TODO: use ed25519_dalek::verify_batch ?
(eg. is https://docs.rs/ring-compat/latest/ring_compat/ a good alternative ? or https://github.com/jedisct1/rust-ed25519-compact ?)
Also, we shouldn't be using the crypto implem directly, but through https://docs.rs/ed25519/latest/ed25519/ which allows supporting HSM and other things
The text was updated successfully, but these errors were encountered: