Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
20 changes: 1 addition & 19 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ libp2p-autonat = { version = "0.14.1", path = "protocols/autonat" }
libp2p-connection-limits = { version = "0.5.1", path = "misc/connection-limits" }
libp2p-core = { version = "0.43.1", path = "core" }
libp2p-dcutr = { version = "0.13.0", path = "protocols/dcutr" }
libp2p-dns = { version = "0.44.0", path = "transports/dns" }
libp2p-dns = { version = "0.45.0", path = "transports/dns" }
libp2p-floodsub = { version = "0.46.1", path = "protocols/floodsub" }
libp2p-gossipsub = { version = "0.49.0", path = "protocols/gossipsub" }
libp2p-identify = { version = "0.47.0", path = "protocols/identify" }
Expand Down
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
31 changes: 0 additions & 31 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
4 changes: 4 additions & 0 deletions transports/dns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.45.0

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

## 0.44.0

- Report all transport errors in a dial attempt instead of only returning the last error.
Expand Down
5 changes: 1 addition & 4 deletions transports/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name = "libp2p-dns"
edition.workspace = true
rust-version = { workspace = true }
description = "DNS transport implementation for libp2p"
version = "0.44.0"
version = "0.45.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
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