voter: Ensure prevoting future is polled directly after advancing the state#169
Open
lexnv wants to merge 3 commits into
Open
voter: Ensure prevoting future is polled directly after advancing the state#169lexnv wants to merge 3 commits into
lexnv wants to merge 3 commits into
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
…ting Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
andresilva
reviewed
Jun 6, 2025
andresilva
left a comment
Contributor
There was a problem hiding this comment.
I honestly no longer remember any of this :-(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR avoids a call to the
cx.waker().wake_by_ref()by polling the appropriatefinish_prevotingfuture.Previously, we relied on the context waker to wake up the whole async task if the state advanced to
Prevotingvia thestart_prevotingfn. I believe the intended behavior was to save the waker on the subsequent call by polling thebest_chainfuture.Instead, we poll the
best_chainfuture directly without waking up the task.cc @paritytech/networking @alexggh paritytech/polkadot-sdk#8543
Next Steps
wake_by_refdid not have unexpected side-effects which unblocked other futures from continuing to operate, which may explain the finality stall in the linked issue