Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Decouple voting from handling finality notifications #162

Closed
tomusdrw opened this issue Apr 26, 2021 · 1 comment · Fixed by paritytech/substrate#10882
Closed

Decouple voting from handling finality notifications #162

tomusdrw opened this issue Apr 26, 2021 · 1 comment · Fixed by paritytech/substrate#10882
Assignees
Labels
enhancement New feature or request M-gadget The client code of the gadget.

Comments

@tomusdrw
Copy link
Contributor

Currently the voting code is running only in finalized header notifications. This means the worker needs to observe header and then decide if it votes on that header or not. To make this code work correctly, the candidate selection code most of the time suggests future headers (greater than best_grandpa), and only from time to time we end up with current block. See this PR for more details.

Current implementation, however, is not the best one long-term though. I'd like to propose a change, where candidate selection & voting is decoupled from GRANDPA finality notification handling.

Sketch of the behavior:

  1. At any point in time we should figure out what the current candidate is.
  2. The candidate has to be between beefy_best & grandpa_best (diff / 2).
  3. We periodically vote on the candidate (make sure the votes are gossiped)

The reason for this is that currently, if the node joins the network, it has to wait roughly 2^x blocks before it can start voting if BEEFY is lagging (cause it has to wait for notification that would cause candidate to match best_grandpa). What we want instead is to have the node start voting on what it believes everyone else is voting on as soon as possible. So given one SignedCommitment (best_beefy block) and one finality notification (best_grandpa) it can start voting on some candidate right away.

@tomusdrw tomusdrw added enhancement New feature or request M-gadget The client code of the gadget. labels Apr 26, 2021
@andresilva
Copy link
Contributor

This will probably be done in tandem with #102.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request M-gadget The client code of the gadget.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants