From 5bef86906fe4a885b08317e7fd12f458a60b70b7 Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Thu, 19 Dec 2024 10:39:00 +0000 Subject: [PATCH] Logger updates details: + Lifting main header/block op logs from `trace` to `debug` + Set metrics update before nano-sleep (for task switch) --- nimbus/sync/beacon/worker/blocks_staged.nim | 10 +++++----- nimbus/sync/beacon/worker/headers_staged.nim | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nimbus/sync/beacon/worker/blocks_staged.nim b/nimbus/sync/beacon/worker/blocks_staged.nim index b95a51e2c2..d18eef58fd 100644 --- a/nimbus/sync/beacon/worker/blocks_staged.nim +++ b/nimbus/sync/beacon/worker/blocks_staged.nim @@ -290,7 +290,7 @@ proc blocksStagedImport*( nBlocks = qItem.data.blocks.len iv = BnRange.new(qItem.key, qItem.key + nBlocks.uint64 - 1) - trace info & ": import blocks ..", iv, nBlocks, + debug info & ": import blocks ..", iv, nBlocks, B=ctx.chain.baseNumber.bnStr, L=ctx.chain.latestNumber.bnStr var maxImport = iv.maxPt @@ -319,6 +319,9 @@ proc blocksStagedImport*( maxImport = ctx.chain.latestNumber() break importLoop + # Update, so it can be followed nicely + ctx.updateMetrics() + # Allow pseudo/async thread switch. try: await sleepAsync asyncThreadSwitchTimeSlot except CancelledError: discard @@ -327,9 +330,6 @@ proc blocksStagedImport*( maxImport = ctx.chain.latestNumber() break importLoop - # Update, so it can be followed nicely - ctx.updateMetrics() - # Occasionally mark the chain finalized if (n + 1) mod finaliserChainLengthMax == 0 or (n + 1) == nBlocks: let @@ -365,7 +365,7 @@ proc blocksStagedImport*( # Update, so it can be followed nicely ctx.updateMetrics() - trace info & ": import done", iv, nBlocks, B=ctx.chain.baseNumber.bnStr, + debug info & ": import done", iv, nBlocks, B=ctx.chain.baseNumber.bnStr, L=ctx.chain.latestNumber.bnStr, F=ctx.layout.final.bnStr return true diff --git a/nimbus/sync/beacon/worker/headers_staged.nim b/nimbus/sync/beacon/worker/headers_staged.nim index 934bb7b83a..775db4a6bc 100644 --- a/nimbus/sync/beacon/worker/headers_staged.nim +++ b/nimbus/sync/beacon/worker/headers_staged.nim @@ -251,7 +251,7 @@ proc headersStagedProcess*(ctx: BeaconCtxRef; info: static[string]): int = result += qItem.data.revHdrs.len # count headers - trace info & ": stashed consecutive headers", + debug info & ": stashed consecutive headers", nListsLeft=ctx.hdr.staged.len, nStashed=result if headersStagedQueueLengthLwm < ctx.hdr.staged.len: