voter: Save the context waker of precommited voting rounds #171
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.
A best round is completed when the following conditions are met:
inner.best_round.poll(cx)returnsPoll::Ready(()))Precommited(fromPrevoting)When one of the previous conditions is not met, the
process_best_roundfunction returnsPoll::Pendingwithout storing the waker context.The grandpa code relies on the first context wakeup of either:
process_incoming)finality-grandpa/src/voter/mod.rs
Lines 854 to 860 in 321973e
This PR ensures we save the waker and wake it up properly on state advances (instead of relying on the above components and possibly causing a delay in starting the next round).
Notes
We are also seeing a high number of grandpa debug los:
The previous logs are repeated ~3.4k times during one second during a finality stall, suggesting that some other component (mentioned above) was able to make progress, but not yet the best voting round.
I would leave this PR open for a while, in case we choose to revisit it at a later time and perform in-depth testing. (May we ever want to refactor the code to align with #124 this might come in handy)