Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

sc-consensus-beefy: fix BEEFY fast sync #14752

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

acatangiu
Copy link
Contributor

When BEEFY voter is initialized from scratch (no aux db persistent data present), it needs to find BEEFY genesis block and all subsequent Mandatory blocks and sync justifications for them.

The initialization code was getting active validator sets for these older blocks from state, but in cases such as 'fast sync', state is unavailable.

This commit adds a fallback initialization mechanism when state is unavailable: parse header Digests looking for validator set change log deposits.

@acatangiu acatangiu added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Aug 11, 2023
@acatangiu acatangiu self-assigned this Aug 11, 2023
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

lgtm. just a small safety suggestion

@acatangiu acatangiu force-pushed the fix-beefy-fast-sync branch from fb5733c to cd715e6 Compare August 11, 2023 14:33
…ilable

When BEEFY voter is initialized from scratch (no aux db persistent data present),
it needs to find BEEFY genesis block and all subsequent Mandatory blocks and
sync justifications for them.

The initialization code was getting active validator sets for these older blocks
from state, but in cases such as 'fast sync', state is unavailable.

This commit adds a fallback initialization mechanism when state is unavailable:
parse header Digests looking for validator set change log deposits.

Signed-off-by: Adrian Catangiu <adrian@parity.io>
@acatangiu acatangiu force-pushed the fix-beefy-fast-sync branch from cd715e6 to 16824bb Compare August 11, 2023 14:36
@acatangiu acatangiu merged commit 28b1f79 into paritytech:master Aug 11, 2023
@acatangiu acatangiu deleted the fix-beefy-fast-sync branch August 11, 2023 15:58
Ank4n pushed a commit that referenced this pull request Aug 20, 2023
…ilable (#14752)

When BEEFY voter is initialized from scratch (no aux db persistent data present),
it needs to find BEEFY genesis block and all subsequent Mandatory blocks and
sync justifications for them.

The initialization code was getting active validator sets for these older blocks
from state, but in cases such as 'fast sync', state is unavailable.

This commit adds a fallback initialization mechanism when state is unavailable:
parse header Digests looking for validator set change log deposits.

Signed-off-by: Adrian Catangiu <adrian@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants