-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Background
@igor-sirotin did a great analysis (thanks for it 🥳) about what is happening:
I have a nwaku bootnode running.
Then I start a status-backend.
The container gets some IP 172.20.0.6.
The go-waku instance selects a random port 22333
We use an ephemeral private key for waku, so it has a random PeerID
Let's call the above ENR-1
Here status-backend:
✅ statically connects to the bootnode
✅ can be discovered through peer exchange
Now, keeping the bootnode running, I restart the status-backend
it gets the same IP 172.20.0.6
it selects a random port 33444
new ephemeral private key, so a new PeerID
Let's call the above ENR-2
The restarted status-backend:
✅ statically connects to the bootnode
❌ can not be discovered through peer exchange
This happens because the bootnode continues to share ENR-1, and does not share ENR-2. So other backends get (through peer exchange with bootnode) an outdated ENR, try to connect to it and obviously fail.
After waiting for ~10 min, the bootnode forgets ENR-1 and starts to advertise ENR-2. Then the status-backend can be discovered and connected to
Details
In order to enhance that, we need to apply @fryorcraken and @chaitanyaprem suggestions.
- Avoid this poll and instead
, update the local peer-exchange cache with the recently new discovered/connected peers.whenever a request for peers is received fetch data from peerStore using getReachablePeers, filter it out and then respond.
- Also, is interesting to keep a regular poll to check peers' liveness. If a counter-party peer doesn't reply properly in 10 minutes, then remove it from the peer-exchange cache.- note: maybe this last point is not needed if we are able to reliably detect when a peer disconnects from us.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status