-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: reuse the quic port in webtransport #2935
Conversation
We don't need this change. The current behavior of using different ports when we listen on
is the expected behavior and also one that on changing might break existing users. To reuse the same port, either pass a port explicitly or listen on port 0 for quic first and then listen on webtransport with the port allocated to the quic listener. |
Fair enough. If we allow WebTransport and QUIC to be allocated different ports, we still need to fix the bug whereby go-libp2p fails to correctly verify an observed ip as observed in this comment, because the request goes out from the WebTransport port which then doesn't match the QUIC one (as we also noticed in our testing @sukunrt) Any thoughts on that? Should we open a separate issue for that? |
Fixed in #2936 |
Naive question, if this change is not necessary, why do we define go-libp2p/p2p/transport/webrtc/transport.go Lines 166 to 168 in 412daa4
In other words, isn't this PR required for situations when you explicitly use the same port for the WebTransport and QUIC listeners? |
You can do (webtransport followed by quic)
But you cannot do (webrtc-direct followed by quic):
This is to ensure that the udp socket used for port 4001 is correctly shared between This is not a problem for webtransport because it's easy to share ownership there since it's all using |
Got it. So this can be closed? |
One more thought on this. I think we can change this, but we should just do it deliberately through an option this is default off, and at some point default on. (like all breaking changes). |
This sets the ListenOrder for WebTransport so that it starts listening after QUIC, thereby allowing port reuse when not listening on an explicit port.
Related bugs
Related to #2913 and fixes a bug whereby a libp2p peer doesn't register an observed public IP, because the outgoing connection uses the WebTransport port which is different to the QUIC port.