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.
| 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.
As discussed in a call, let's use a commit hash here.
| 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.
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.
|
@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.
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 <elena.frank@protonmail.com>
|
@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 |
mxinden
left a comment
There was a problem hiding this comment.
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-v1codepoint yet we have to use the old/quicone, interpreted as draft-29. This is not supported byrust-libp2pv0.50.0/libp2p-quicv0.7.0-alpha, thus this PR uses right now libp2p from libp2p/rust-libp2p#3151.