Fix GRANDPA warp proofs for delayed changes#22
Open
prop-opentensor wants to merge 2 commits intopolkadot-stable2506-2-otf-patchesfrom
Open
Fix GRANDPA warp proofs for delayed changes#22prop-opentensor wants to merge 2 commits intopolkadot-stable2506-2-otf-patchesfrom
prop-opentensor wants to merge 2 commits intopolkadot-stable2506-2-otf-patchesfrom
Conversation
145b8be to
6a759bb
Compare
6a759bb to
e857134
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Warp sync currently breaks when a GRANDPA authority change is scheduled with a delay, because the proof format assumes the scheduling block and the justified handoff block are the same block.
On testnet, the change is scheduled on one block and only becomes effective on a later finalized descendant, so peers can serve warp proofs that clients cannot correctly decode or verify across that transition.
This PR fixes that by including the intermediate descendant headers in each warp proof fragment, so the verifier can connect the scheduling block to the justified target block and validate delayed authority handoffs correctly.
What this PR changes
WarpSyncFragmentwithdescendant_headers, the contiguous header path from the block that scheduled the change to the later block justified by GRANDPA.Why this is needed for testnet
Testnet has a historical delayed GRANDPA authority change at block
5534451. That transition exposes the assumption in the current warp proof format and is one of the reasons fresh nodes cannot warp sync from official peers today.This SDK PR fixes the generic serving/verification bug. The chain-specific client-side companion change lives in the Subtensor PR: opentensor/subtensor#2551
Safety / scope
descendant_headerslistTest
cargo test -p sc-consensus-grandpa warp_sync_proof_generate_verify --quiet