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

Initialize BeefyWorker validator set id for out-of-sync BEEFY gadget/client #112

Closed
adoerr opened this issue Mar 9, 2021 · 3 comments
Closed
Labels
enhancement New feature or request M-gadget The client code of the gadget.

Comments

@adoerr
Copy link
Contributor

adoerr commented Mar 9, 2021

From #95

So this obviously works for now, but what if the client is not fully in sync with the network? I think we need a bit more sophisticated mechanism, where we actually update the validator set id when new blocks are imported / we get synced up.

Currently the BeefyWorker validator set id is always initialized by using BeefyApi::validator_set(). This assumes the client is synced with the network and that the beefy_pallet session handler has seen all relevant on_new_sesseion() calls.

As per the above comment, this approach is not sufficient for an out-of-sync client.

@adoerr adoerr added enhancement New feature or request M-gadget The client code of the gadget. labels Mar 9, 2021
@adoerr adoerr mentioned this issue Apr 13, 2021
@tomusdrw tomusdrw added this to the BEEFY on Kusama milestone Nov 26, 2021
@tomusdrw
Copy link
Contributor

Related #183
We need to be notified by the block import pipeline about already seen justifications and defer starting the gadget when major sync is on-going.

@seunlanlege
Copy link

can be closed now that paritytech/substrate#10882 is merged

@acatangiu
Copy link
Collaborator

The issue description is a bit outdated so I will provide an update here.

With Lean BEEFY a node coming online at session N doesn't currently have a way to sync older mandatory BEEFY blocks to get the uninterrupted authority hand-offs chain. Instead, when mandatory block N is BEEFY-finalized, it assumes the finalizing super-majority of validators is honest. The node starts voting in session N+1 based on the finalized mandatory BEEFY block N authority set hand-off.

This issue tracks a way for the node to start voting - in lean beefy just wait for gossip of some mandatory block justification, then start voting on next session based on it - which is implemented.

Support for having the node able to vote as soon as sync is done is tracked in #183

So yes, we can mark this issue fixed by paritytech/substrate#10882.

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.

4 participants