-
Notifications
You must be signed in to change notification settings - Fork 15
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
Establishing a session with nodes behind NAT/Firewall #173
Comments
I think the |
As a follow on, my fork now removes this check and things seem to work okay. It's not perfect yet and I've not dealt with the probably separate issue of whether or not an ENR with an inconsistent UDP endpoint should be added to the routing table or not (seems like it shouldn't if we follow what other implementations have done -- i.e. establish sessions only and then only respond to inbound requests on the session and not send outbound requests). Then, if/when the remote node updates its ENR to reflect the observed UDP endpoint, a new session can be established and the node added to the routing table. |
@acolytec3 @fjl would you mind checking what other discv5 implementations do regarding this ENR verification (i.e. Go, Rust, Nim)? |
I've been interacting with the Nim implementers on it and my understanding is that @fjl can you comment on the Go implementation? |
Yes, the go-ethereum implementation of discv5 does permit nodes with incorrect IP/port listed in ENR to establish a session. In go-ethereum such nodes may even be added to the routing table. However, since table entries must be reachable at the address listed in ENR for liveness verification, the nodes will be removed soon after. |
It looks like I think it might be worth further discussion about what is allowed in the |
@acolytec3 I'm fine with an approach that allows Portal Network usecases as long as it's safe enough against DOS attacks, i.e. the happy medium. If you could upstream your fork's code that would be great! We have limited bandwidth right now |
Okay! I'm going to make a few more tweaks and then we'll test some with Ultralight nodes on the fork to see if we uncover any issues before I submit a PR. |
No probem, thanks for the PRs ❤️ |
In my work on Ultralight, I've observed that our nodes running behind firewall or NAT (e.g. either on an Android device or else running on my local laptop) often times are not able to establish connections with our public Ultralight bootnodes with sessions getting dropped during the handshake process. As best I can tell, the root cause is often that the node behind the firewall is reporting a local IP address in its ENR so the other node is dropping the session during the handshake process at this point due to this
verifyEnr
call.I've interacted with @fjl on this some and it seems that this may be against the discv5 spec so wanted to understand if I'm misconfiguring something in Ultralight when instantiating the discv5 client or else what the thought process behind this is as it is something we're having to hack around in order to allow Ultralight nodes to join a public network. At a minimum, would you be open to a PR that allows for something like a session with an "untrusted" status? This would allow Ultralight nodes who don't know their public UDP endpoint address to connect to bootnodes, exchange discv5 PING/PONG, and then be able to
addrVotes
to update their ENR to the correct public UDP endpoint reported by the bootnode.The text was updated successfully, but these errors were encountered: