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 #2974

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
3 changes: 0 additions & 3 deletions fluffy/network/history/history_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/state/state_gossip.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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*(
Expand Down
12 changes: 6 additions & 6 deletions fluffy/network/wire/portal_protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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*(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
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 @@ -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()

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 @@ -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)

Expand Down
Loading