Skip to content

Commit

Permalink
Improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Mar 12, 2024
1 parent cd85cb9 commit 03bdb5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion relayer/relays/beacon/header/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 03bdb5c

Please sign in to comment.