From 03bdb5c6e31ac3b0f0b46e414a58a38ca93aad33 Mon Sep 17 00:00:00 2001 From: ron Date: Tue, 12 Mar 2024 20:59:32 +0800 Subject: [PATCH] Improve logs --- relayer/relays/beacon/header/header.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/relayer/relays/beacon/header/header.go b/relayer/relays/beacon/header/header.go index b18d27e5c9..14721a9f28 100644 --- a/relayer/relays/beacon/header/header.go +++ b/relayer/relays/beacon/header/header.go @@ -281,15 +281,16 @@ func (h *Header) populateClosestCheckpoint(slot uint64) (cache.Proof, error) { case errors.Is(cache.FinalizedCheckPointNotAvailable, err) || errors.Is(cache.FinalizedCheckPointNotPopulated, err): checkpointSlot := checkpoint.Slot if checkpointSlot == 0 { + log.WithFields(log.Fields{"calculatedCheckpointSlot": checkpointSlot}).Info("checkpoint slot not available, try with slot in next sync period instead") checkpointSlot = h.syncer.CalculateNextCheckpointSlot(slot) lastFinalizedHeaderState, err := h.writer.GetLastFinalizedHeaderState() if err != nil { return cache.Proof{}, fmt.Errorf("fetch parachain last finalized header state: %w", err) } if checkpointSlot > lastFinalizedHeaderState.BeaconSlot { + log.WithFields(log.Fields{"calculatedCheckpointSlot": checkpointSlot}).Info("checkpoint slot should not be in the future, switch to the last finalized") checkpointSlot = lastFinalizedHeaderState.BeaconSlot } - log.WithFields(log.Fields{"calculatedCheckpointSlot": checkpointSlot}).Info("checkpoint slot not available, try with slot in next sync period instead") } err := h.populateFinalizedCheckpoint(checkpointSlot) if err != nil {