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 <kim.demey@gmail.com>
This commit is contained in:
Sacha Saint-Leger 2020-12-02 10:47:23 +01:00 committed by GitHub
parent 92655f936a
commit 94c66f15a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

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