Skip to content

Commit

Permalink
Add scheduled change check
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro committed Oct 9, 2024
1 parent bf1c72c commit baca3b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/client/consensus/grandpa/warp_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ func (p *WarpSyncProofProvider) Generate(start common.Hash) ([]byte, error) {
return nil, err
}

// the last block in a set is the one that triggers a change to the next set,
// therefore the block must have a digest that signals the authority set change
if findScheduledChange(headerToGenericHeader(*header)) == nil {
// if it doesn't contain a signal for standard change then the set must have changed
// through a forced changed, in which case we stop collecting proofs as the chain of
// trust in authority handoffs was broken.
break
}

encJustification, err := p.blockState.GetJustification(header.Hash()) // get the justification of such block
if err != nil {
return nil, err
Expand Down

0 comments on commit baca3b2

Please sign in to comment.