From 4ec4adf2f6e7ae6225c00eaf498025c736354241 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Fri, 10 May 2024 14:08:16 +0200 Subject: [PATCH 1/4] adding logs --- waku/node/waku_node.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index 44076a91a0..a7d2a02a84 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -1128,6 +1128,10 @@ proc keepaliveLoop(node: WakuNode, keepalive: chronos.Duration) {.async.} = # Keep all connected peers alive while running trace "Running keepalive" + echo "------------------ Entering keepalive -----------" + echo "----------- ping connections: (in, out): ", + node.peerManager.getNumStreams(PingCodec) + # First get a list of connected peer infos let peers = node.peerManager.peerStore.peers().filterIt(it.connectedness == Connected) From 7a6ad6933411dd58553181fb551b3bf7e80678b1 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Fri, 10 May 2024 17:30:55 +0200 Subject: [PATCH 2/4] improving logs --- waku/node/waku_node.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index a7d2a02a84..63d311f4a5 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -1136,13 +1136,18 @@ proc keepaliveLoop(node: WakuNode, keepalive: chronos.Duration) {.async.} = let peers = node.peerManager.peerStore.peers().filterIt(it.connectedness == Connected) + echo "----------- physical connections before: ", + node.peerManager.connectedPeers(PingCodec) for peer in peers: try: let conn = await node.switch.dial(peer.peerId, peer.addrs, PingCodec) let pingDelay = await node.libp2pPing.ping(conn) + await conn.close() except CatchableError as exc: waku_node_errors.inc(labelValues = ["keep_alive_failure"]) + echo "----------- physical connections after: ", + node.peerManager.connectedPeers(PingCodec) await sleepAsync(keepalive) proc startKeepalive*(node: WakuNode) = From ad9b67a5f9dba481b7c3f22c730981b1dbe99f1e Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Fri, 10 May 2024 18:09:26 +0200 Subject: [PATCH 3/4] deleting logs --- waku/node/waku_node.nim | 7 ------- 1 file changed, 7 deletions(-) diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index 63d311f4a5..7a871c4b73 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -1128,15 +1128,10 @@ proc keepaliveLoop(node: WakuNode, keepalive: chronos.Duration) {.async.} = # Keep all connected peers alive while running trace "Running keepalive" - echo "------------------ Entering keepalive -----------" - echo "----------- ping connections: (in, out): ", - node.peerManager.getNumStreams(PingCodec) - # First get a list of connected peer infos let peers = node.peerManager.peerStore.peers().filterIt(it.connectedness == Connected) - echo "----------- physical connections before: ", node.peerManager.connectedPeers(PingCodec) for peer in peers: try: @@ -1146,8 +1141,6 @@ proc keepaliveLoop(node: WakuNode, keepalive: chronos.Duration) {.async.} = except CatchableError as exc: waku_node_errors.inc(labelValues = ["keep_alive_failure"]) - echo "----------- physical connections after: ", - node.peerManager.connectedPeers(PingCodec) await sleepAsync(keepalive) proc startKeepalive*(node: WakuNode) = From 115eccd3ca73f83d2d2cd1cd9af9a0a7b2983387 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Fri, 10 May 2024 18:10:30 +0200 Subject: [PATCH 4/4] delete line --- waku/node/waku_node.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index 7a871c4b73..4773846d37 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -1132,7 +1132,6 @@ proc keepaliveLoop(node: WakuNode, keepalive: chronos.Duration) {.async.} = let peers = node.peerManager.peerStore.peers().filterIt(it.connectedness == Connected) - node.peerManager.connectedPeers(PingCodec) for peer in peers: try: let conn = await node.switch.dial(peer.peerId, peer.addrs, PingCodec)