Skip to content

Commit

Permalink
Logger updates
Browse files Browse the repository at this point in the history
details:
  + Lifting main header/block op logs from `trace` to `debug`
  + Set metrics update before nano-sleep (for task switch)
  • Loading branch information
mjfh committed Dec 19, 2024
1 parent 1b097b5 commit 5bef869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions nimbus/sync/beacon/worker/blocks_staged.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion nimbus/sync/beacon/worker/headers_staged.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5bef869

Please sign in to comment.