juno icon indicating copy to clipboard operation
juno copied to clipboard

Nodes should reconnect to peers once they are online

Open weiihann opened this issue 1 year ago • 2 comments

Given the following scenario:

  • Node A is a feeder node.
  • Node B is a regular P2P node.
  • Node A is online first. Node B syncs successfully from Node A.
  • Node A goes offline. Node B no longer syncs from Node A.
  • Node A goes online again. Node B should automatically detects that Node A is online again, and attempts to resync from it.

However, that's not the case currently as Node B wasn't able to detect that Node A is online.

Not sure where the root cause is, but have some ideas for solution:

  1. Persists the peer information somewhere and loads it whenever the node is started. In this way, Node A could notify Node B that it is online.
  2. Regularly ping peers if they are online.

weiihann avatar Jun 14 '24 09:06 weiihann

LIbp2p automatically detects when an old nodes come back online but it does take some time. This is probably due to how often the DHT table is refreshed. I would recommend to wait a little while longer.

IronGauntlets avatar Jun 16 '24 23:06 IronGauntlets

I want to try this one out, with the first way.

CodeMongerrr avatar Jun 20 '24 11:06 CodeMongerrr

@IronGauntlets as you said, the Node gets connected after waiting for a little longer time, so is it okay this way or should there be another way for connecting to the past peer automatically, (Eg. a flag)

CodeMongerrr avatar Jul 06 '24 06:07 CodeMongerrr