New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config Announce Address automatically Overwritten to /p2p/peer-id #7736
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
If you're hard-coding relay addresses, you shouldn't be using auto-relay. Auto relay means "autodetect whether or not I'm behind a NAT and, if so, try to find a relay and announce relay addresses". Also note: At the moment, AutoRelay will use relays from a pre-defined list as randomly discovered relays on the network tended to behave very poorly. Ideally, we'd have some form of reputation/reliability score, but we haven't gotten around to implementing anything like this.
This seems like a bug, regardless. What's the output of |
Thanks! This is really good to know, I'd incorrectly thought that without having auto-relay enabled the nodes wouldn't accept a relay connection at all. Quick additional question, in doing some testing I have noticed that without auto-relay being enabled the nodes are still accessible if I look them up from the swarm boot strapper nodes, but they don't broadcast their announce address by default. Do you know why this would be? For example, if I view
For the first ~15 minutes the output of
Then after ~15 minutes
|
AutoRelay really just means "automatically find me a relay". In your case, just:
Could you expand on this? If Regardless, announcing an "empty" address is definitely a bug that we'll have to track down. |
Is there any case that the nodes' addresses aren't passed further than the bootstrap nodes? What I'm seeing here is that as long as I and the peer behind the relay are directly connected to the relay node I'm able to lookup the routing information for the node. However it doesn't seem like the routing information of the node behind the relay is getting passed down to any of the other nodes. (As in running Right now it doesn't appear that this is having any effect on retrieving content from the cluster but I'm worried once there are more nodes than can connect to the relay peer at once that the peers behind the relay will become inaccessible. Thank you for all your help diagnosing this issue @Stebalien! |
As long as you have the DHT enabled, no. Your nodes should be pushing their addresses to the nodes closest to them in the DHT (as long as they're connected to at least one DHT node). However, I think I may know what's wrong:
I ask because you may not actually be forming a functional DHT. |
2
7 (2 bootstrap nodes + 5 nodes publicly accessible through UPnP NATs) (Not counting any behind the relay.)
I've manually set all of the nodes to |
Don't do this for the nodes behind relays. We explicitly filter those out when querying as dialing DHT peers through relays is very slow (and unreliable).
That should be enough. In one of your unreachable relayed nodes, try running Then go to one of those nodes and run If it does have the correct address, go to a node that's unable to connect to the node behind a relay and run |
I think I figured out the bug. There are two things at play here together: 1. AutoRelay wraps/overrides the configured Host AddressFactory with another AddressFactory that converts all public addresses to corresponding relay addresses. DNS addresses are treated as public addresses here. The code is here: https://github.com/libp2p/go-libp2p/blob/fcf69647e945b30851fe394d140f7a70643e48cf/p2p/host/relay/autorelay.go#L70 Now, since the address returned by the wrapped address factory(configured by So, essentially, a call to 2. Now, turns out that I think the fix is to either disallow the user from using the Wdyt ? |
Yeah, disallowing autorelay (client) in this case makes sense. That is, if RelayHop is not set and EnableAutoRelay and Addresses.Announce are set, we should fail on start. I can't think of a case where this would make sense. Also, we should definitely detect the "no addresses" case in |
IIUC, libp2p dosen't know that Also, why did we change the |
I believe this needs to happen in ipfs.
Probably to fix a different bug? I can't remember. |
Version information:
ipfs version 0.7.0
Description:
I've successfully gotten a couple of nodes to communicate in a private swarm through a relay by enabling both AutoRelay & RelayHop on one of the nodes with a publicly accessible connection, as well as also hard-coding the relay addresses for the other nodes in their announce config. This all works perfectly for ~15 minutes, until for some reason the announce addresses are overwritten on the nodes behind the NAT to
/p2p/PEER-ID
. After that point the nodes drop out of the swarm and become inaccessible by each other. Is there anyway to prevent the nodes from overwriting the manual announce address in the config?The text was updated successfully, but these errors were encountered: