From 022911314dbf5fa1d1034469eaece5cf4d879a08 Mon Sep 17 00:00:00 2001 From: Samyxandz Date: Fri, 20 Dec 2024 19:09:28 +0530 Subject: [PATCH] Cleaning up debug level log --- fluffy/network/history/history_network.nim | 3 --- fluffy/network/state/state_gossip.nim | 2 +- fluffy/network/wire/portal_protocol.nim | 12 ++++++------ fluffy/network/wire/portal_stream.nim | 2 +- fluffy/tools/eth_data_exporter.nim | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fluffy/network/history/history_network.nim b/fluffy/network/history/history_network.nim index b975e65d5..c7568cb85 100644 --- a/fluffy/network/history/history_network.nim +++ b/fluffy/network/history/history_network.nim @@ -148,7 +148,6 @@ proc getVerifiedBlockHeader*( header = validateCanonicalHeaderBytes(headerContent.content, id, n.accumulator).valueOr: warn "Validation of block header failed", error = error continue - debug "Fetched valid block header from the network" # Content is valid, it can be stored and propagated to interested peers n.portalProtocol.storeContent( @@ -192,7 +191,6 @@ proc getBlockBody*( body = validateBlockBodyBytes(bodyContent.content, header).valueOr: warn "Validation of block body failed", error continue - debug "Fetched block body from the network" # Content is valid, it can be stored and propagated to interested peers n.portalProtocol.storeContent( @@ -211,7 +209,6 @@ proc getBlock*( n: HistoryNetwork, id: Hash32 | uint64 ): Future[Opt[Block]] {.async: (raises: [CancelledError]).} = debug "Trying to retrieve block", id - # Note: Using `getVerifiedBlockHeader` instead of getBlockHeader even though # proofs are not necessiarly needed, in order to avoid having to inject # also the original type into the network. diff --git a/fluffy/network/state/state_gossip.nim b/fluffy/network/state/state_gossip.nim index 3c78c383b..7471a9284 100644 --- a/fluffy/network/state/state_gossip.nim +++ b/fluffy/network/state/state_gossip.nim @@ -97,7 +97,7 @@ proc gossipOffer*( let peers = await p.neighborhoodGossip( srcNodeId, ContentKeysList.init(@[keyBytes]), @[offerBytes] ) - debug "Offered content gossipped successfully with peers", keyBytes, peers + trace "Offered content gossipped successfully with peers", keyBytes, peers # Currently only used for testing to gossip an entire account trie proof proc recursiveGossipOffer*( diff --git a/fluffy/network/wire/portal_protocol.nim b/fluffy/network/wire/portal_protocol.nim index 0fc5cfcfe..0d2f6126b 100644 --- a/fluffy/network/wire/portal_protocol.nim +++ b/fluffy/network/wire/portal_protocol.nim @@ -550,11 +550,11 @@ proc messageHandler( else: # This would mean a that Portal wire response message is being send over a # discv5 talkreq message. - debug "Invalid Portal wire message type over talkreq", kind = message.kind + debug "Invalid Portal wire message type over talkreq", kind = message.kind @[] else: portal_message_decoding_failures.inc(labelValues = [$p.protocolId]) - debug "Packet decoding error", error = decoded.error, srcId, srcUdpAddress + trace "Packet decoding error", error = decoded.error, srcId, srcUdpAddress @[] proc new*( @@ -644,7 +644,7 @@ proc reqResponse[Request: SomeMessage, Response: SomeMessage]( p.routingTable.setJustSeen(dst) else: - debug "Error receiving message response", + trace "Error receiving message response",# error = messageResponse.error, srcId = dst.id, srcAddress = dst.address p.pingTimings.del(dst.id) p.routingTable.replaceNode(dst) @@ -767,7 +767,7 @@ proc findContent*( # Further validation is required, using a length prefix here might be # beneficial for this. let readFut = socket.read() - +#ask kim readFut.cancelCallback = proc(udate: pointer) {.gcsafe.} = debug "Socket read cancelled", socketKey = socket.socketKey # In case this `findContent` gets cancelled while reading the data, @@ -960,14 +960,14 @@ proc offer( raiseAssert e.msg let dataWritten = (await socket.write(output.getOutput)).valueOr: - debug "Error writing requested data", error + debug "Error writing requested data", error # No point in trying to continue writing data socket.close() return err("Error writing requested data") trace "Offered content item send", dataWritten = dataWritten await socket.closeWait() - debug "Content successfully offered" + debug "Content successfully offered" return ok(m.contentKeys) else: diff --git a/fluffy/network/wire/portal_stream.nim b/fluffy/network/wire/portal_stream.nim index 06affad99..a68e853d7 100644 --- a/fluffy/network/wire/portal_stream.nim +++ b/fluffy/network/wire/portal_stream.nim @@ -260,7 +260,7 @@ proc writeContentRequest( ) {.async: (raises: [CancelledError]).} = let dataWritten = await socket.write(request.content) if dataWritten.isErr(): - debug "Error writing requested data", error = dataWritten.error + trace "Error writing requested data", error = dataWritten.error await socket.closeWait() diff --git a/fluffy/tools/eth_data_exporter.nim b/fluffy/tools/eth_data_exporter.nim index f750a8c32..3429bce70 100644 --- a/fluffy/tools/eth_data_exporter.nim +++ b/fluffy/tools/eth_data_exporter.nim @@ -315,7 +315,7 @@ when isMainModule: info "Requesting epoch headers", epoch var headers: seq[headers.Header] for j in 0 ..< EPOCH_SIZE.uint64: - debug "Requesting block", number = j + debug "Requesting block", number = j let header = client.downloadHeader(epoch * EPOCH_SIZE + j) headers.add(header)