Skip to content

chore(tcp): remove async_std support #5955

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

Merged
merged 35 commits into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d9d98ae
deprecate async_std support in TCP crate
gitToki Mar 25, 2025
d631545
tokio not default
gitToki Mar 25, 2025
1beb916
Merge branch 'master' into TCP
gitToki Mar 25, 2025
5147a19
Merge branch 'master' into TCP
gitToki Mar 26, 2025
e3a4271
Merge branch 'master' into TCP
jxs Apr 3, 2025
bbe06f2
Merge branch 'libp2p:master' into TCP
gitToki Apr 13, 2025
8218394
update tcp crate
Apr 13, 2025
f8e5843
update tcp crate
Apr 13, 2025
3bf2111
update lib rs
Apr 13, 2025
68856ee
re-update lib rs
Apr 13, 2025
314b972
update TCP crate
Apr 29, 2025
096b242
async ref in websocket toml
Apr 29, 2025
bee4d48
Merge branch 'master' into TCP
gitToki Jun 4, 2025
822c060
update test / cargo
Jun 4, 2025
0c7951e
changelog
Jun 4, 2025
09f8ede
update changelog
Jun 4, 2025
bb8d7fa
update changelog / swarm test version / test
Jun 4, 2025
1f6883c
fmt
Jun 4, 2025
79aec61
update test - swarm - changelog
Jun 5, 2025
2c2a167
update cargo websocket / fmt
Jun 5, 2025
61a1138
remove version bump and remove curly brackets
Jun 7, 2025
4b38073
undo websocket
Jun 7, 2025
8a9d2d2
libp2p websocket v
Jun 7, 2025
8f89e1e
Merge branch 'master' into TCP
gitToki Jun 10, 2025
8e79761
clippy
gitToki Jun 10, 2025
d01ed8b
revert dcutr version bump
gitToki Jun 10, 2025
0331be8
new ephemeral / update changelog
gitToki Jun 13, 2025
d5478e5
Merge branch 'master' of github.com:libp2p/rust-libp2p into TCP
jxs Jun 24, 2025
83029e4
update Cargo.lock
jxs Jun 24, 2025
16b8d21
address merge leftovers
jxs Jun 24, 2025
6db1a19
address merge leftovers
jxs Jun 24, 2025
110c1a3
address merge leftovers
jxs Jun 24, 2025
c0f1be7
do not set tokio as default
jxs Jun 24, 2025
e55318b
address merge leftovers
jxs Jun 24, 2025
4dfe37e
address merge leftovers
jxs Jun 24, 2025
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
83 changes: 1 addition & 82 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 @@ -105,7 +105,7 @@ libp2p-stream = { version = "0.3.0-alpha.1", path = "protocols/stream" }
libp2p-swarm = { version = "0.47.0", path = "swarm" }
libp2p-swarm-derive = { version = "=0.35.1", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required.
libp2p-swarm-test = { version = "0.6.0", path = "swarm-test" }
libp2p-tcp = { version = "0.43.0", path = "transports/tcp" }
libp2p-tcp = { version = "0.44.0", path = "transports/tcp" }
libp2p-tls = { version = "0.6.2", path = "transports/tls" }
libp2p-uds = { version = "0.42.0", path = "transports/uds" }
libp2p-upnp = { version = "0.4.1", path = "protocols/upnp" }
Expand Down
3 changes: 3 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- Make the `*-websys` variants (`libp2p-webrtc-websys`, `libp2p-websocket-websys`, `libp2p-webtransport-websys`) only available on wasm32 target architecture.
See [PR 5891](https://github.com/libp2p/rust-libp2p/pull/5891).

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

- 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)

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"]
async-std = ["libp2p-swarm/async-std"]
autonat = ["dep:libp2p-autonat"]
cbor = ["libp2p-request-response?/cbor"]
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
Expand Down
22 changes: 0 additions & 22 deletions libp2p/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,6 @@ mod tests {
.build();
}

#[test]
#[cfg(all(
feature = "async-std",
feature = "tcp",
feature = "tls",
feature = "noise",
feature = "yamux",
))]
fn async_std_tcp() {
let _ = SwarmBuilder::with_new_identity()
.with_async_std()
.with_tcp(
Default::default(),
libp2p_tls::Config::new,
libp2p_yamux::Config::default,
)
.unwrap()
.with_behaviour(|_| libp2p_swarm::dummy::Behaviour)
.unwrap()
.build();
}

