Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

- Remove QUIC from the `async-std` swarm builder, as `async-std` support was removed from `libp2p-quic` transport.
See [PR 5954](https://github.com/libp2p/rust-libp2p/pull/5954)

- Remove DNS from the `async-std` swarm builder, as `async-std` support was removed from `libp2p-dns` transport.
See [PR 5959](https://github.com/libp2p/rust-libp2p/pull/5959)

## 0.55.0

Expand Down
2 changes: 1 addition & 1 deletion libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ full = [
"upnp",
]

async-std = ["libp2p-swarm/async-std", "libp2p-tcp?/async-io", "libp2p-dns?/async-std"]
async-std = ["libp2p-swarm/async-std", "libp2p-tcp?/async-io"]
autonat = ["dep:libp2p-autonat"]
cbor = ["libp2p-request-response?/cbor"]
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
Expand Down
45 changes: 0 additions & 45 deletions libp2p/src/builder/phase/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@ pub struct DnsPhase<T> {
pub(crate) transport: T,
}

#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncStd, DnsPhase<T>> {
pub fn with_dns(
self,
) -> Result<
SwarmBuilder<
super::provider::AsyncStd,
WebsocketPhase<impl AuthenticatedMultiplexedTransport>,
>,
std::io::Error,
> {
Ok(SwarmBuilder {
keypair: self.keypair,
phantom: PhantomData,
phase: WebsocketPhase {
transport: libp2p_dns::async_std::Transport::system2(self.phase.transport)?,
},
})
}
}

#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::Tokio, DnsPhase<T>> {
pub fn with_dns(
Expand All @@ -49,30 +28,6 @@ impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::Tokio,
}
}

#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncStd, DnsPhase<T>> {
pub fn with_dns_config(
self,
cfg: libp2p_dns::ResolverConfig,
opts: libp2p_dns::ResolverOpts,
) -> SwarmBuilder<
super::provider::AsyncStd,
WebsocketPhase<impl AuthenticatedMultiplexedTransport>,
> {
SwarmBuilder {
keypair: self.keypair,
phantom: PhantomData,
phase: WebsocketPhase {
transport: libp2p_dns::async_std::Transport::custom2(
self.phase.transport,
cfg,
opts,
),
},
}
}
}

#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::Tokio, DnsPhase<T>> {
pub fn with_dns_config(
Expand Down
32 changes: 0 additions & 32 deletions libp2p/src/builder/phase/other_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@ impl<Provider, T: AuthenticatedMultiplexedTransport>
}

