-
Notifications
You must be signed in to change notification settings - Fork 11
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
rust-client: Add support for QUIC transport #52
Conversation
This enables support for dialing quic addresses that use the old `/quic` codepoint, interpreted as quic version draft-29.
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.
Thanks for preparing this!
rust-client/Cargo.toml
Outdated
@@ -11,7 +11,7 @@ env_logger = "0.9" | |||
either = "1.6.1" | |||
futures = "0.3" | |||
futures-timer = "3.0.0" | |||
libp2p = { version = "0.50.0", features = ["async-std", "dcutr", "dns", "identify", "noise", "relay", "ping", "tcp", "yamux", "macros"] } | |||
libp2p = { version = "0.50.0", git = "https://github.com/elenaf9/rust-libp2p", branch = "quic/draft-29", features = ["async-std", "dcutr", "dns", "identify", "noise", "relay", "ping", "quic", "tcp", "yamux", "macros"] } |
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.
As discussed in a call, let's use a commit hash here.
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.
👍 63c45cf
rust-client/src/main.rs
Outdated
let transport = OrTransport::new(quic_transport, tcp_relay_transport) | ||
.map(|either_output, _| match either_output { | ||
EitherOutput::First((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)), | ||
EitherOutput::Second((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)), | ||
}) | ||
.boxed(); |
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.
This would not allow a DNS address for QUIC, right? E.g. /dns6/max-inden.de/udp/1234/quic
.
I think the easiest fix would be to wrap the quic_transport
with another DnsConfig::system
.
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.
Done in 780e104.
@MarcoPolo nix builds in the CI fail, I think because we are now using |
To support hole punching on IPv6, the rust-client should listen on IPv6 for incoming TCP and QUIC connections.
Some IPFS nodes still use RSA keys. Enabling the feature will allow us to connect to these nodes.
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.
Thanks for the fixes.
Currently the client learns its observed address through the relay of the target host. Though that is only a single IP version and Transport protocol pair. E.g. when the client connects via IPv4 and TCP to the relay, it will not learn its IPv6 nor QUIC address. With this patch, the client connects to the various IPFS bootstrap nodes, each with a different IP version and Transport protocol, thus learning more, maybe even all, of its observed addresses. Fixes #32.
Co-authored-by: Elena Frank <[email protected]>
@mxinden I would already merge this PR. Once libp2p/rust-libp2p#3151 is merged we can change the git rev to the merge commit or wait for the patch release of |
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.
Merging here sounds good to me.
//CC @MarcoPolo we broke the Nix build, given that the Rust client now depends on a git reference. We prioritized QUIC over Nix. Please speak up in case that is a big issue. |
Not a problem, looks like an easy fix. I'll have something up in a bit |
Add support for the QUIC transport to the rust-client.
Resolves #41.
Since the IPFS network does not support the new
/quic-v1
codepoint yet we have to use the old/quic
one, interpreted as draft-29. This is not supported byrust-libp2p
v0.50.0
/libp2p-quic
v0.7.0-alpha
, thus this PR uses right now libp2p from libp2p/rust-libp2p#3151.