From 94c66f15a95bff5565e1100966c21b0450d5f66c Mon Sep 17 00:00:00 2001 From: Sacha Saint-Leger Date: Wed, 2 Dec 2020 10:47:23 +0100 Subject: [PATCH] Wanted peers log message fix (#2114) * Edit Peer count low wanted peers log * remove prometheus folder * remove prometheus.yml * Add current peers to low peer count log * change to 25% peer count notice, 12.5% warning Co-authored-by: kdeme --- beacon_chain/eth2_network.nim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index d40039f3e..a958e6393 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -913,10 +913,15 @@ proc runDiscoveryLoop*(node: Eth2Node) {.async.} = new_peers = newPeers if newPeers == 0: - if node.peerPool.lenCurrent() <= node.wantedPeers shr 2: - warn "Less than 25% wanted peers and could not discover new nodes", - discovered = len(discoveredNodes), new_peers = newPeers, - wanted_peers = node.wantedPeers + let currentPeers = node.peerPool.lenCurrent() + if currentPeers <= node.wantedPeers shr 2: # 25% + notice "Peer count low, no new peers discovered", + discovered = len(discoveredNodes), new_peers = newPeers, + current_peers = currentPeers, wanted_peers = node.wantedPeers + elif currentPeers <= node.wantedPeers shr 3: # 12.5 % + warn "Peer count low, no new peers discovered", + discovered = len(discoveredNodes), new_peers = newPeers, + current_peers = currentPeers, wanted_peers = node.wantedPeers await sleepAsync(5.seconds) else: await sleepAsync(1.seconds)