Ensure finalized root can't be zeros (#10791)

This commit is contained in:
terencechain 2022-05-30 11:01:30 -07:00 committed by GitHub
parent 3ff285dda5
commit 87251d627d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,7 +373,7 @@ func (s *Service) fillInForkChoiceMissingBlocks(ctx context.Context, blk interfa
pendingRoots = append(pendingRoots, copiedRoot)
root = bytesutil.ToBytes32(b.Block().ParentRoot())
}
if len(pendingRoots) > 0 && root != bytesutil.ToBytes32(finalized.Root) {
if len(pendingRoots) > 0 && root != s.ensureRootNotZeros(bytesutil.ToBytes32(finalized.Root)) {
return errNotDescendantOfFinalized
}