mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-24 17:58:30 +00:00
Add trace logs when ENR gets added to portal network routing table (#1932)
This commit is contained in:
parent
b27c2ff449
commit
78ec80eea0
@ -440,7 +440,7 @@ proc handleOffer(p: PortalProtocol, o: OfferMessage, srcId: NodeId): seq[byte] =
|
|||||||
AcceptMessage(connectionId: connectionId, contentKeys: contentKeysBitList))
|
AcceptMessage(connectionId: connectionId, contentKeys: contentKeysBitList))
|
||||||
|
|
||||||
proc messageHandler(protocol: TalkProtocol, request: seq[byte],
|
proc messageHandler(protocol: TalkProtocol, request: seq[byte],
|
||||||
srcId: NodeId, srcUdpAddress: Address, node: Opt[Node]): seq[byte] =
|
srcId: NodeId, srcUdpAddress: Address, nodeOpt: Opt[Node]): seq[byte] =
|
||||||
doAssert(protocol of PortalProtocol)
|
doAssert(protocol of PortalProtocol)
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
@ -462,12 +462,18 @@ proc messageHandler(protocol: TalkProtocol, request: seq[byte],
|
|||||||
# exists on the base layer, and it will also depend on the distance,
|
# exists on the base layer, and it will also depend on the distance,
|
||||||
# order of lookups, etc.
|
# order of lookups, etc.
|
||||||
# Note: As third measure, could run a findNodes request with distance 0.
|
# Note: As third measure, could run a findNodes request with distance 0.
|
||||||
if node.isSome():
|
if nodeOpt.isSome():
|
||||||
discard p.addNode(node.get())
|
let node = nodeOpt.value()
|
||||||
|
let status = p.addNode(node)
|
||||||
|
trace "Adding new node to routing table after incoming request",
|
||||||
|
status, node
|
||||||
else:
|
else:
|
||||||
let node = p.baseProtocol.getNode(srcId)
|
let nodeOpt = p.baseProtocol.getNode(srcId)
|
||||||
if node.isSome():
|
if nodeOpt.isSome():
|
||||||
discard p.addNode(node.get())
|
let node = nodeOpt.value()
|
||||||
|
let status = p.addNode(node)
|
||||||
|
trace "Adding new node to routing table after incoming request",
|
||||||
|
status, node
|
||||||
|
|
||||||
portal_message_requests_incoming.inc(
|
portal_message_requests_incoming.inc(
|
||||||
labelValues = [$p.protocolId, $message.kind])
|
labelValues = [$p.protocolId, $message.kind])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user