From 754cf35b56c1233ef7f6d4312e6896260f19471f Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:07:38 -0500 Subject: [PATCH] catchpoints: log ledger download failures --- catchup/catchpointService.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/catchup/catchpointService.go b/catchup/catchpointService.go index 281119f7c7..b9f8b3d41b 100644 --- a/catchup/catchpointService.go +++ b/catchup/catchpointService.go @@ -315,9 +315,13 @@ func (cs *CatchpointCatchupService) processStageLedgerDownload() error { } peer := psp.Peer start := time.Now() + var peerAddr string // HTTPPeer, UnicastPeer, wsPeerCore all implement this + if p, ok := peer.(interface{ GetAddress() string }); ok { + peerAddr = p.GetAddress() + } err0 = lf.downloadLedger(cs.ctx, peer, round) if err0 == nil { - cs.log.Infof("ledger downloaded in %d seconds", time.Since(start)/time.Second) + cs.log.Infof("ledger downloaded from %s in %d seconds", peerAddr, time.Since(start)/time.Second) start = time.Now() err0 = cs.ledgerAccessor.BuildMerkleTrie(cs.ctx, cs.updateVerifiedCounts) if err0 == nil { @@ -325,8 +329,10 @@ func (cs *CatchpointCatchupService) processStageLedgerDownload() error { break } // failed to build the merkle trie for the above catchpoint file. + cs.log.Infof("failed to build merkle trie for catchpoint file from %s: %v", peerAddr, err0) cs.blocksDownloadPeerSelector.rankPeer(psp, peerRankInvalidDownload) } else { + cs.log.Infof("failed to download catchpoint ledger from peer %s: %v", peerAddr, err0) cs.blocksDownloadPeerSelector.rankPeer(psp, peerRankDownloadFailed) }