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

Change the initial best_beefy_block #256

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

Change the initial best_beefy_block #256

tomusdrw opened this issue Jul 29, 2021 · 1 comment · Fixed by paritytech/substrate#10882
Assignees
Labels
bug Something isn't working

Comments

@tomusdrw
Copy link
Contributor

It seems that currently, when we start the node, the best_beefy_block is going to be simply set to best_grandpa_block (See here)

This makes it hard for multiple nodes to agree on the starting block and consequently on a block to vote on. (also related #162)

Instead we should make sure that the nodes that are starting up set the starting block to a value that is roughly the same, no matter at which point they were started.

Possible options:

  1. Set the starting block to 0 - this could be implemented, but only with a cap added on the power-of-two selection rule, so that the numbers don't go crazy high.
  2. Set the starting block to latest session boundary - we could try to figure out where the session boundary is - that should align us with all other peers that participate in the protocol (because there should be one BEEFY commitment on the last block of the session).
  3. Reverse engineer the starting block by observing votes - after seeing some votes being cast by other validators, try to figure out what their starting block is (we need (at least) 2 votes from the same validator + the assumption that both rounds are not concluded (which is reasonable, because if it's concluded we should update best_beefy_block anyway).

The last solution seems overcomplicated and error prone. I think option (2) is the most reasonable. There is probably a RuntimeApi that would help us figure out at what point of the session we currently are, and from this we can figure out the beginning (or rather the end of previous session).

@tomusdrw tomusdrw added the bug Something isn't working label Jul 29, 2021
@tomusdrw tomusdrw added this to the Get BEEFY in shape milestone Nov 26, 2021
@seunlanlege
Copy link

(because there should be one BEEFY commitment on the last block of the session).

Hmm i don't see the issue for this mandatory block, we should tackle that first before this.

The last solution seems overcomplicated and error prone. I think option (2) is the most reasonable.

I agree, option 2 is the best option here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants