libp2p / go-libp2p-kad-dht

A Kademlia DHT implementation on go-libp2p
https://github.com/libp2p/specs/tree/master/kad-dht
MIT License
524 stars 224 forks source link

Problem with running a dns only dht #973

Open sukunrt opened 3 months ago

sukunrt commented 3 months ago

When running a dht node which advertises only /dns addresses, I see that my node is not getting any incoming connections and the outgoing connections are eventually closed as well, leading to a situation where the node has < 10 connections.

This happens because this change: https://github.com/libp2p/go-libp2p-kad-dht/pull/839 which added a filter for incoming addresses. Similarly go-libp2p added a filter for addresses in identify here: https://github.com/libp2p/go-libp2p/pull/2300

While both these changes are correct they relied on an incorrect version of manet.IsPublic which incorrectly classified /dns addresses as non Public. This was eventually fixed in go-libp2p and go-multiaddr by: https://github.com/libp2p/go-libp2p/pull/2553/files

There are still a lot of nodes out there on the incorrect version which is leading to /dns addresses being filtered.

  1. We should add a test somewhere in this repo to prevent a regression.
  2. Mention somewhere that at least on the Amino DHT, people will have to advertise their IP addresses.