#[test]
#[cfg(all(feature = "tokio", feature = "quic"))]
fn quic() {
Expand Down
1 change: 0 additions & 1 deletion libp2p/src/builder/phase/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ macro_rules! impl_tcp_builder {
};
}

impl_tcp_builder!("async-std", super::provider::AsyncStd, async_io);
impl_tcp_builder!("tokio", super::provider::Tokio, tokio);

impl<Provider> SwarmBuilder<Provider, TcpPhase> {
Expand Down
2 changes: 1 addition & 1 deletion muxers/mplex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ futures = { workspace = true }
libp2p-identity = { workspace = true, features = ["rand"] }
libp2p-muxer-test-harness = { path = "../test-harness" }
libp2p-plaintext = { workspace = true }
libp2p-tcp = { workspace = true, features = ["async-io"] }
libp2p-tcp = { workspace = true, features = ["tokio"] }
quickcheck = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }

Expand Down
2 changes: 1 addition & 1 deletion muxers/mplex/benches/split_send_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn tcp_transport(split_send_size: usize) -> BenchTransport {
let mut mplex = mplex::Config::default();
mplex.set_split_send_size(split_send_size);

libp2p_tcp::async_io::Transport::new(libp2p_tcp::Config::default().nodelay(true))
libp2p_tcp::tokio::Transport::new(libp2p_tcp::Config::default().nodelay(true))
.upgrade(upgrade::Version::V1)
.authenticate(plaintext::Config::new(
&identity::Keypair::generate_ed25519(),
Expand Down
2 changes: 1 addition & 1 deletion protocols/dcutr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ libp2p-plaintext = { workspace = true }
libp2p-relay = { workspace = true }
libp2p-swarm = { workspace = true, features = ["macros"] }
libp2p-swarm-test = { path = "../../swarm-test" }
libp2p-tcp = { workspace = true, features = ["async-io"] }
libp2p-tcp = { workspace = true, features = ["tokio"] }
libp2p-yamux = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tokio = { workspace = true, features = ["rt", "macros"] }
Expand Down
2 changes: 1 addition & 1 deletion protocols/dcutr/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn build_client() -> Swarm<Client> {

let transport = relay_transport
.or_transport(MemoryTransport::default())
.or_transport(libp2p_tcp::async_io::Transport::default())
.or_transport(libp2p_tcp::tokio::Transport::default())
.upgrade(Version::V1)
.authenticate(plaintext::Config::new(&local_key))
.multiplex(libp2p_yamux::Config::default())
Expand Down
5 changes: 5 additions & 0 deletions transports/tcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.44.0

- Remove `async-std` support.
See [PR 5955](https://github.com/libp2p/rust-libp2p/pull/5955)

## 0.43.0

- Fix the disabling of Nagle's algorithm, which requires setting `TCP_NODELAY` to _true_.
Expand Down
5 changes: 1 addition & 4 deletions transports/tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name = "libp2p-tcp"
edition.workspace = true
rust-version = { workspace = true }
description = "TCP/IP transport protocol for libp2p"
version = "0.43.0"
version = "0.44.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
async-io = { version = "2.3.3", optional = true }
futures = { workspace = true }
futures-timer = "3.0"
if-watch = { workspace = true }
Expand All @@ -23,10 +22,8 @@ tracing = { workspace = true }

[features]
tokio = ["dep:tokio", "if-watch/tokio"]
async-io = ["dep:async-io", "if-watch/smol"]

[dev-dependencies]
async-std = { version = "1.6.5", features = ["attributes"] }
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }

Expand Down
Loading
Loading