Log invalid finalized root (#10975)

Co-authored-by: Potuz <potuz@prysmaticlabs.com>
This commit is contained in:
terencechain 2022-07-02 03:58:54 -07:00 committed by GitHub
parent 2a5f05bc29
commit ae1685d937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package sync
import (
"bytes"
"context"
"fmt"
"sync"
"time"
@ -310,6 +311,7 @@ func (s *Service) validateStatusMessage(ctx context.Context, msg *pb.Status) err
return nil
}
if !s.cfg.beaconDB.IsFinalizedBlock(ctx, bytesutil.ToBytes32(msg.FinalizedRoot)) {
log.WithField("root", fmt.Sprintf("%#x", msg.FinalizedRoot)).Debug("Could not validate finalized root")
return p2ptypes.ErrInvalidFinalizedRoot
}
blk, err := s.cfg.beaconDB.Block(ctx, bytesutil.ToBytes32(msg.FinalizedRoot))