Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate Correctness of invariant: Authority Set for GRANDPA and BEEFY justification are the same for all blocks #718

Open
bhargavbh opened this issue Jan 29, 2024 · 0 comments
Assignees

Comments

@bhargavbh
Copy link
Contributor

Context:
Recently, snowbridge was bricked on the Rococo-Sepolia testnets. The issue is described here by Snowbridge team. There are two main points of provenance for the bug:

  1. BEEFY hitting an off-set-by-one error on the Polakdot Node side, where the first block of every session (mandatory BEEFY block) cannot be verified by the light client if there are no other BEEFY finalised blocks between two sessions.
  2. The light client is too strict in requiring the validatosetID to be consecutive. This does not bring any added security gurantees and hopefully can be relaxed to just being monotone, and in the process providing an escape route for unbridging the brick in case unexpected errors like above arise.

Description:
This issue focusses on point-1. In the spec, we have an invariant which states that for every block, the authority set of GRANDPA justification and BEEFY justification are the same. In GRANPDPA, the justification of the first block of every session is signed by the validatorSet of the previous session (due to a technical reason that there could be possible forks). Clearly, this behaviour is not reflected in BEEFY (since there is no issue of possible forks to be evaluated in BEEFY), else the offset-by-one issue would not arise. So, the validator set of the current session sign the first block of the session (which is also a mandatory block).
It remains to be discussed if we would want BEEFY to mimic GRANDPA behaviour with regard to previous authority signing the first block. Just to avoid such edge cases. This might be a cleaner approach at a deeper level than the one proposed here.

@bhargavbh bhargavbh self-assigned this Jan 29, 2024
@bhargavbh bhargavbh changed the title Investigate Correctness of the following invariant: Authority Set for GRANDPA and BEEFY justification are the same for all blocks Investigate Correctness of invariant: Authority Set for GRANDPA and BEEFY justification are the same for all blocks Jan 29, 2024
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Jan 30, 2024
Moves `pallet_mmr` back behind `pallet_session` to address
polkadot-fellows/runtimes#160.

Opening draft for CI - should be merged or closed depending on outcome
of w3f/polkadot-spec#718.

---------

Co-authored-by: Adrian Catangiu <[email protected]>
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Jan 30, 2024
Moves `pallet_mmr` back behind `pallet_session` to address
polkadot-fellows/runtimes#160.

Opening draft for CI - should be merged or closed depending on outcome
of w3f/polkadot-spec#718.

---------

Co-authored-by: Adrian Catangiu <[email protected]>
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
Moves `pallet_mmr` back behind `pallet_session` to address
polkadot-fellows/runtimes#160.

Opening draft for CI - should be merged or closed depending on outcome
of w3f/polkadot-spec#718.

---------

Co-authored-by: Adrian Catangiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant