ipshipyard / p2p-forge

An Authoritative DNS server for distributing DNS subdomains to libp2p peers
1 stars 0 forks source link

fix(client): wait for public reachability before registering #4

Closed aschmahmann closed 18 hours ago

aschmahmann commented 1 week ago

This PR attempts to not send out any challenges at all until the libp2p host has signaled that the node is public. The current level of filtering for public IP addresses does not totally work in that if you have a public IPv6 address but it's inaccessible due to a firewall then we will still reach out too early and hit a failure. Some of the current problems with this are:

  1. It delays how long the user has to wait to get a cert due to the internal backoff
  2. It's extra wasted work for both the client and server
  3. The user will see error logs that either they'll be concerned about or learn to ignore entirely, neither of which is really right here

AFAICT this does not work due to a mismatch between the ObsAddrManager and EvtLocalReachabilityChanged as emitted by autonat:

This seems like a bug we'd ideally fix within go-libp2p, but maybe I'm missing something

cc @sukunrt @MarcoPolo @lidel → please discuss in https://github.com/ipshipyard/p2p-forge/issues/7