From b7b04ed9e432cf8f4e0823b82d5192e61dbb8559 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 8 Oct 2024 10:23:22 +0200 Subject: [PATCH 1/5] metrics: rename routing_table_nodes to discovery_routing_table_nodes Signed-off-by: Csaba Kiraly --- codexdht/private/eth/p2p/discoveryv5/routing_table.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/codexdht/private/eth/p2p/discoveryv5/routing_table.nim b/codexdht/private/eth/p2p/discoveryv5/routing_table.nim index a890863..ca784f8 100644 --- a/codexdht/private/eth/p2p/discoveryv5/routing_table.nim +++ b/codexdht/private/eth/p2p/discoveryv5/routing_table.nim @@ -14,7 +14,7 @@ import export options -declarePublicGauge routing_table_nodes, +declarePublicGauge discovery_routing_table_nodes, "Discovery routing table nodes", labels = ["state"] logScope: @@ -208,14 +208,14 @@ proc ipLimitDec(r: var RoutingTable, b: KBucket, n: Node) = proc add(k: KBucket, n: Node) = k.nodes.add(n) - routing_table_nodes.inc() + discovery_routing_table_nodes.inc() proc remove(k: KBucket, n: Node): bool = let i = k.nodes.find(n) if i != -1: - routing_table_nodes.dec() + discovery_routing_table_nodes.dec() if k.nodes[i].seen: - routing_table_nodes.dec(labelValues = ["seen"]) + discovery_routing_table_nodes.dec(labelValues = ["seen"]) k.nodes.delete(i) trace "removed node:", node = n true @@ -527,7 +527,7 @@ proc setJustSeen*(r: RoutingTable, n: Node) = if not n.seen: b.nodes[0].seen = true - routing_table_nodes.inc(labelValues = ["seen"]) + discovery_routing_table_nodes.inc(labelValues = ["seen"]) proc nodeToRevalidate*(r: RoutingTable): Node = ## Return a node to revalidate. The least recently seen node from a random From 4d2250477e737272957001ad11dbb7478ad2e2a8 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 8 Oct 2024 10:24:00 +0200 Subject: [PATCH 2/5] metrics: add discovery_routing_table_buckets Signed-off-by: Csaba Kiraly --- codexdht/private/eth/p2p/discoveryv5/routing_table.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codexdht/private/eth/p2p/discoveryv5/routing_table.nim b/codexdht/private/eth/p2p/discoveryv5/routing_table.nim index ca784f8..cddb08e 100644 --- a/codexdht/private/eth/p2p/discoveryv5/routing_table.nim +++ b/codexdht/private/eth/p2p/discoveryv5/routing_table.nim @@ -16,6 +16,8 @@ export options declarePublicGauge discovery_routing_table_nodes, "Discovery routing table nodes", labels = ["state"] +declarePublicGauge discovery_routing_table_buckets, + "Discovery routing table: number of buckets" logScope: topics = "discv5 routingtable" @@ -286,6 +288,7 @@ proc init*(T: type RoutingTable, localNode: Node, bitsPerHop = DefaultBitsPerHop distanceCalculator = XorDistanceCalculator): T = ## Initialize the routing table for provided `Node` and bitsPerHop value. ## `bitsPerHop` is default set to 5 as recommended by original Kademlia paper. + discovery_routing_table_buckets.inc() RoutingTable( localNode: localNode, buckets: @[KBucket.new(0.u256, high(UInt256), ipLimits.bucketIpLimit)], @@ -299,6 +302,7 @@ proc splitBucket(r: var RoutingTable, index: int) = let (a, b) = bucket.split() r.buckets[index] = a r.buckets.insert(b, index + 1) + discovery_routing_table_buckets.inc() proc bucketForNode(r: RoutingTable, id: NodeId): KBucket = result = binaryGetBucketForNode(r.buckets, id) From ffeeeeb3fbb49d39bdfd1d550b375ca73456f84f Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Thu, 10 Oct 2024 11:42:11 +0200 Subject: [PATCH 3/5] transport: add metrics Signed-off-by: Csaba Kiraly # Conflicts: # codexdht/private/eth/p2p/discoveryv5/transport.nim --- codexdht/private/eth/p2p/discoveryv5/transport.nim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/codexdht/private/eth/p2p/discoveryv5/transport.nim b/codexdht/private/eth/p2p/discoveryv5/transport.nim index 8531918..ca39d6b 100644 --- a/codexdht/private/eth/p2p/discoveryv5/transport.nim +++ b/codexdht/private/eth/p2p/discoveryv5/transport.nim @@ -10,6 +10,7 @@ import bearssl/rand, chronos, chronicles, + metrics, libp2p/crypto/crypto, stew/shims/net, "."/[node, encoding, sessions] @@ -23,6 +24,11 @@ const logScope: topics = "discv5 transport" +declarePublicCounter discovery_transport_tx, + "Discovery transport messages sent", labels = ["state"] +declarePublicCounter discovery_transport_rx, + "Discovery transport messages received", labels = ["state"] + type Transport* [Client] = ref object client: Client @@ -56,7 +62,9 @@ proc sendToA(t: Transport, a: Address, msg: seq[byte]) = # nodes. Else the revalidation might end up clearing the routing tabl # because of ping failures due to own network connection failure. warn "Discovery send failed", msg = f.readError.msg + discovery_transport_tx.inc(labelValues = ["failed"]) ) + discovery_transport_tx.inc() proc send(t: Transport, n: Node, data: seq[byte]) = doAssert(n.address.isSome()) @@ -144,6 +152,7 @@ proc sendPending(t:Transport, toNode: Node): t.pendingRequestsByNode.del(toNode.id) proc receive*(t: Transport, a: Address, packet: openArray[byte]) = + discovery_transport_rx.inc() let decoded = t.codec.decodePacket(a, packet) if decoded.isOk: let packet = decoded[] @@ -215,6 +224,7 @@ proc receive*(t: Transport, a: Address, packet: openArray[byte]) = else: trace "address mismatch, not adding seen flag", node, address = a, nodeAddress = node.address.get() else: + discovery_transport_rx.inc(labelValues = ["failed_decode"]) trace "Packet decoding error", myport = t.bindAddress.port, error = decoded.error, address = a proc processClient[T](transp: DatagramTransport, raddr: TransportAddress): From 80cc069c5e2055c9dfa5fea8bfed70033a7bea23 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Thu, 10 Oct 2024 11:43:23 +0200 Subject: [PATCH 4/5] metrics: add transport byte counters Signed-off-by: Csaba Kiraly # Conflicts: # codexdht/private/eth/p2p/discoveryv5/transport.nim --- .../private/eth/p2p/discoveryv5/transport.nim | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/codexdht/private/eth/p2p/discoveryv5/transport.nim b/codexdht/private/eth/p2p/discoveryv5/transport.nim index ca39d6b..bdf52b7 100644 --- a/codexdht/private/eth/p2p/discoveryv5/transport.nim +++ b/codexdht/private/eth/p2p/discoveryv5/transport.nim @@ -24,10 +24,14 @@ const logScope: topics = "discv5 transport" -declarePublicCounter discovery_transport_tx, - "Discovery transport messages sent", labels = ["state"] -declarePublicCounter discovery_transport_rx, - "Discovery transport messages received", labels = ["state"] +declarePublicCounter discovery_transport_tx_packets, + "Discovery transport packets sent", labels = ["state"] +declarePublicCounter discovery_transport_tx_bytes, + "Discovery transport bytes sent", labels = ["state"] +declarePublicCounter discovery_transport_rx_packets, + "Discovery transport packets received", labels = ["state"] +declarePublicCounter discovery_transport_rx_bytes, + "Discovery transport bytes received", labels = ["state"] type Transport* [Client] = ref object @@ -62,9 +66,11 @@ proc sendToA(t: Transport, a: Address, msg: seq[byte]) = # nodes. Else the revalidation might end up clearing the routing tabl # because of ping failures due to own network connection failure. warn "Discovery send failed", msg = f.readError.msg - discovery_transport_tx.inc(labelValues = ["failed"]) + discovery_transport_tx_packets.inc(labelValues = ["failed"]) + discovery_transport_tx_bytes.inc(msg.len.int64, labelValues = ["failed"]) ) - discovery_transport_tx.inc() + discovery_transport_tx_packets.inc() + discovery_transport_tx_bytes.inc(msg.len.int64) proc send(t: Transport, n: Node, data: seq[byte]) = doAssert(n.address.isSome()) @@ -152,7 +158,8 @@ proc sendPending(t:Transport, toNode: Node): t.pendingRequestsByNode.del(toNode.id) proc receive*(t: Transport, a: Address, packet: openArray[byte]) = - discovery_transport_rx.inc() + discovery_transport_rx_packets.inc() + discovery_transport_rx_bytes.inc(packet.len.int64) let decoded = t.codec.decodePacket(a, packet) if decoded.isOk: let packet = decoded[] @@ -224,7 +231,8 @@ proc receive*(t: Transport, a: Address, packet: openArray[byte]) = else: trace "address mismatch, not adding seen flag", node, address = a, nodeAddress = node.address.get() else: - discovery_transport_rx.inc(labelValues = ["failed_decode"]) + discovery_transport_rx_packets.inc(labelValues = ["failed_decode"]) + discovery_transport_rx_bytes.inc(packet.len.int64, labelValues = ["failed_decode"]) trace "Packet decoding error", myport = t.bindAddress.port, error = decoded.error, address = a proc processClient[T](transp: DatagramTransport, raddr: TransportAddress): From 4ccaaee72166a7c064f4f20aa1ec8f2108ba7306 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Thu, 10 Oct 2024 11:44:26 +0200 Subject: [PATCH 5/5] rename metrics to dht_ from discovery_ Signed-off-by: Csaba Kiraly # Conflicts: # codexdht/private/eth/p2p/discoveryv5/transport.nim --- .../private/eth/p2p/discoveryv5/encoding.nim | 16 +++---- .../private/eth/p2p/discoveryv5/protocol.nim | 48 +++++++++---------- .../eth/p2p/discoveryv5/routing_table.nim | 16 +++---- .../private/eth/p2p/discoveryv5/transport.nim | 24 +++++----- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/codexdht/private/eth/p2p/discoveryv5/encoding.nim b/codexdht/private/eth/p2p/discoveryv5/encoding.nim index 7fd18e7..cdbc30e 100644 --- a/codexdht/private/eth/p2p/discoveryv5/encoding.nim +++ b/codexdht/private/eth/p2p/discoveryv5/encoding.nim @@ -33,9 +33,9 @@ from stew/objects import checkedEnumAssign export crypto -declareCounter discovery_session_lru_cache_hits, "Session LRU cache hits" -declareCounter discovery_session_lru_cache_misses, "Session LRU cache misses" -declareCounter discovery_session_decrypt_failures, "Session decrypt failures" +declareCounter dht_session_lru_cache_hits, "Session LRU cache hits" +declareCounter dht_session_lru_cache_misses, "Session LRU cache misses" +declareCounter dht_session_decrypt_failures, "Session decrypt failures" logScope: topics = "discv5" @@ -234,7 +234,7 @@ proc encodeMessagePacket*(rng: var HmacDrbgContext, c: var Codec, if c.sessions.load(toId, toAddr, recipientKey1, recipientKey2, initiatorKey): haskey = true messageEncrypted = encryptGCM(initiatorKey, nonce, message, @iv & header) - discovery_session_lru_cache_hits.inc() + dht_session_lru_cache_hits.inc() else: # We might not have the node's keys if the handshake hasn't been performed # yet. That's fine, we send a random-packet and we will be responded with @@ -247,7 +247,7 @@ proc encodeMessagePacket*(rng: var HmacDrbgContext, c: var Codec, var randomData: array[gcmTagSize + 4, byte] hmacDrbgGenerate(rng, randomData) messageEncrypted.add(randomData) - discovery_session_lru_cache_misses.inc() + dht_session_lru_cache_misses.inc() let maskedHeader = encryptHeader(toId, iv, header) @@ -431,11 +431,11 @@ proc decodeMessagePacket(c: var Codec, fromAddr: Address, nonce: AESGCMNonce, # Don't consider this an error, simply haven't done a handshake yet or # the session got removed. trace "Decrypting failed (no keys)" - discovery_session_lru_cache_misses.inc() + dht_session_lru_cache_misses.inc() return ok(Packet(flag: Flag.OrdinaryMessage, requestNonce: nonce, srcId: srcId)) - discovery_session_lru_cache_hits.inc() + dht_session_lru_cache_hits.inc() var pt = decryptGCM(recipientKey2, nonce, ct, @iv & @header) if pt.isNone(): @@ -448,7 +448,7 @@ proc decodeMessagePacket(c: var Codec, fromAddr: Address, nonce: AESGCMNonce, # needed later, depending on message order. trace "Decrypting failed (invalid keys)", address = fromAddr #c.sessions.del(srcId, fromAddr) - discovery_session_decrypt_failures.inc() + dht_session_decrypt_failures.inc() return ok(Packet(flag: Flag.OrdinaryMessage, requestNonce: nonce, srcId: srcId)) diff --git a/codexdht/private/eth/p2p/discoveryv5/protocol.nim b/codexdht/private/eth/p2p/discoveryv5/protocol.nim index 41003a3..f70435a 100644 --- a/codexdht/private/eth/p2p/discoveryv5/protocol.nim +++ b/codexdht/private/eth/p2p/discoveryv5/protocol.nim @@ -100,13 +100,13 @@ import nimcrypto except toHex export options, results, node, spr, providers -declareCounter discovery_message_requests_outgoing, +declareCounter dht_message_requests_outgoing, "Discovery protocol outgoing message requests", labels = ["response"] -declareCounter discovery_message_requests_incoming, +declareCounter dht_message_requests_incoming, "Discovery protocol incoming message requests", labels = ["response"] -declareCounter discovery_unsolicited_messages, +declareCounter dht_unsolicited_messages, "Discovery protocol unsolicited or timed-out messages" -declareCounter discovery_enr_auto_update, +declareCounter dht_enr_auto_update, "Amount of discovery IP:port address SPR auto updates" logScope: @@ -407,27 +407,27 @@ proc handleMessage(d: Protocol, srcId: NodeId, fromAddr: Address, message: Message) = case message.kind of ping: - discovery_message_requests_incoming.inc() + dht_message_requests_incoming.inc() d.handlePing(srcId, fromAddr, message.ping, message.reqId) of findNode: - discovery_message_requests_incoming.inc() + dht_message_requests_incoming.inc() d.handleFindNode(srcId, fromAddr, message.findNode, message.reqId) of findNodeFast: - discovery_message_requests_incoming.inc() + dht_message_requests_incoming.inc() d.handleFindNodeFast(srcId, fromAddr, message.findNodeFast, message.reqId) of talkReq: - discovery_message_requests_incoming.inc() + dht_message_requests_incoming.inc() d.handleTalkReq(srcId, fromAddr, message.talkReq, message.reqId) of addProvider: - discovery_message_requests_incoming.inc() - discovery_message_requests_incoming.inc(labelValues = ["no_response"]) + dht_message_requests_incoming.inc() + dht_message_requests_incoming.inc(labelValues = ["no_response"]) d.handleAddProvider(srcId, fromAddr, message.addProvider, message.reqId) of getProviders: - discovery_message_requests_incoming.inc() + dht_message_requests_incoming.inc() asyncSpawn d.handleGetProviders(srcId, fromAddr, message.getProviders, message.reqId) of regTopic, topicQuery: - discovery_message_requests_incoming.inc() - discovery_message_requests_incoming.inc(labelValues = ["no_response"]) + dht_message_requests_incoming.inc() + dht_message_requests_incoming.inc(labelValues = ["no_response"]) trace "Received unimplemented message kind", kind = message.kind, origin = fromAddr else: @@ -435,7 +435,7 @@ proc handleMessage(d: Protocol, srcId: NodeId, fromAddr: Address, if d.awaitedMessages.take((srcId, message.reqId), waiter): waiter.complete(some(message)) else: - discovery_unsolicited_messages.inc() + dht_unsolicited_messages.inc() trace "Timed out or unrequested message", kind = message.kind, origin = fromAddr @@ -464,7 +464,7 @@ proc sendRequest*[T: SomeMessage](d: Protocol, toNode: Node, m: T, trace "Send message packet", dstId = toNode.id, address = toNode.address, kind = messageKind(T) - discovery_message_requests_outgoing.inc() + dht_message_requests_outgoing.inc() d.transport.sendMessage(toNode, message) @@ -513,10 +513,10 @@ proc waitNodes(d: Protocol, fromNode: Node, reqId: RequestId): break return ok(res) else: - discovery_message_requests_outgoing.inc(labelValues = ["invalid_response"]) + dht_message_requests_outgoing.inc(labelValues = ["invalid_response"]) return err("Invalid response to find node message") else: - discovery_message_requests_outgoing.inc(labelValues = ["no_response"]) + dht_message_requests_outgoing.inc(labelValues = ["no_response"]) return err("Nodes message not received in time") proc ping*(d: Protocol, toNode: Node): @@ -534,11 +534,11 @@ proc ping*(d: Protocol, toNode: Node): return ok(resp.get().pong) else: d.replaceNode(toNode) - discovery_message_requests_outgoing.inc(labelValues = ["invalid_response"]) + dht_message_requests_outgoing.inc(labelValues = ["invalid_response"]) return err("Invalid response to ping message") else: d.replaceNode(toNode) - discovery_message_requests_outgoing.inc(labelValues = ["no_response"]) + dht_message_requests_outgoing.inc(labelValues = ["no_response"]) return err("Pong message not received in time") proc findNode*(d: Protocol, toNode: Node, distances: seq[uint16]): @@ -594,11 +594,11 @@ proc talkReq*(d: Protocol, toNode: Node, protocol, request: seq[byte]): return ok(resp.get().talkResp.response) else: d.replaceNode(toNode) - discovery_message_requests_outgoing.inc(labelValues = ["invalid_response"]) + dht_message_requests_outgoing.inc(labelValues = ["invalid_response"]) return err("Invalid response to talk request message") else: d.replaceNode(toNode) - discovery_message_requests_outgoing.inc(labelValues = ["no_response"]) + dht_message_requests_outgoing.inc(labelValues = ["no_response"]) return err("Talk response message not received in time") proc lookupDistances*(target, dest: NodeId): seq[uint16] = @@ -723,12 +723,12 @@ proc sendGetProviders(d: Protocol, toNode: Node, else: # TODO: do we need to do something when there is an invalid response? d.replaceNode(toNode) - discovery_message_requests_outgoing.inc(labelValues = ["invalid_response"]) + dht_message_requests_outgoing.inc(labelValues = ["invalid_response"]) return err("Invalid response to GetProviders message") else: # TODO: do we need to do something when there is no response? d.replaceNode(toNode) - discovery_message_requests_outgoing.inc(labelValues = ["no_response"]) + dht_message_requests_outgoing.inc(labelValues = ["no_response"]) return err("GetProviders response message not received in time") proc getProvidersLocal*( @@ -997,7 +997,7 @@ proc ipMajorityLoop(d: Protocol) {.async.} = warn "Failed updating SPR with newly discovered external address", majority, previous, error = res.error else: - discovery_enr_auto_update.inc() + dht_enr_auto_update.inc() info "Updated SPR with newly discovered external address", majority, previous, uri = toURI(d.localNode.record) else: diff --git a/codexdht/private/eth/p2p/discoveryv5/routing_table.nim b/codexdht/private/eth/p2p/discoveryv5/routing_table.nim index cddb08e..f4a1995 100644 --- a/codexdht/private/eth/p2p/discoveryv5/routing_table.nim +++ b/codexdht/private/eth/p2p/discoveryv5/routing_table.nim @@ -14,9 +14,9 @@ import export options -declarePublicGauge discovery_routing_table_nodes, +declarePublicGauge dht_routing_table_nodes, "Discovery routing table nodes", labels = ["state"] -declarePublicGauge discovery_routing_table_buckets, +declarePublicGauge dht_routing_table_buckets, "Discovery routing table: number of buckets" logScope: @@ -210,14 +210,14 @@ proc ipLimitDec(r: var RoutingTable, b: KBucket, n: Node) = proc add(k: KBucket, n: Node) = k.nodes.add(n) - discovery_routing_table_nodes.inc() + dht_routing_table_nodes.inc() proc remove(k: KBucket, n: Node): bool = let i = k.nodes.find(n) if i != -1: - discovery_routing_table_nodes.dec() + dht_routing_table_nodes.dec() if k.nodes[i].seen: - discovery_routing_table_nodes.dec(labelValues = ["seen"]) + dht_routing_table_nodes.dec(labelValues = ["seen"]) k.nodes.delete(i) trace "removed node:", node = n true @@ -288,7 +288,7 @@ proc init*(T: type RoutingTable, localNode: Node, bitsPerHop = DefaultBitsPerHop distanceCalculator = XorDistanceCalculator): T = ## Initialize the routing table for provided `Node` and bitsPerHop value. ## `bitsPerHop` is default set to 5 as recommended by original Kademlia paper. - discovery_routing_table_buckets.inc() + dht_routing_table_buckets.inc() RoutingTable( localNode: localNode, buckets: @[KBucket.new(0.u256, high(UInt256), ipLimits.bucketIpLimit)], @@ -302,7 +302,7 @@ proc splitBucket(r: var RoutingTable, index: int) = let (a, b) = bucket.split() r.buckets[index] = a r.buckets.insert(b, index + 1) - discovery_routing_table_buckets.inc() + dht_routing_table_buckets.inc() proc bucketForNode(r: RoutingTable, id: NodeId): KBucket = result = binaryGetBucketForNode(r.buckets, id) @@ -531,7 +531,7 @@ proc setJustSeen*(r: RoutingTable, n: Node) = if not n.seen: b.nodes[0].seen = true - discovery_routing_table_nodes.inc(labelValues = ["seen"]) + dht_routing_table_nodes.inc(labelValues = ["seen"]) proc nodeToRevalidate*(r: RoutingTable): Node = ## Return a node to revalidate. The least recently seen node from a random diff --git a/codexdht/private/eth/p2p/discoveryv5/transport.nim b/codexdht/private/eth/p2p/discoveryv5/transport.nim index bdf52b7..2861611 100644 --- a/codexdht/private/eth/p2p/discoveryv5/transport.nim +++ b/codexdht/private/eth/p2p/discoveryv5/transport.nim @@ -24,13 +24,13 @@ const logScope: topics = "discv5 transport" -declarePublicCounter discovery_transport_tx_packets, +declarePublicCounter dht_transport_tx_packets, "Discovery transport packets sent", labels = ["state"] -declarePublicCounter discovery_transport_tx_bytes, +declarePublicCounter dht_transport_tx_bytes, "Discovery transport bytes sent", labels = ["state"] -declarePublicCounter discovery_transport_rx_packets, +declarePublicCounter dht_transport_rx_packets, "Discovery transport packets received", labels = ["state"] -declarePublicCounter discovery_transport_rx_bytes, +declarePublicCounter dht_transport_rx_bytes, "Discovery transport bytes received", labels = ["state"] type @@ -66,11 +66,11 @@ proc sendToA(t: Transport, a: Address, msg: seq[byte]) = # nodes. Else the revalidation might end up clearing the routing tabl # because of ping failures due to own network connection failure. warn "Discovery send failed", msg = f.readError.msg - discovery_transport_tx_packets.inc(labelValues = ["failed"]) - discovery_transport_tx_bytes.inc(msg.len.int64, labelValues = ["failed"]) + dht_transport_tx_packets.inc(labelValues = ["failed"]) + dht_transport_tx_bytes.inc(msg.len.int64, labelValues = ["failed"]) ) - discovery_transport_tx_packets.inc() - discovery_transport_tx_bytes.inc(msg.len.int64) + dht_transport_tx_packets.inc() + dht_transport_tx_bytes.inc(msg.len.int64) proc send(t: Transport, n: Node, data: seq[byte]) = doAssert(n.address.isSome()) @@ -158,8 +158,8 @@ proc sendPending(t:Transport, toNode: Node): t.pendingRequestsByNode.del(toNode.id) proc receive*(t: Transport, a: Address, packet: openArray[byte]) = - discovery_transport_rx_packets.inc() - discovery_transport_rx_bytes.inc(packet.len.int64) + dht_transport_rx_packets.inc() + dht_transport_rx_bytes.inc(packet.len.int64) let decoded = t.codec.decodePacket(a, packet) if decoded.isOk: let packet = decoded[] @@ -231,8 +231,8 @@ proc receive*(t: Transport, a: Address, packet: openArray[byte]) = else: trace "address mismatch, not adding seen flag", node, address = a, nodeAddress = node.address.get() else: - discovery_transport_rx_packets.inc(labelValues = ["failed_decode"]) - discovery_transport_rx_bytes.inc(packet.len.int64, labelValues = ["failed_decode"]) + dht_transport_rx_packets.inc(labelValues = ["failed_decode"]) + dht_transport_rx_bytes.inc(packet.len.int64, labelValues = ["failed_decode"]) trace "Packet decoding error", myport = t.bindAddress.port, error = decoded.error, address = a proc processClient[T](transp: DatagramTransport, raddr: TransportAddress):