Skip to content

Commit

Permalink
Avoid flushing peer list (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandemeusy authored Feb 28, 2025
1 parent 80ba1be commit 91cdbda
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions ct-app/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ async def retrieve_peers(self):
Retrieve real peers from the network.
"""
results = await self.api.peers()

if len(results) == 0:
logger.warning("No results while retrieving peers",
self.log_base_params)
return
else:
logger.info("Scanned reachable peers", {
"count": len(results), **self.log_base_params})
peers = {Peer(item.peer_id, item.address, item.version)
for item in results}
peers = {p for p in peers if not p.is_old(self.params.peer.minVersion)}
Expand All @@ -275,9 +283,6 @@ async def retrieve_peers(self):
await self.peers.set(peers)
await self.peer_history.update(addresses_w_timestamp)

logger.info("Scanned reachable peers", {
"count": len(peers), **self.log_base_params})

if addr := self.address:
PEERS_COUNT.labels(addr.hopr).set(len(peers))

Expand All @@ -289,6 +294,8 @@ async def retrieve_channels(self):
channels = await self.api.channels()

if channels is None:
logger.warning("No results while retrieving channels",
self.log_base_params)
return

if addr := self.address:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod-blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ service:
deployment:
env: |
- name: RUST_LOG
value: info,hopr_transport_p2p=debug
value: info
- name: RUST_BACKTRACE
value: full
- name: HOPRD_LOG_FORMAT
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ctdapp:
core:
replicas: 1
# see https://console.cloud.google.com/artifacts/docker/hoprassociation/europe-west3/docker-images/cover-traffic?inv=1&invt=AbpZVw&project=hoprassociation
tag: v3.9.2
tag: v3.9.3

nodes:
NODE_ADDRESS_1: http://ctdapp-blue-node-1-p2p-tcp:3001
Expand Down

0 comments on commit 91cdbda

Please sign in to comment.