// Shortcuts
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport>
SwarmBuilder<super::provider::AsyncStd, OtherTransportPhase<T>>
{
pub fn with_dns(
self,
) -> Result<
SwarmBuilder<
super::provider::AsyncStd,
WebsocketPhase<impl AuthenticatedMultiplexedTransport>,
>,
std::io::Error,
> {
self.without_any_other_transports().with_dns()
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport>
SwarmBuilder<super::provider::Tokio, OtherTransportPhase<T>>
Expand All @@ -98,22 +82,6 @@ impl<T: AuthenticatedMultiplexedTransport>
self.without_any_other_transports().with_dns()
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport>
SwarmBuilder<super::provider::AsyncStd, OtherTransportPhase<T>>
{
pub fn with_dns_config(
self,
cfg: libp2p_dns::ResolverConfig,
opts: libp2p_dns::ResolverOpts,
) -> SwarmBuilder<
super::provider::AsyncStd,
WebsocketPhase<impl AuthenticatedMultiplexedTransport>,
> {
self.without_any_other_transports()
.with_dns_config(cfg, opts)
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport>
SwarmBuilder<super::provider::Tokio, OtherTransportPhase<T>>
Expand Down
39 changes: 1 addition & 38 deletions libp2p/src/builder/phase/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,6 @@ impl<Provider, T: AuthenticatedMultiplexedTransport> SwarmBuilder<Provider, Quic
.with_behaviour(constructor)
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncStd, QuicPhase<T>> {
pub fn with_dns(
self,
) -> Result<
SwarmBuilder<
super::provider::AsyncStd,
WebsocketPhase<impl AuthenticatedMultiplexedTransport>,
>,
std::io::Error,
> {
self.without_quic()
.without_any_other_transports()
.with_dns()
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::Tokio, QuicPhase<T>> {
pub fn with_dns(
Expand All @@ -181,21 +165,6 @@ impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::Tokio,
.with_dns()
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncStd, QuicPhase<T>> {
pub fn with_dns_config(
self,
cfg: libp2p_dns::ResolverConfig,
opts: libp2p_dns::ResolverOpts,
) -> SwarmBuilder<
super::provider::AsyncStd,
WebsocketPhase<impl AuthenticatedMultiplexedTransport>,
> {
self.without_quic()
.without_any_other_transports()
.with_dns_config(cfg, opts)
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::Tokio, QuicPhase<T>> {
pub fn with_dns_config(
Expand Down Expand Up @@ -263,13 +232,7 @@ macro_rules! impl_quic_phase_with_websocket {
}
}
}
impl_quic_phase_with_websocket!(
"async-std",
super::provider::AsyncStd,
rw_stream_sink::RwStreamSink<
libp2p_websocket::BytesConnection<libp2p_tcp::async_io::TcpStream>,
>
);

impl_quic_phase_with_websocket!(
"tokio",
super::provider::Tokio,
Expand Down
7 changes: 0 additions & 7 deletions libp2p/src/builder/phase/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,6 @@ macro_rules! impl_tcp_phase_with_websocket {
}
}
}
impl_tcp_phase_with_websocket!(
"async-std",
super::provider::AsyncStd,
rw_stream_sink::RwStreamSink<
libp2p_websocket::BytesConnection<libp2p_tcp::async_io::TcpStream>,
>
);
impl_tcp_phase_with_websocket!(
"tokio",
super::provider::Tokio,
Expand Down
10 changes: 0 additions & 10 deletions libp2p/src/builder/phase/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ macro_rules! impl_websocket_builder {
};
}

impl_websocket_builder!(
"async-std",
super::provider::AsyncStd,
libp2p_dns::async_std::Transport::system(libp2p_tcp::async_io::Transport::new(
libp2p_tcp::Config::default(),
)),
rw_stream_sink::RwStreamSink<
libp2p_websocket::BytesConnection<libp2p_tcp::async_io::TcpStream>,
>
);
impl_websocket_builder!(
"tokio",
super::provider::Tokio,
Expand Down
8 changes: 5 additions & 3 deletions transports/dns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
## 0.44.0

- Report all transport errors in a dial attempt instead of only returning the last error.

- Removed `async_std` module [PR 5959](https://github.com/libp2p/rust-libp2p/pull/5959)

- Report all transport errors in a dial attempt instead of only returning the last error.
See [PR 5899](https://github.com/libp2p/rust-libp2p/pull/5899).

## 0.43.0

- Upgrade `async-std-resolver` and `hickory-resolver`.
Expand Down
3 changes: 0 additions & 3 deletions transports/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
async-std-resolver = { workspace = true, features = ["system-config"], optional = true }
async-trait = "0.1.80"
futures = { workspace = true }
libp2p-core = { workspace = true }
Expand All @@ -24,11 +23,9 @@ tracing = { workspace = true }
[dev-dependencies]
libp2p-identity = { workspace = true, features = ["rand"] }
tokio = { workspace = true, features = ["rt", "time"] }
async-std-crate = { package = "async-std", version = "1.6" }
tracing-subscriber = { workspace = true, features = ["env-filter"] }

[features]
async-std = ["async-std-resolver"]
tokio = ["hickory-resolver/tokio-runtime"]

# Passing arguments to the docsrs builder in order to properly document cfg's.
Expand Down
Loading
Loading