diff --git a/p2p/exchange.go b/p2p/exchange.go index 607bfb0f..ec424b47 100644 --- a/p2p/exchange.go +++ b/p2p/exchange.go @@ -174,11 +174,14 @@ func (ex *Exchange[H]) Head(ctx context.Context, opts ...header.HeadOption[H]) ( headerRespCh <- headers[0] return } - log.Errorw("verifying head received from tracked peer", "tracked peer", from, + logF := log.Warnw + if errors.Is(err, header.ErrKnownHeader) { + logF = log.Debugw + } + logF("verifying head received from tracked peer", "tracked peer", from, "height", headers[0].Height(), "err", err) headerRespCh <- zero return - } } // request ensures that the result slice will have at least one Header diff --git a/sync/sync_head.go b/sync/sync_head.go index 66a497f6..349b4c5d 100644 --- a/sync/sync_head.go +++ b/sync/sync_head.go @@ -172,7 +172,11 @@ func (s *Syncer[H]) verify(ctx context.Context, newHead H) (bool, error) { var verErr *header.VerifyError if errors.As(err, &verErr) && !verErr.SoftFailure { - log.Errorw("invalid network header", + logF := log.Warnw + if errors.Is(err, header.ErrKnownHeader) { + logF = log.Debugw + } + logF("invalid network header", "height_of_invalid", newHead.Height(), "hash_of_invalid", newHead.Hash(), "height_of_subjective", sbjHead.Height(),