Skip to content

Commit

Permalink
catchpoints: log ledger download failures (#6227)
Browse files Browse the repository at this point in the history
  • Loading branch information
cce authored Jan 13, 2025
1 parent c60db8d commit 023a686
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion catchup/catchpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,18 @@ func (cs *CatchpointCatchupService) processStageLedgerDownload() error {
start := time.Now()
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", peerAddress(peer), 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", peerAddress(peer), err0)
cs.blocksDownloadPeerSelector.rankPeer(psp, peerRankInvalidDownload)
} else {
cs.log.Infof("failed to download catchpoint ledger from peer %s: %v", peerAddress(peer), err0)
cs.blocksDownloadPeerSelector.rankPeer(psp, peerRankDownloadFailed)
}

Expand Down

0 comments on commit 023a686

Please sign in to comment.