-
Notifications
You must be signed in to change notification settings - Fork 709
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
Concurrent block verification #1598
base: master
Are you sure you want to change the base?
Conversation
b4e8e31
to
fc5048a
Compare
It is really hard to work with when clippy is running on (old) stable and formatting is done with No |
fc5048a
to
62567b0
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.
If you really want this, we should go into the direction that we want to go in the future any way. See here for some information: #5 (comment)
TLDR on what I want to see from this pr, Verifier
should be moved out of the import queue at all and sync
should call it directly. sync should only pass verified blocks to the import queue.
I was not aware of that thread, thanks, I read it and subscribed for updates. However it seems like what you're suggesting is a more significant change than almost trivial refactoring I have done here, which I suspect would be harder to do as an external contributor and not on Parity team. I like the direction described, but I don't see how this PR makes moving into that direction more difficult in the meantime. Is that a hard reqirement?
But it would still do something similar to this PR, especially for Aura and Babe that expect even verification of blocks to happen in strictly ascending order, not just import. This was actually the more difficult part of these changes that I only realized later, our consensus in Subspace doesn't have such assumption, so it is a bit easier to work with in that sense. |
The CI pipeline was cancelled due to failure one of the required jobs. |
I don't think that this can not be done by someone external. We would first need to ensure to make all |
I'm now wondering if the fact that things will change in the future should be a blocker for moving forward with this. It doesn't change behavior for existing users and allows for additional capabilities for those who opt-in. I understand that you'd like to see a bigger refactoring, but I'm not sure if it should prevent making incremental improvements for existing design. We've been using this patch in Subspace for a while and it works great, massively improving sync time for our protocol. |
24127cd
to
a9484aa
Compare
I carried these things in a fork for a long time, I think wouldn't hurt to have it upstream. Originally submitted as part of #1598 that went nowhere. --------- Co-authored-by: Bastian Köcher <git@kchr.de>
a9484aa
to
61e3ae3
Compare
With latest changes from |
I carried these things in a fork for a long time, I think wouldn't hurt to have it upstream. Originally submitted as part of paritytech#1598 that went nowhere. --------- Co-authored-by: Bastian Köcher <git@kchr.de>
@bkchr on API level it is stateless after #4844 and consensus at Subspace has it implemented in fully stateless way too (and verified in parallel as implemented by this PR), however looking at consensus implementations in polkadot-sdk repo I see a lot of implicit dependencies on things like parent block existing to fetch authorities and I don't think I'm the best person to do something about this. I'm wondering what would be the next step for me if I don't touch those now that I have resources to dedicate to this issue. I re-read #5 again to refresh my memory. Depending on how things are implemented, whether to verify concurrently or not might be a downstream decision assuming API allows it. Let me know what you think. UPD: Let me know if this is not the best place to have this conversation. |
61e3ae3
to
6e8bc3e
Compare
Latest changes in |
…ility to control concurrency
6e8bc3e
to
d63b08e
Compare
Block verification is meant to ideally be stateless and parallelizable, after multiple refactoring PRs landed in Substrate already, this simple PR implements concurrent verification, which downstream consensus implementers can use to parallelize verification and achieve higher sync speeds.