add error information when sync requests fail (#6119)

During sync it may be interesting to know why requests are failing.
Extend debug logging accordingly.
This commit is contained in:
Etan Kissling 2024-03-22 01:26:50 +01:00 committed by GitHub
parent 12a2f8c026
commit 2a45bb3c7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -392,7 +392,8 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A)
if blocks.isErr():
peer.updateScore(PeerScoreNoValues)
man.queue.push(req)
debug "Failed to receive blocks on request", request = req
debug "Failed to receive blocks on request",
request = req, err = blocks.error
return
let blockData = blocks.get().asSeq()
let blockSmap = getShortMap(req, blockData)
@ -420,7 +421,8 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A)
if blobs.isErr():
peer.updateScore(PeerScoreNoValues)
man.queue.push(req)
debug "Failed to receive blobs on request", request = req
debug "Failed to receive blobs on request",
request = req, err = blobs.error
return
let blobData = blobs.get().asSeq()
let blobSmap = getShortMap(req, blobData)