Skip to content

Commit

Permalink
catchpoints: log ledger download failures
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed Jan 10, 2025
1 parent c60db8d commit 754cf35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion catchup/catchpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,24 @@ 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 {
cs.log.Infof("built merkle trie in %d seconds", time.Since(start)/time.Second)
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)
}

Expand Down

0 comments on commit 754cf35

Please sign in to comment.