Skip to content
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

Peer routing fails for peers behind NAT (with /p2p-circuit) #78

Closed
2color opened this issue Aug 13, 2024 · 2 comments · Fixed by #80
Closed

Peer routing fails for peers behind NAT (with /p2p-circuit) #78

2color opened this issue Aug 13, 2024 · 2 comments · Fixed by #80
Labels
kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up

Comments

@2color
Copy link
Member

2color commented Aug 13, 2024

What's wrong

When running someguy with a public IP that isn't dialable (due to firewall or whatnot) and trying to resolve a PeerID to multiaddrs for a peer behind NAT, someguy doesn't return any results.

This was observed in the delegated routing endpoint, which consistently returns empty results for such peers.

This seems to be a recent regression, likely as part of the 0.4.0

Related issues

My hunch is that this is due to libp2p/go-libp2p#2913 based on some testing trying to resolve my own peerID (which is behind NAT). By enabling hole punching logging (GOLOG_LOG_LEVEL="p2p-holepunch=debug) I was able to see ("error": "failed to open hole-punching stream: failed to negotiate protocol: protocols not supported: [/libp2p/dcutr]"}) errors

@2color
Copy link
Member Author

2color commented Aug 14, 2024

After some investigation with the help of @sukunrt, this bug is likely due to a change in go-libp2p libp2p/go-libp2p#2696 which deprecated the CanConnect Network state along with the dependency on go-libp2p-kad-dht which was still depending on that value.

I've opened a PR in the go-libp2p-kad-dht repo to fix this.

@lidel lidel mentioned this issue Aug 14, 2024
32 tasks
@2color
Copy link
Member Author

2color commented Aug 19, 2024

We have pushed a workaround fix for the public delegated routing endpoint by allowing the someguy libp2p host to bind to a specific port, which if is on a public interface, avoids the bugs around hole punching with direct dial backs (which were blocked to to dynamic ports blocked by firewall)

#79

@gammazero gammazero added kind/bug A bug in existing code (including security flaws) status/blocked Unable to be worked further until needs are met P1 High: Likely tackled by core team if no one steps up labels Aug 20, 2024
@lidel lidel removed the status/blocked Unable to be worked further until needs are met label Aug 21, 2024
@lidel lidel closed this as completed in #80 Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants