Addresses getting removed from Kademlia after a disconnection #498
Labels
I2-bug
The node fails to follow expected behavior.
I3-annoyance
The node behaves within expectations, however this “expected behaviour” itself is at issue.
There is this pattern in the logs:
As the node disconnects, the address is removed from Kademlia and since the address it not stored anywhere else, the next time
ProtocolController
attempts to connect to the peer, the dial fails because there are no addresses available. The problem is that the addresses that get removed when a node disconnects (such as due to keep-alive timeout) are actually valid so there is no reason to delete them because after they're deleted, the node can no longer dial the peer.I looked into the Kademlia code and there wasn't anything obviously incorrect so it could be that this is the expected behavior. This is relatively easily fixed on Substrate side by keeping an LRU cache of peers and their addresses and in case libp2p doesn't give any addresses, we could take the addresses from this cache.
Not sure if this is an actual bug or just annoyance but adding both tags.
The text was updated successfully, but these errors were encountered: