You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see libp2p/go-libp2p-autonat#40 for the motivation.
When an AutoNAT client makes a connection with an AutoNAT server, it caches the server address to prevent losing it due to a disconnection. This is messy, causes memory leaks(libp2p/go-libp2p-autonat#9) & prevents us from discovering AutoNAT servers we were connected to before we started the AutoNAT client(libp2p/go-libp2p-autonat#28). There should be a better way to do this.
Once we have #801 in place, we have a way to proactively request the peerstore to keep peer addresses around even after the peer disconnects. We should leverage this. A rough design would be:
Subscribe to the EvtPeerIdentificationCompleted message on the Eventbus & if a peer supports the AutoNAT protocol, note down it's peerId so we can keep pinning it till we get an error while trying to probe it. Once we get a dial error, we remove the peerId from our cache & Unpin it.
When we want to dial to an AutoNAT server, we use our cached peerIDs to ask the peer store for addresses we can dial to. The metric to shortlist the peers needs to be discussed i.e. most recently seen peers, peers that are still connected etc.
The text was updated successfully, but these errors were encountered:
Please see libp2p/go-libp2p-autonat#40 for the motivation.
When an AutoNAT client makes a connection with an AutoNAT server, it caches the server address to prevent losing it due to a disconnection. This is messy, causes memory leaks(libp2p/go-libp2p-autonat#9) & prevents us from discovering AutoNAT servers we were connected to before we started the AutoNAT client(libp2p/go-libp2p-autonat#28). There should be a better way to do this.
Once we have #801 in place, we have a way to proactively request the peerstore to keep peer addresses around even after the peer disconnects. We should leverage this. A rough design would be:
EvtPeerIdentificationCompleted
message on the Eventbus & if a peer supports the AutoNAT protocol, note down it's peerId so we can keep pinning it till we get an error while trying to probe it. Once we get a dial error, we remove the peerId from our cache & Unpin it.The text was updated successfully, but these errors were encountered: