Log peer ID (#5416)

This commit is contained in:
Andrew Ashikhmin 2022-09-18 11:33:18 +02:00 committed by GitHub
parent 506dac35d2
commit 222224ca86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -428,6 +428,7 @@ func (hd *HeaderDownload) requestMoreHeadersForPOS(currentTime time.Time) (timeo
timeout = anchor.timeouts >= 10
if timeout {
log.Warn("[Downloader] Timeout", "requestId", hd.requestId, "peerID", common.Bytes2Hex(anchor.peerID[:]))
penalties = []PenaltyItem{{Penalty: AbandonedAnchorPenalty, PeerID: anchor.peerID}}
return
}
@ -660,7 +661,7 @@ func (hd *HeaderDownload) ProcessHeadersPOS(csHeaders []ChainSegmentHeader, tx k
log.Info("[Downloader] posAnchor", "blockHeight", hd.posAnchor.blockHeight)
return nil, nil
}
log.Warn("[Downloader] Unexpected header", "hash", headerHash, "expected", hd.posAnchor.parentHash)
log.Warn("[Downloader] Unexpected header", "hash", headerHash, "expected", hd.posAnchor.parentHash, "peerID", common.Bytes2Hex(peerId[:]))
return []PenaltyItem{{PeerID: peerId, Penalty: BadBlockPenalty}}, nil
}
@ -1281,7 +1282,6 @@ func (hd *HeaderDownload) StartPoSDownloader(
var timeout bool
timeout, req, penalties = hd.requestMoreHeadersForPOS(currentTime)
if timeout {
log.Warn("[Downloader] Timeout", "requestId", hd.requestId)
hd.BeaconRequestList.Remove(hd.requestId)
hd.cleanUpPoSDownload()
}