Skip to content
Unverified Commit 646ecd0e authored by Adrian Catangiu's avatar Adrian Catangiu Committed by GitHub
Browse files

sc-consensus-beefy: fix initialization when state is unavailable (#1888)



Fix situation where BEEFY initial validator set could not be determined.

If state is unavailable at BEEFY genesis block to get initial validator
set, get the info from header digests. For this, we need to walk back
the chain starting from BEEFY genesis looking for the BEEFY digest
announcing the active validator set for that respective session.

This commit fixes a silly bug where walking back the chain was stopped
when reaching BEEFY genesis block, which is incorrect when BEEFY genesis
is not session boundary block. When BEEFY genesis is set to some random
block within a session, we need to walk back to the start of the session
to see the validator set announcement.

Added regression test for this fix.

Fixes https://github.com/paritytech/polkadot-sdk/issues/1885

Signed-off-by: default avatarAdrian Catangiu <[email protected]>
parent 4e98bec3
Pipeline #401213 canceled with stages
in 41 minutes and 15 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment