From a77221d213a97ceea276c766bacb39804f3e2c71 Mon Sep 17 00:00:00 2001 From: Ganesha Upadhyaya Date: Tue, 18 Jul 2023 17:45:32 -0500 Subject: [PATCH 1/2] returning subjective head if request to trusted peer for head fails --- sync/sync_head.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sync/sync_head.go b/sync/sync_head.go index bcc5749e..5e1f41ec 100644 --- a/sync/sync_head.go +++ b/sync/sync_head.go @@ -42,7 +42,8 @@ func (s *Syncer[H]) Head(ctx context.Context) (H, error) { defer s.getter.Unlock() netHead, err := s.getter.Head(ctx) if err != nil { - return netHead, err + log.Errorw("requesting head from trusted peer, returning subjective head which may not be recent", "sbjHead", sbjHead.Height(), "err", err) + return sbjHead, nil } // process and validate netHead fetched from trusted peers // NOTE: We could trust the netHead like we do during 'automatic subjective initialization' From 690e8b556568feacf70764722f0bb7e84d1955d2 Mon Sep 17 00:00:00 2001 From: Ganesha Upadhyaya Date: Tue, 25 Jul 2023 09:56:22 +0200 Subject: [PATCH 2/2] error to warn --- sync/sync_head.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/sync_head.go b/sync/sync_head.go index 5e1f41ec..d4b35dbc 100644 --- a/sync/sync_head.go +++ b/sync/sync_head.go @@ -42,7 +42,7 @@ func (s *Syncer[H]) Head(ctx context.Context) (H, error) { defer s.getter.Unlock() netHead, err := s.getter.Head(ctx) if err != nil { - log.Errorw("requesting head from trusted peer, returning subjective head which may not be recent", "sbjHead", sbjHead.Height(), "err", err) + log.Warnw("failed to return head from trusted peer, returning subjective head which may not be recent", "sbjHead", sbjHead.Height(), "err", err) return sbjHead, nil } // process and validate netHead fetched from trusted peers