From 04e3dc218b3743f73b1b478abb11191be7b02538 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Tue, 22 Oct 2024 14:44:00 +0530 Subject: [PATCH] added debug logs in sync queue --- beacon_chain/sync/sync_queue.nim | 57 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/beacon_chain/sync/sync_queue.nim b/beacon_chain/sync/sync_queue.nim index 7c288f5c1..52997d79c 100644 --- a/beacon_chain/sync/sync_queue.nim +++ b/beacon_chain/sync/sync_queue.nim @@ -726,37 +726,37 @@ proc push*[T](sq: SyncQueue[T], sr: SyncRequest[T], # Nim versions, remove workaround and move `res` into for loop res: Result[void, VerifierError] - var i=0 - for blk, blb in sq.blocks(item): - res = await sq.blockVerifier(blk[], blb, Opt.none(DataColumnSidecars), maybeFinalized) - inc(i) + # var i=0 + # for blk, blb in sq.blocks(item): + # res = await sq.blockVerifier(blk[], blb, Opt.none(DataColumnSidecars), maybeFinalized) + # inc(i) - if res.isOk(): - goodBlock = some(blk[].slot) - else: - case res.error() - of VerifierError.MissingParent: - missingParentSlot = some(blk[].slot) - break - of VerifierError.Duplicate: - # Keep going, happens naturally - discard - of VerifierError.UnviableFork: - # Keep going so as to register other unviable blocks with the - # quarantine - if unviableBlock.isNone: - # Remember the first unviable block, so we can log it - unviableBlock = some((blk[].root, blk[].slot)) + # if res.isOk(): + # goodBlock = some(blk[].slot) + # else: + # case res.error() + # of VerifierError.MissingParent: + # missingParentSlot = some(blk[].slot) + # break + # of VerifierError.Duplicate: + # # Keep going, happens naturally + # discard + # of VerifierError.UnviableFork: + # # Keep going so as to register other unviable blocks with the + # # quarantine + # if unviableBlock.isNone: + # # Remember the first unviable block, so we can log it + # unviableBlock = some((blk[].root, blk[].slot)) - of VerifierError.Invalid: - hasInvalidBlock = true + # of VerifierError.Invalid: + # hasInvalidBlock = true - let req = item.request - notice "Received invalid sequence of blocks", request = req, - blocks_count = len(item.data), - blocks_map = getShortMap(req, item.data) - req.item.updateScore(PeerScoreBadValues) - break + # let req = item.request + # notice "Received invalid sequence of blocks", request = req, + # blocks_count = len(item.data), + # blocks_map = getShortMap(req, item.data) + # req.item.updateScore(PeerScoreBadValues) + # break var counter = 0 for blk, col in sq.das_blocks(item): @@ -764,6 +764,7 @@ proc push*[T](sq: SyncQueue[T], sr: SyncRequest[T], inc counter if res.isOk: + debugEcho "Column into sync queue" goodBlock = some(blk[].slot) else: case res.error()