Understanding Peer Removal and Synchronization from Kademlia DHT Routing Table #2646
Unanswered
teslashibe
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm currently working with the github.com/libp2p/go-libp2p-kad-dht package and I have some unexpected behavior and I'm not sure what I am doing wrong. Specifically, I've observed that a peer is added to the DHT and then immediately removed. I've added logging to track when peers are added and removed, and I've also checked the usefulness of a peer before and after it's added to the routing table using the UsefulNewPeer function.
One hypothesis I have is that the peer is being removed because my node doesn't establish its own connection to the peer, even though it adds the peer to the routing table when a new stream is received from that peer. I've tried to mitigate this by manually establishing a connection to the peer when a new stream is received, but I'm still seeing the same behavior.
I am also not sure why the nodes don't synchronize their DHT so that they discover new nodes that join through the boot node.
I have a repository with just the code that is runnable to observe the behavior.
https://github.com/masa-finance/masa-node-kdht
I'm wondering if anyone has any insights into why a peer might be removed immediately after being added to the DHT. Are there any other conditions under which a peer might be considered "not useful" and removed from the routing table? Any advice or suggestions would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions