Skip to content

voter: Ensure prevoting future is polled directly after advancing the state#169

Open
lexnv wants to merge 3 commits into
masterfrom
lenxv/wake-ref
Open

voter: Ensure prevoting future is polled directly after advancing the state#169
lexnv wants to merge 3 commits into
masterfrom
lenxv/wake-ref

Conversation

@lexnv

@lexnv lexnv commented Jun 6, 2025

Copy link
Copy Markdown

This PR avoids a call to the cx.waker().wake_by_ref() by polling the appropriate finish_prevoting future.

Previously, we relied on the context waker to wake up the whole async task if the state advanced to Prevoting via the start_prevoting fn. I believe the intended behavior was to save the waker on the subsequent call by polling the best_chain future.

Instead, we poll the best_chain future directly without waking up the task.

cc @paritytech/networking @alexggh paritytech/polkadot-sdk#8543

Next Steps

  • This needs a bit of testing to ensure that wake_by_ref did not have unexpected side-effects which unblocked other futures from continuing to operate, which may explain the finality stall in the linked issue

lexnv added 3 commits June 6, 2025 13:18
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>
@lexnv lexnv self-assigned this Jun 6, 2025

@andresilva andresilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly no longer remember any of this :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants