-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix: use IP addresses instead of dns to store multiaddresses #1134
Conversation
Jenkins BuildsClick to see older builds (2)
|
88f0154
to
0c3a092
Compare
0c3a092
to
652a543
Compare
As per https://github.com/waku-org/specs/blob/master/standards/core/enr.md#multiaddrs-enr-key , looks like circuit-relay addresses can also be included in ENR. Are we missing something here? Is there any specific reason we were not including circuit-relay addresses as part of ENR? |
I think go-waku is the only implementation that had support for circuit relay addresses in the ENR. This was later proposed to be added to the specs in this PR: vacp2p/rfc#613 In the code we were including circuit relay addresses in the ENR. The only restriction it had was that the length of the address had to be <= 100 characters which was a somewhat arbitrary number I added while writting that code sometime ago, but, while reviewing that code I found out that condition is not necessary because the code in https://github.com/waku-org/go-waku/blob/master/waku/v2/protocol/enr/localnode.go#L26-L56 will automatically try to write as many multiaddresses as possible in the ENR as long as it does not exceed the 300 bytes limit, which is done when the enr is signed:
|
Realized the issue and assumption i was making, thanks for clarifying. |
I think that's fine. We just need to try it out and we can review if we are in a scenario where IPs change often behind a sepcific domain name. Which is unlikely. In any case, discv5 and ENR setup needs to work for application on home broadband, behind nat with potential dynamic IPs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tested this locally and the ip address is resolved and ENR has ip for circuit-relay address. |
One more comment on that. It's actually better to have ip address because the desktop node that includes the address in their ENR needs to include the address of the node they are actually connected to. For example, if the DNS entry resolved to several hosts, then it would be an issue as a 3rd node trying to connected to the desktop node might not hit the right IP. |
That is a valid point, so it makes sense to use IP address only rather than DNS for circuit-relay addresses. |
This is so the circuit relay
multiaddrs
only use IP and not the long URLs like those used on the fleet.This has the drawback that if the domain name is updated to point to a different IP, the IP address stored in the
multiaddr
field will no longer be valid, but I think this is okay, since ENRs are not the ideal place for storing circuit relay addresses (we should use rendezvous instead), and it's done only in an attempt to provide a way for peers to announce themselves.