Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up debug level log #2938

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fluffy/network/beacon/beacon_light_client_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ proc workerTask[E](

didProgress = true
else:
#maybe trace??
debug "Failed to receive value on request", value, endpoint = E.name
except ResponseError as exc:
warn "Received invalid response", error = exc.msg, endpoint = E.name
Expand Down
3 changes: 2 additions & 1 deletion fluffy/network/beacon/beacon_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ proc validateContent(

let contentId = contentIdOpt.get()
n.portalProtocol.storeContent(contentKey, contentId, contentItem)

# trace
debug "Received offered content validated successfully", srcNodeId, contentKey
else:
# Trace
debug "Received offered content failed validation",
srcNodeId, contentKey, error = validation.error
return false
Expand Down
16 changes: 8 additions & 8 deletions fluffy/network/history/history_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ proc getVerifiedBlockHeader*(
# gets verified before storing.
let localContent = n.getLocalContent(Header, contentKey, contentId)
if localContent.isSome():
debug "Fetched block header locally"
trace "Fetched block header locally"
return localContent

for i in 0 ..< (1 + n.contentRequestRetries):
Expand All @@ -149,7 +149,7 @@ proc getVerifiedBlockHeader*(
warn "Validation of block header failed", error = error
continue

debug "Fetched valid block header from the network"
trace "Fetched valid block header from the network"
# Content is valid, it can be stored and propagated to interested peers
n.portalProtocol.storeContent(
contentKey, contentId, headerContent.content, cacheContent = true
Expand Down Expand Up @@ -180,7 +180,7 @@ proc getBlockBody*(

let localContent = n.getLocalContent(BlockBody, contentKey, contentId, header)
if localContent.isSome():
debug "Fetched block body locally"
trace "Fetched block body locally"
return localContent

for i in 0 ..< (1 + n.contentRequestRetries):
Expand All @@ -193,7 +193,7 @@ proc getBlockBody*(
warn "Validation of block body failed", error
continue

debug "Fetched block body from the network"
trace "Fetched block body from the network"
# Content is valid, it can be stored and propagated to interested peers
n.portalProtocol.storeContent(
contentKey, contentId, bodyContent.content, cacheContent = true
Expand Down Expand Up @@ -255,7 +255,7 @@ proc getReceipts*(

let localContent = n.getLocalContent(seq[Receipt], contentKey, contentId)
if localContent.isSome():
debug "Fetched receipts locally"
trace "Fetched receipts locally"
return localContent

for i in 0 ..< (1 + n.contentRequestRetries):
Expand All @@ -267,7 +267,7 @@ proc getReceipts*(
warn "Validation of receipts failed", error
continue

debug "Fetched receipts from the network"
trace "Fetched receipts from the network"
# Content is valid, it can be stored and propagated to interested peers
n.portalProtocol.storeContent(
contentKey, contentId, receiptsContent.content, cacheContent = true
Expand Down Expand Up @@ -375,9 +375,9 @@ proc validateContent(

n.portalProtocol.storeContent(contentKey, contentId, contentItem)

debug "Received offered content validated successfully", srcNodeId, contentKey
trace "Received offered content validated successfully", srcNodeId, contentKey
else:
debug "Received offered content failed validation",
trace "Received offered content failed validation",
srcNodeId, contentKey, error = res.error
return false

Expand Down
8 changes: 4 additions & 4 deletions fluffy/network/state/state_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ proc getContent(
let contentValue = V.decode(maybeLocalContent.get()).valueOr:
raiseAssert("Unable to decode state local content value")

debug "Fetched state local content value"
trace "Fetched state local content value"
return Opt.some(contentValue)

for i in 0 ..< (1 + n.contentRequestRetries):
Expand All @@ -112,13 +112,13 @@ proc getContent(
error "Validation of retrieved state content failed"
continue

debug "Fetched valid state content from the network"
trace "Fetched valid state content from the network"
n.portalProtocol.storeContent(
contentKeyBytes, contentId, contentValueBytes, cacheContent = true
)

if maybeParentOffer.isSome() and lookupRes.nodesInterestedInContent.len() > 0:
debug "Sending content to interested nodes",
trace "Sending content to interested nodes",
interestedNodesCount = lookupRes.nodesInterestedInContent.len()

let offer = contentValue.toOffer(maybeParentOffer.get())
Expand Down Expand Up @@ -240,7 +240,7 @@ proc processContentLoop(n: StateNetwork) {.async: (raises: []).} =

if offerRes.isOk():
state_network_offers_success.inc(labelValues = [$n.portalProtocol.protocolId])
debug "Received offered content validated successfully",
trace "Received offered content validated successfully",
srcNodeId, contentKeyBytes
else:
state_network_offers_failed.inc(labelValues = [$n.portalProtocol.protocolId])
Expand Down
4 changes: 2 additions & 2 deletions fluffy/network/wire/portal_protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ proc offer(
acceptedKeysAmount.int64, labelValues = [$p.protocolId]
)
if acceptedKeysAmount == 0:
debug "No content accepted"
trace "No content accepted"
# Don't open an uTP stream if no content was requested
return ok(m.contentKeys)

Expand Down Expand Up @@ -971,7 +971,7 @@ proc offer(

return ok(m.contentKeys)
else:
debug "Offer failed due to accept request failure ",
trace "Offer failed due to accept request failure ",
error = acceptMessageResponse.error
return err("No or invalid accept response: " & acceptMessageResponse.error)

Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/wire/portal_stream.nim
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ proc canAddPendingTransfer(
if (contentIds.len() < limit) and not contentIds.contains(contentId):
return true
else:
debug "Pending transfer limit reached for peer", nodeId, contentId
trace "Pending transfer limit reached for peer", nodeId, contentId
return false
except KeyError as e:
raiseAssert(e.msg)
Expand Down
2 changes: 1 addition & 1 deletion fluffy/tools/eth_data_exporter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ when isMainModule:
return err("Invalid block header: " & e.msg)

headerHash = to0xHex(rlpHash(blockHeader).data)
debug "Header decoded successfully",
trace "Header decoded successfully",
hash = headerHash, blockNumber = blockHeader.number
else:
warn "Skipping record, not a block header", typ = toHex(header.typ)
Expand Down
4 changes: 2 additions & 2 deletions fluffy/tools/portal_bridge/portal_bridge_state.nim
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ proc runBackfillGossipBlockOffersLoop(
try:
let numPeers = await portalClient.portal_stateGossip(k.to0xHex(), v.to0xHex())
if numPeers > 0:
debug "Offer successfully gossipped to peers: ", numPeers, workerId
trace "Offer successfully gossipped to peers: ", numPeers, workerId
elif numPeers == 0:
warn "Offer gossipped to no peers", workerId
retryGossip = true
Expand Down Expand Up @@ -378,7 +378,7 @@ proc runBackfillGossipBlockOffersLoop(
info "Finished gossiping offers for block number: ",
workerId, blockNumber = blockOffers.blockNumber, offerCount = offersMap.len()
else:
debug "Finished gossiping offers for block number: ",
trace "Finished gossiping offers for block number: ",
workerId, blockNumber = blockOffers.blockNumber, offerCount = offersMap.len()

blockOffers = await blockOffersQueue.popFirst()
Expand Down