Closed kilrau closed 3 years ago
In my tests, I encountered the following behavior that I believe is directly related to the comment linked above.
I'll look into why these "zombie" peers are remaining in the peers list even when connectivity is lost. Our ping/pong packets should be disconnecting these peers when the ping doesn't receive a corresponding pong, so my first thought is that something isn't working correctly there.
As a quick overview of the behavior we expect:
So can anyone please describe how P2P connection establishing / connection supporting / connection restoring cases work in xud?
Nodes advertise listening addresses and gossip other known nodes and their respective listening addresses. A given node will listen for inbound peers on its inbound addresses and also attempt outbound connections for known nodes with listening addresses. Once connected, nodes exchange ping and pong packets on a timer, and most packets have a time threshold by which they expect a response. If a node expects a response from a peer but doesn't get one in time, it should disconnect that peer and send it a final packet explaining that it's disconnecting due to stalling. In case two peers lose connection (due to stalling, for example) the peer that originally initiated the connection should attempt to reconnect.
This issue is to collect a set of peer connection test cases with the goal to reliably reproduce issues regarding connecting/re-connecting to peers that continue to pop up: https://github.com/ExchangeUnion/xud/pull/2009#issuecomment-736737531