diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ad6c1e07b5..5c0448c85e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,10 +42,32 @@ # `libp2p` facade crate -## Version 0.41.1 [unreleased] +## Version 0.42.0 [unreleased] - Update individual crates. + - `libp2p-core` + - `libp2p-deflate` + - `libp2p-dns` + - `libp2p-floodsub` + - `libp2p-gossipsub` + - `libp2p-identify` + - `libp2p-kad` + - `libp2p-mdns` + - `libp2p-metrics` + - `libp2p-mplex` + - `libp2p-noise` + - `libp2p-ping` + - `libp2p-plaintext` + - `libp2p-relay` + - `libp2p-rendezvous` + - `libp2p-request-response` - `libp2p-swarm-derive` + - `libp2p-swarm` + - `libp2p-tcp` + - `libp2p-uds` + - `libp2p-wasm-ext` + - `libp2p-websocket` + - `libp2p-yamux` - `libp2p-mdns` (breaking compatibility with previous versions) ## Version 0.41.0 [2021-11-16] diff --git a/Cargo.toml b/Cargo.toml index dfb4c01b430..64f61ec3b0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p" edition = "2018" description = "Peer-to-peer networking library" -version = "0.41.1" +version = "0.42.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -71,25 +71,25 @@ futures-timer = "3.0.2" # Explicit dependency to be used in `wasm-bindgen` featu getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature lazy_static = "1.2" -libp2p-core = { version = "0.30.0", path = "core", default-features = false } -libp2p-floodsub = { version = "0.32.0", path = "protocols/floodsub", optional = true } +libp2p-core = { version = "0.31.0", path = "core", default-features = false } +libp2p-floodsub = { version = "0.33.0", path = "protocols/floodsub", optional = true } libp2p-gossipsub = { version = "0.35.0", path = "./protocols/gossipsub", optional = true } -libp2p-identify = { version = "0.32.0", path = "protocols/identify", optional = true } -libp2p-kad = { version = "0.33.0", path = "protocols/kad", optional = true } +libp2p-identify = { version = "0.33.0", path = "protocols/identify", optional = true } +libp2p-kad = { version = "0.34.0", path = "protocols/kad", optional = true } libp2p-metrics = { version = "0.3.0", path = "misc/metrics", optional = true } -libp2p-mplex = { version = "0.30.1", path = "muxers/mplex", optional = true } -libp2p-noise = { version = "0.33.0", path = "transports/noise", optional = true } -libp2p-ping = { version = "0.32.0", path = "protocols/ping", optional = true } -libp2p-plaintext = { version = "0.30.0", path = "transports/plaintext", optional = true } +libp2p-mplex = { version = "0.31.0", path = "muxers/mplex", optional = true } +libp2p-noise = { version = "0.34.0", path = "transports/noise", optional = true } +libp2p-ping = { version = "0.33.0", path = "protocols/ping", optional = true } +libp2p-plaintext = { version = "0.31.0", path = "transports/plaintext", optional = true } libp2p-pnet = { version = "0.22.0", path = "transports/pnet", optional = true } -libp2p-relay = { version = "0.5.0", path = "protocols/relay", optional = true } -libp2p-rendezvous = { version = "0.2.0", path = "protocols/rendezvous", optional = true } -libp2p-request-response = { version = "0.14.0", path = "protocols/request-response", optional = true } -libp2p-swarm = { version = "0.32.0", path = "swarm" } +libp2p-relay = { version = "0.6.0", path = "protocols/relay", optional = true } +libp2p-rendezvous = { version = "0.3.0", path = "protocols/rendezvous", optional = true } +libp2p-request-response = { version = "0.15.0", path = "protocols/request-response", optional = true } +libp2p-swarm = { version = "0.33.0", path = "swarm" } libp2p-swarm-derive = { version = "0.26.1", path = "swarm-derive" } libp2p-uds = { version = "0.30.0", path = "transports/uds", optional = true } -libp2p-wasm-ext = { version = "0.30.0", path = "transports/wasm-ext", default-features = false, optional = true } -libp2p-yamux = { version = "0.34.0", path = "muxers/yamux", optional = true } +libp2p-wasm-ext = { version = "0.31.0", path = "transports/wasm-ext", default-features = false, optional = true } +libp2p-yamux = { version = "0.35.0", path = "muxers/yamux", optional = true } multiaddr = { version = "0.13.0" } parking_lot = "0.11.0" pin-project = "1.0.0" @@ -97,11 +97,11 @@ rand = "0.7.3" # Explicit dependency to be used in `wasm-bindgen` feature smallvec = "1.6.1" [target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies] -libp2p-deflate = { version = "0.30.0", path = "transports/deflate", optional = true } -libp2p-dns = { version = "0.30.0", path = "transports/dns", optional = true, default-features = false } +libp2p-deflate = { version = "0.31.0", path = "transports/deflate", optional = true } +libp2p-dns = { version = "0.31.0", path = "transports/dns", optional = true, default-features = false } libp2p-mdns = { version = "0.34.0", path = "protocols/mdns", optional = true } -libp2p-tcp = { version = "0.30.0", path = "transports/tcp", default-features = false, optional = true } -libp2p-websocket = { version = "0.32.0", path = "transports/websocket", optional = true } +libp2p-tcp = { version = "0.31.0", path = "transports/tcp", default-features = false, optional = true } +libp2p-websocket = { version = "0.33.0", path = "transports/websocket", optional = true } [dev-dependencies] async-std = { version = "1.6.2", features = ["attributes"] } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index dae6e442b36..e57eb6d3bf2 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.31.0 [unreleased] + +- Report concrete connection IDs in `NetworkEvent::ConnectionEstablished` and + `NetworkEvent::ConnectionClosed` (see [PR 2350]). + +[PR 2350]: https://github.com/libp2p/rust-libp2p/pull/2350/ + # 0.30.1 [2021-11-16] - Use `instant` instead of `wasm-timer` (see [PR 2245]). diff --git a/core/Cargo.toml b/core/Cargo.toml index 8573f45cf7c..f34fb0c9b9e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-core" edition = "2018" description = "Core traits and structs of libp2p" -version = "0.30.1" +version = "0.31.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/core/src/connection/pool.rs b/core/src/connection/pool.rs index 163da2178f6..59d41908f3a 100644 --- a/core/src/connection/pool.rs +++ b/core/src/connection/pool.rs @@ -45,7 +45,7 @@ use std::{ collections::{hash_map, HashMap}, convert::TryFrom as _, fmt, - num::{NonZeroU32, NonZeroU8}, + num::NonZeroU8, pin::Pin, task::Context, task::Poll, @@ -156,7 +156,10 @@ where /// A new connection has been established. ConnectionEstablished { connection: EstablishedConnection<'a, THandlerInEvent>, - num_established: NonZeroU32, + /// List of other connections to the same peer. + /// + /// Note: Does not include the connection reported through this event. + other_established_connection_ids: Vec, /// [`Some`] when the new connection is an outgoing connection. /// Addresses are dialed in parallel. Contains the addresses and errors /// of dial attempts that failed before the one successful dial. @@ -183,8 +186,8 @@ where error: Option>>, /// A reference to the pool that used to manage the connection. pool: &'a mut Pool, - /// The remaining number of established connections to the same peer. - num_established: u32, + /// The remaining established connections to the same peer. + remaining_established_connection_ids: Vec, handler: THandler::Handler, }, @@ -693,15 +696,16 @@ where let EstablishedConnectionInfo { endpoint, .. } = connections.remove(&id).expect("Connection to be present"); self.counters.dec_established(&endpoint); - let num_established = u32::try_from(connections.len()).unwrap(); - if num_established == 0 { + let remaining_established_connection_ids: Vec = + connections.keys().cloned().collect(); + if remaining_established_connection_ids.is_empty() { self.established.remove(&peer_id); } return Poll::Ready(PoolEvent::ConnectionClosed { id, connected: Connected { endpoint, peer_id }, error, - num_established, + remaining_established_connection_ids, pool: self, handler, }); @@ -849,8 +853,7 @@ where // Add the connection to the pool. let conns = self.established.entry(peer_id).or_default(); - let num_established = NonZeroU32::new(u32::try_from(conns.len() + 1).unwrap()) - .expect("n + 1 is always non-zero; qed"); + let other_established_connection_ids = conns.keys().cloned().collect(); self.counters.inc_established(&endpoint); let (command_sender, command_receiver) = @@ -883,7 +886,7 @@ where Some(PoolConnection::Established(connection)) => { return Poll::Ready(PoolEvent::ConnectionEstablished { connection, - num_established, + other_established_connection_ids, concurrent_dial_errors, }) } diff --git a/core/src/network.rs b/core/src/network.rs index 3478680bc02..00946bc96c0 100644 --- a/core/src/network.rs +++ b/core/src/network.rs @@ -396,11 +396,11 @@ where Poll::Pending => return Poll::Pending, Poll::Ready(PoolEvent::ConnectionEstablished { connection, - num_established, + other_established_connection_ids, concurrent_dial_errors, }) => NetworkEvent::ConnectionEstablished { connection, - num_established, + other_established_connection_ids, concurrent_dial_errors, }, Poll::Ready(PoolEvent::PendingOutboundConnectionError { @@ -435,13 +435,13 @@ where id, connected, error, - num_established, + remaining_established_connection_ids, handler, .. }) => NetworkEvent::ConnectionClosed { id, connected, - num_established, + remaining_established_connection_ids, error, handler, }, diff --git a/core/src/network/event.rs b/core/src/network/event.rs index 6e016e82159..b70cef8a888 100644 --- a/core/src/network/event.rs +++ b/core/src/network/event.rs @@ -29,7 +29,7 @@ use crate::{ transport::{Transport, TransportError}, Multiaddr, PeerId, }; -use std::{fmt, num::NonZeroU32}; +use std::fmt; /// Event that can happen on the `Network`. pub enum NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler> @@ -100,9 +100,10 @@ where ConnectionEstablished { /// The newly established connection. connection: EstablishedConnection<'a, TInEvent>, - /// The total number of established connections to the same peer, - /// including the one that has just been opened. - num_established: NonZeroU32, + /// List of other connections to the same peer. + /// + /// Note: Does not include the connection reported through this event. + other_established_connection_ids: Vec, /// [`Some`] when the new connection is an outgoing connection. /// Addresses are dialed in parallel. Contains the addresses and errors /// of dial attempts that failed before the one successful dial. @@ -128,8 +129,8 @@ where connected: Connected, /// The error that occurred. error: Option::Error>>, - /// The remaining number of established connections to the same peer. - num_established: u32, + /// List of remaining established connections to the same peer. + remaining_established_connection_ids: Vec, handler: THandler::Handler, }, diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index 50fe25e1e38..7bf3e0abda8 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -16,12 +16,12 @@ kad = ["libp2p-kad"] ping = ["libp2p-ping"] [dependencies] -libp2p-core = { version = "0.30.0", path = "../../core" } +libp2p-core = { version = "0.31.0", path = "../../core" } libp2p-gossipsub = { version = "0.35.0", path = "../../protocols/gossipsub", optional = true } -libp2p-identify = { version = "0.32.0", path = "../../protocols/identify", optional = true } -libp2p-kad = { version = "0.33.0", path = "../../protocols/kad", optional = true } -libp2p-ping = { version = "0.32.0", path = "../../protocols/ping", optional = true } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-identify = { version = "0.33.0", path = "../../protocols/identify", optional = true } +libp2p-kad = { version = "0.34.0", path = "../../protocols/kad", optional = true } +libp2p-ping = { version = "0.33.0", path = "../../protocols/ping", optional = true } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } open-metrics-client = "0.13.0" [dev-dependencies] diff --git a/misc/peer-id-generator/Cargo.toml b/misc/peer-id-generator/Cargo.toml index da1cad6ba91..beeefc2755b 100644 --- a/misc/peer-id-generator/Cargo.toml +++ b/misc/peer-id-generator/Cargo.toml @@ -11,5 +11,5 @@ categories = ["network-programming", "asynchronous"] publish = false [dependencies] -libp2p-core = { path = "../../core", default-features = false } +libp2p-core = { path = "../../core", default-features = false, version = "0.31.0"} num_cpus = "1.8" diff --git a/muxers/mplex/CHANGELOG.md b/muxers/mplex/CHANGELOG.md index 90788596223..f38d4c0132d 100644 --- a/muxers/mplex/CHANGELOG.md +++ b/muxers/mplex/CHANGELOG.md @@ -1,4 +1,6 @@ -# 0.30.1 [unreleased] +# 0.31.0 [unreleased] + +- Update dependencies. - Add `fn set_protocol_name(&mut self, protocol_name: &'static [u8])` to MplexConfig diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index 06462ae736d..92a57173051 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-mplex" edition = "2018" description = "Mplex multiplexing protocol for libp2p" -version = "0.30.1" +version = "0.31.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] bytes = "1" futures = "0.3.1" asynchronous-codec = "0.6" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4" nohash-hasher = "0.2" parking_lot = "0.11" diff --git a/muxers/yamux/CHANGELOG.md b/muxers/yamux/CHANGELOG.md index 671b6082327..3f0198f2f30 100644 --- a/muxers/yamux/CHANGELOG.md +++ b/muxers/yamux/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.35.0 [unreleased] + +- Update dependencies. + # 0.34.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index c9984b6514a..cf23cb0b6b1 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-yamux" edition = "2018" description = "Yamux multiplexing protocol for libp2p" -version = "0.34.0" +version = "0.35.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,7 +11,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } parking_lot = "0.11" thiserror = "1.0" yamux = "0.9.0" diff --git a/protocols/floodsub/CHANGELOG.md b/protocols/floodsub/CHANGELOG.md index a183efb88fc..b36a8527743 100644 --- a/protocols/floodsub/CHANGELOG.md +++ b/protocols/floodsub/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.33.0 [unreleased] + +- Update dependencies. + # 0.32.0 [2021-11-16] - Update dependencies. diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index 1679e6133d5..17452c165c7 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-floodsub" edition = "2018" description = "Floodsub protocol for libp2p" -version = "0.32.0" +version = "0.33.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,8 +13,8 @@ categories = ["network-programming", "asynchronous"] cuckoofilter = "0.5.0" fnv = "1.0" futures = "0.3.1" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } log = "0.4" prost = "0.9" rand = "0.7" diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 9eaa5dd6525..f4e17ab9d08 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -10,8 +10,8 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } bytes = "1.0" byteorder = "1.3.4" fnv = "1.0.7" diff --git a/protocols/identify/CHANGELOG.md b/protocols/identify/CHANGELOG.md index a70f7de677f..4cf2f32838d 100644 --- a/protocols/identify/CHANGELOG.md +++ b/protocols/identify/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.33.0 [unreleased] + +- Update dependencies. + # 0.32.0 [2021-11-16] - Use `futures-timer` instead of `wasm-timer` (see [PR 2245]). diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index 53bca1ff489..47cc25fc1f4 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-identify" edition = "2018" description = "Nodes identifcation protocol for libp2p" -version = "0.32.0" +version = "0.33.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,8 +12,8 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" futures-timer = "3.0.2" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } log = "0.4.1" lru = "0.6" prost = "0.9" diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index eae7f458f60..1d234eb005b 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.34.0 [unreleased] + +- Update dependencies. + # 0.33.0 [2021-11-16] - Use `instant` and `futures-timer` instead of `wasm-timer` (see [PR 2245]). diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 76b4084eb4d..ad3e63040d1 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-kad" edition = "2018" description = "Kademlia protocol for libp2p" -version = "0.33.0" +version = "0.34.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -17,8 +17,8 @@ fnv = "1.0" asynchronous-codec = "0.6" futures = "0.3.1" log = "0.4" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } prost = "0.9" rand = "0.7.2" sha2 = "0.9.1" diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index 4ea91394762..2d3bd922f6b 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -1,5 +1,7 @@ # 0.34.0 [unreleased] +- Update dependencies. + - Use a random alphanumeric string instead of the local peer ID for mDNS peer name (see [PR 2311]). diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 44781bc5be1..d0fc168e770 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -16,8 +16,8 @@ dns-parser = "0.8.0" futures = "0.3.13" if-watch = "0.2.0" lazy_static = "1.4.0" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } log = "0.4.14" rand = "0.8.3" smallvec = "1.6.1" diff --git a/protocols/ping/CHANGELOG.md b/protocols/ping/CHANGELOG.md index be04a22d33e..a951a64db92 100644 --- a/protocols/ping/CHANGELOG.md +++ b/protocols/ping/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.33.0 [unreleased] + +- Update dependencies. + # 0.32.0 [2021-11-16] - Use `instant` and `futures-timer` instead of `wasm-timer` (see [PR 2245]). diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 4bbd70f9324..6d9d09bb7d6 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-ping" edition = "2018" description = "Ping protocol for libp2p" -version = "0.32.0" +version = "0.33.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,8 +13,8 @@ categories = ["network-programming", "asynchronous"] futures = "0.3.1" futures-timer = "3.0.2" instant = "0.1.11" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } log = "0.4.1" rand = "0.7.2" void = "1.0" diff --git a/protocols/relay/CHANGELOG.md b/protocols/relay/CHANGELOG.md index 8e3f9f082cf..b3c086acafc 100644 --- a/protocols/relay/CHANGELOG.md +++ b/protocols/relay/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.6.0 [unreleased] + +- Update dependencies. + # 0.5.0 [2021-11-16] - Use `instant` instead of `wasm-timer` (see [PR 2245]). diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index d9d618a61e2..870f044d23d 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-relay" edition = "2018" description = "Communications relaying for libp2p" -version = "0.5.0" +version = "0.6.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -15,8 +15,8 @@ bytes = "1" futures = "0.3.1" futures-timer = "3" instant = "0.1.11" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } log = "0.4" pin-project = "1" prost = "0.9" diff --git a/protocols/rendezvous/CHANGELOG.md b/protocols/rendezvous/CHANGELOG.md index f8cb7da2120..b8f06f479f6 100644 --- a/protocols/rendezvous/CHANGELOG.md +++ b/protocols/rendezvous/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.3.0 [unreleased] + +- Update dependencies. + # 0.2.0 [2021-11-16] - Use `instant` and `futures-timer` instead of `wasm-timer` (see [PR 2245]). diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index c0cba9cd709..6bce91b651f 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-rendezvous" edition = "2018" description = "Rendezvous protocol for libp2p" -version = "0.2.0" +version = "0.3.0" authors = ["The COMIT guys "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,8 +11,8 @@ categories = ["network-programming", "asynchronous"] [dependencies] asynchronous-codec = "0.6" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } prost = "0.9" void = "1" log = "0.4" diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index 447ca8c2dbc..932079d1447 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.15.0 [unreleased] + +- Update dependencies. + # 0.14.0 [2021-11-16] - Use `instant` instead of `wasm-timer` (see [PR 2245]). diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index 9d18836fd91..6579c20dbc4 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-request-response" edition = "2018" description = "Generic Request/Response Protocols" -version = "0.14.0" +version = "0.15.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,8 +14,8 @@ async-trait = "0.1" bytes = "1" futures = "0.3.1" instant = "0.1.11" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } -libp2p-swarm = { version = "0.32.0", path = "../../swarm" } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } +libp2p-swarm = { version = "0.33.0", path = "../../swarm" } log = "0.4.11" lru = "0.7" rand = "0.7" diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 5835e8a6e33..03c6a1a1708 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.33.0 [unreleased] + +- Patch reporting on banned peers and their non-banned and banned connections (see [PR 2350]). + +- Update dependencies. + +[PR 2350]: https://github.com/libp2p/rust-libp2p/pull/2350 + # 0.32.0 [2021-11-16] - Use `instant` and `futures-timer` instead of `wasm-timer` (see [PR 2245]). diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index 2c5da850070..a1d1116126d 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-swarm" edition = "2018" description = "The libp2p swarm" -version = "0.32.0" +version = "0.33.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] either = "1.6.0" futures = "0.3.1" -libp2p-core = { version = "0.30.0", path = "../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../core", default-features = false } log = "0.4" rand = "0.7" smallvec = "1.6.1" diff --git a/swarm/src/lib.rs b/swarm/src/lib.rs index 0059a21a0cb..c28bcee9dc4 100644 --- a/swarm/src/lib.rs +++ b/swarm/src/lib.rs @@ -97,6 +97,7 @@ use smallvec::SmallVec; use std::collections::HashSet; use std::num::{NonZeroU32, NonZeroU8, NonZeroUsize}; use std::{ + convert::TryFrom, error, fmt, io, pin::Pin, task::{Context, Poll}, @@ -275,6 +276,12 @@ where /// List of nodes for which we deny any incoming connection. banned_peers: HashSet, + /// Connections for which we withhold any reporting. These belong to banned peers. + /// + /// Note: Connections to a peer that are established at the time of banning that peer + /// are not added here. Instead they are simply closed. + banned_peer_connections: HashSet, + /// Pending event to be delivered to connection handlers /// (or dropped if the peer disconnected) before the `behaviour` /// can be polled again. @@ -540,6 +547,10 @@ where pub fn ban_peer_id(&mut self, peer_id: PeerId) { if self.banned_peers.insert(peer_id) { if let Some(peer) = self.network.peer(peer_id).into_connected() { + // Note that established connections to the now banned peer are closed but not + // added to [`Swarm::banned_peer_connections`]. They have been previously reported + // as open to the behaviour and need be reported as closed once closing the + // connection finishes. peer.disconnect(); } } @@ -603,8 +614,12 @@ where Poll::Pending => network_not_ready = true, Poll::Ready(NetworkEvent::ConnectionEvent { connection, event }) => { let peer = connection.peer_id(); - let connection = connection.id(); - this.behaviour.inject_event(peer, connection, event); + let conn_id = connection.id(); + if this.banned_peer_connections.contains(&conn_id) { + log::debug!("Ignoring event from banned peer: {} {:?}.", peer, conn_id); + } else { + this.behaviour.inject_event(peer, conn_id, event); + } } Poll::Ready(NetworkEvent::AddressChange { connection, @@ -612,22 +627,27 @@ where old_endpoint, }) => { let peer = connection.peer_id(); - let connection = connection.id(); - this.behaviour.inject_address_change( - &peer, - &connection, - &old_endpoint, - &new_endpoint, - ); + let conn_id = connection.id(); + if !this.banned_peer_connections.contains(&conn_id) { + this.behaviour.inject_address_change( + &peer, + &conn_id, + &old_endpoint, + &new_endpoint, + ); + } } Poll::Ready(NetworkEvent::ConnectionEstablished { connection, - num_established, + other_established_connection_ids, concurrent_dial_errors, }) => { let peer_id = connection.peer_id(); let endpoint = connection.endpoint().clone(); if this.banned_peers.contains(&peer_id) { + // Mark the connection for the banned peer as banned, thus withholding any + // future events from the connection to the behaviour. + this.banned_peer_connections.insert(connection.id()); this.network .peer(peer_id) .into_connected() @@ -635,6 +655,11 @@ where .disconnect(); return Poll::Ready(SwarmEvent::BannedPeer { peer_id, endpoint }); } else { + let num_established = NonZeroU32::new( + u32::try_from(other_established_connection_ids.len() + 1).unwrap(), + ) + .expect("n + 1 is always non-zero; qed"); + log::debug!( "Connection established: {:?} {:?}; Total (peer): {}.", connection.peer_id(), @@ -651,7 +676,13 @@ where &endpoint, failed_addresses.as_ref(), ); - if num_established.get() == 1 { + // The peer is not banned, but there could be previous banned connections + // if the peer was just unbanned. Check if this is the first non-banned + // connection. + let first_non_banned = other_established_connection_ids + .into_iter() + .all(|conn_id| this.banned_peer_connections.contains(&conn_id)); + if first_non_banned { this.behaviour.inject_connected(&peer_id); } return Poll::Ready(SwarmEvent::ConnectionEstablished { @@ -666,7 +697,7 @@ where id, connected, error, - num_established, + remaining_established_connection_ids, handler, }) => { if let Some(error) = error.as_ref() { @@ -676,14 +707,26 @@ where } let peer_id = connected.peer_id; let endpoint = connected.endpoint; - this.behaviour.inject_connection_closed( - &peer_id, - &id, - &endpoint, - handler.into_protocols_handler(), - ); - if num_established == 0 { - this.behaviour.inject_disconnected(&peer_id); + let num_established = + u32::try_from(remaining_established_connection_ids.len()).unwrap(); + let conn_was_reported = !this.banned_peer_connections.remove(&id); + if conn_was_reported { + this.behaviour.inject_connection_closed( + &peer_id, + &id, + &endpoint, + handler.into_protocols_handler(), + ); + + // This connection was reported as open to the behaviour. Check if this is + // the last non-banned connection for the peer. + let last_non_banned = remaining_established_connection_ids + .into_iter() + .all(|conn_id| this.banned_peer_connections.contains(&conn_id)); + + if last_non_banned { + this.behaviour.inject_disconnected(&peer_id) + } } return Poll::Ready(SwarmEvent::ConnectionClosed { peer_id, @@ -1253,6 +1296,7 @@ where listened_addrs: SmallVec::new(), external_addrs: Addresses::default(), banned_peers: HashSet::new(), + banned_peer_connections: HashSet::new(), pending_event: None, substream_upgrade_protocol_override: self.substream_upgrade_protocol_override, } @@ -1450,15 +1494,6 @@ mod tests { TBehaviour: NetworkBehaviour, <::Handler as ProtocolsHandler>::OutEvent: Clone, { - for s in &[swarm1, swarm2] { - if s.behaviour.inject_connection_established.len() > 0 { - assert_eq!(s.behaviour.inject_connected.len(), 1); - } else { - assert_eq!(s.behaviour.inject_connected.len(), 0); - } - assert!(s.behaviour.inject_connection_closed.is_empty()); - assert!(s.behaviour.inject_disconnected.is_empty()); - } [swarm1, swarm2] .iter() .all(|s| s.behaviour.inject_connection_established.len() == num_connections) @@ -1473,10 +1508,6 @@ mod tests { TBehaviour: NetworkBehaviour, <::Handler as ProtocolsHandler>::OutEvent: Clone { - for s in &[swarm1, swarm2] { - assert_eq!(s.behaviour.inject_connection_established.len(), 0); - assert_eq!(s.behaviour.inject_connected.len(), 0); - } [swarm1, swarm2] .iter() .all(|s| s.behaviour.inject_connection_closed.len() == num_connections) @@ -1490,7 +1521,12 @@ mod tests { /// /// The test expects both behaviours to be notified via pairs of /// inject_connected / inject_disconnected as well as - /// inject_connection_established / inject_connection_closed calls. + /// inject_connection_established / inject_connection_closed calls + /// while unbanned. + /// + /// While the ban is in effect, further dials occur. For these connections no + /// `inject_connected`, `inject_connection_established`, `inject_disconnected`, + /// `inject_connection_closed` calls should be registered. #[test] fn test_connect_disconnect_ban() { // Since the test does not try to open any substreams, we can @@ -1505,59 +1541,103 @@ mod tests { let addr1: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); let addr2: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); - swarm1.listen_on(addr1.clone().into()).unwrap(); - swarm2.listen_on(addr2.clone().into()).unwrap(); + swarm1.listen_on(addr1.clone()).unwrap(); + swarm2.listen_on(addr2.clone()).unwrap(); let swarm1_id = *swarm1.local_peer_id(); - let mut banned = false; - let mut unbanned = false; + enum Stage { + /// Waiting for the peers to connect. Banning has not occurred. + Connecting, + /// Ban occurred. + Banned, + // Ban is in place and a dial is ongoing. + BannedDial, + // Mid-ban dial was registered and the peer was unbanned. + Unbanned, + // There are dial attempts ongoing for the no longer banned peers. + Reconnecting, + } let num_connections = 10; for _ in 0..num_connections { swarm1.dial(addr2.clone()).unwrap(); } - let mut state = State::Connecting; - executor::block_on(future::poll_fn(move |cx| { - loop { - let poll1 = Swarm::poll_next_event(Pin::new(&mut swarm1), cx); - let poll2 = Swarm::poll_next_event(Pin::new(&mut swarm2), cx); - match state { - State::Connecting => { - if swarms_connected(&swarm1, &swarm2, num_connections) { - if banned { - return Poll::Ready(()); - } - swarm2.ban_peer_id(swarm1_id.clone()); - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); - banned = true; - state = State::Disconnecting; - } + let mut s1_expected_conns = num_connections; + let mut s2_expected_conns = num_connections; + + let mut stage = Stage::Connecting; + + executor::block_on(future::poll_fn(move |cx| loop { + let poll1 = Swarm::poll_next_event(Pin::new(&mut swarm1), cx); + let poll2 = Swarm::poll_next_event(Pin::new(&mut swarm2), cx); + match stage { + Stage::Connecting => { + if swarm1.behaviour.assert_connected(s1_expected_conns, 1) + && swarm2.behaviour.assert_connected(s2_expected_conns, 1) + { + // Setup to test that already established connections are correctly closed + // and reported as such after the peer is banned. + swarm2.ban_peer_id(swarm1_id); + stage = Stage::Banned; } - State::Disconnecting => { - if swarms_disconnected(&swarm1, &swarm2, num_connections) { - if unbanned { - return Poll::Ready(()); - } - // Unban the first peer and reconnect. - swarm2.unban_peer_id(swarm1_id.clone()); - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); - unbanned = true; - for _ in 0..num_connections { - swarm2.dial(addr1.clone()).unwrap(); - } - state = State::Connecting; - } + } + Stage::Banned => { + if swarm1.behaviour.assert_disconnected(s1_expected_conns, 1) + && swarm2.behaviour.assert_disconnected(s2_expected_conns, 1) + { + // Setup to test that new connections of banned peers are not reported. + swarm1.dial(addr2.clone()).unwrap(); + s1_expected_conns += 1; + stage = Stage::BannedDial; } } + Stage::BannedDial => { + if swarm2.network_info().num_peers() == 1 { + // The banned connection was established. Check that it was not reported to + // the behaviour of the banning swarm. + assert_eq!( + swarm2.behaviour.inject_connection_established.len(), s2_expected_conns, + "No additional closed connections should be reported for the banned peer" + ); - if poll1.is_pending() && poll2.is_pending() { - return Poll::Pending; + // Setup to test that the banned connection is not reported upon closing + // even if the peer is unbanned. + swarm2.unban_peer_id(swarm1_id); + stage = Stage::Unbanned; + } } + Stage::Unbanned => { + if swarm2.network_info().num_peers() == 0 { + // The banned connection has closed. Check that it was not reported. + assert_eq!( + swarm2.behaviour.inject_connection_closed.len(), s2_expected_conns, + "No additional closed connections should be reported for the banned peer" + ); + assert!(swarm2.banned_peer_connections.is_empty()); + + // Setup to test that a ban lifted does not affect future connections. + for _ in 0..num_connections { + swarm1.dial(addr2.clone()).unwrap(); + } + s1_expected_conns += num_connections; + s2_expected_conns += num_connections; + stage = Stage::Reconnecting; + } + } + Stage::Reconnecting => { + if swarm1.behaviour.inject_connection_established.len() == s1_expected_conns + && swarm2.behaviour.assert_connected(s2_expected_conns, 2) + { + return Poll::Ready(()); + } + } + } + + if poll1.is_pending() && poll2.is_pending() { + return Poll::Pending; } })) } @@ -1582,8 +1662,8 @@ mod tests { let addr1: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); let addr2: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); - swarm1.listen_on(addr1.clone().into()).unwrap(); - swarm2.listen_on(addr2.clone().into()).unwrap(); + swarm1.listen_on(addr1.clone()).unwrap(); + swarm2.listen_on(addr2.clone()).unwrap(); let swarm1_id = *swarm1.local_peer_id(); @@ -1605,10 +1685,8 @@ mod tests { return Poll::Ready(()); } swarm2 - .disconnect_peer_id(swarm1_id.clone()) + .disconnect_peer_id(swarm1_id) .expect("Error disconnecting"); - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); state = State::Disconnecting; } } @@ -1618,8 +1696,6 @@ mod tests { return Poll::Ready(()); } reconnected = true; - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); for _ in 0..num_connections { swarm2.dial(addr1.clone()).unwrap(); } @@ -1655,8 +1731,8 @@ mod tests { let addr1: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); let addr2: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); - swarm1.listen_on(addr1.clone().into()).unwrap(); - swarm2.listen_on(addr2.clone().into()).unwrap(); + swarm1.listen_on(addr1.clone()).unwrap(); + swarm2.listen_on(addr2.clone()).unwrap(); let swarm1_id = *swarm1.local_peer_id(); @@ -1679,12 +1755,10 @@ mod tests { } swarm2.behaviour.inner().next_action.replace( NetworkBehaviourAction::CloseConnection { - peer_id: swarm1_id.clone(), + peer_id: swarm1_id, connection: CloseConnection::All, }, ); - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); state = State::Disconnecting; } } @@ -1694,8 +1768,6 @@ mod tests { return Poll::Ready(()); } reconnected = true; - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); for _ in 0..num_connections { swarm2.dial(addr1.clone()).unwrap(); } @@ -1731,8 +1803,8 @@ mod tests { let addr1: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); let addr2: Multiaddr = multiaddr::Protocol::Memory(rand::random::()).into(); - swarm1.listen_on(addr1.clone().into()).unwrap(); - swarm2.listen_on(addr2.clone().into()).unwrap(); + swarm1.listen_on(addr1.clone()).unwrap(); + swarm2.listen_on(addr2.clone()).unwrap(); let swarm1_id = *swarm1.local_peer_id(); @@ -1756,22 +1828,23 @@ mod tests { .1; swarm2.behaviour.inner().next_action.replace( NetworkBehaviourAction::CloseConnection { - peer_id: swarm1_id.clone(), + peer_id: swarm1_id, connection: CloseConnection::One(conn_id), }, ); Some(conn_id) }; - swarm1.behaviour.reset(); - swarm2.behaviour.reset(); state = State::Disconnecting; } } State::Disconnecting => { for s in &[&swarm1, &swarm2] { assert_eq!(s.behaviour.inject_disconnected.len(), 0); - assert_eq!(s.behaviour.inject_connection_established.len(), 0); - assert_eq!(s.behaviour.inject_connected.len(), 0); + assert_eq!( + s.behaviour.inject_connection_established.len(), + num_connections + ); + assert_eq!(s.behaviour.inject_connected.len(), 1); } if [&swarm1, &swarm2] .iter() diff --git a/swarm/src/test.rs b/swarm/src/test.rs index 54a806ca6d2..22f7a51fa9b 100644 --- a/swarm/src/test.rs +++ b/swarm/src/test.rs @@ -91,7 +91,7 @@ where /// A `CallTraceBehaviour` is a `NetworkBehaviour` that tracks /// invocations of callback methods and their arguments, wrapping -/// around an inner behaviour. +/// around an inner behaviour. It ensures certain invariants are met. pub struct CallTraceBehaviour where TInner: NetworkBehaviour, @@ -144,6 +144,7 @@ where } } + #[allow(dead_code)] pub fn reset(&mut self) { self.addresses_of_peer = Vec::new(); self.inject_connected = Vec::new(); @@ -163,6 +164,40 @@ where pub fn inner(&mut self) -> &mut TInner { &mut self.inner } + + /// Checks that when the expected number of closed connection notifications are received, a + /// given number of expected disconnections have been received as well. + /// + /// Returns if the first condition is met. + pub fn assert_disconnected( + &self, + expected_closed_connections: usize, + expected_disconnections: usize, + ) -> bool { + if self.inject_connection_closed.len() == expected_closed_connections { + assert_eq!(self.inject_disconnected.len(), expected_disconnections); + return true; + } + + false + } + + /// Checks that when the expected number of established connection notifications are received, + /// a given number of expected connections have been received as well. + /// + /// Returns if the first condition is met. + pub fn assert_connected( + &self, + expected_established_connections: usize, + expected_connections: usize, + ) -> bool { + if self.inject_connection_established.len() == expected_established_connections { + assert_eq!(self.inject_connected.len(), expected_connections); + return true; + } + + false + } } impl NetworkBehaviour for CallTraceBehaviour @@ -184,6 +219,12 @@ where } fn inject_connected(&mut self, peer: &PeerId) { + assert!( + self.inject_connection_established + .iter() + .any(|(peer_id, _, _)| peer_id == peer), + "`inject_connected` is called after at least one `inject_connection_established`." + ); self.inject_connected.push(peer.clone()); self.inner.inject_connected(peer); } @@ -201,7 +242,13 @@ where } fn inject_disconnected(&mut self, peer: &PeerId) { - self.inject_disconnected.push(peer.clone()); + assert!( + self.inject_connection_closed + .iter() + .any(|(peer_id, _, _)| peer_id == peer), + "`inject_disconnected` is called after at least one `inject_connection_closed`." + ); + self.inject_disconnected.push(*peer); self.inner.inject_disconnected(peer); } @@ -212,8 +259,13 @@ where e: &ConnectedPoint, handler: ::Handler, ) { - self.inject_connection_closed - .push((p.clone(), c.clone(), e.clone())); + let connection = (p.clone(), c.clone(), e.clone()); + assert!( + self.inject_connection_established.contains(&connection), + "`inject_connection_closed` is called only for connections for \ + which `inject_connection_established` was called first." + ); + self.inject_connection_closed.push(connection); self.inner.inject_connection_closed(p, c, e, handler); } @@ -223,6 +275,20 @@ where c: ConnectionId, e: <::Handler as ProtocolsHandler>::OutEvent, ) { + assert!( + self.inject_connection_established + .iter() + .any(|(peer_id, conn_id, _)| *peer_id == p && c == *conn_id), + "`inject_event` is called for reported connections." + ); + assert!( + !self + .inject_connection_closed + .iter() + .any(|(peer_id, conn_id, _)| *peer_id == p && c == *conn_id), + "`inject_event` is never called for closed connections." + ); + self.inject_event.push((p.clone(), c.clone(), e.clone())); self.inner.inject_event(p, c, e); } diff --git a/transports/deflate/CHANGELOG.md b/transports/deflate/CHANGELOG.md index b97c911c11c..21fcf062c20 100644 --- a/transports/deflate/CHANGELOG.md +++ b/transports/deflate/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.31.0 [unreleased] + +- Update dependencies. + # 0.30.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/transports/deflate/Cargo.toml b/transports/deflate/Cargo.toml index 3ce579f0dea..089eca9d66d 100644 --- a/transports/deflate/Cargo.toml +++ b/transports/deflate/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-deflate" edition = "2018" description = "Deflate encryption protocol for libp2p" -version = "0.30.0" +version = "0.31.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,7 +11,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } flate2 = "1.0" [dev-dependencies] diff --git a/transports/dns/CHANGELOG.md b/transports/dns/CHANGELOG.md index 08cd3384be0..32e4ef04ca7 100644 --- a/transports/dns/CHANGELOG.md +++ b/transports/dns/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.31.0 [unreleased] + +- Update dependencies. + # 0.30.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index 51c9a8fadd1..baea5316795 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-dns" edition = "2018" description = "DNS transport implementation for libp2p" -version = "0.30.0" +version = "0.31.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -10,7 +10,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4.1" futures = "0.3.1" trust-dns-resolver = { version = "0.20", default-features = false, features = ["system-config"] } diff --git a/transports/noise/CHANGELOG.md b/transports/noise/CHANGELOG.md index cde71a82e46..90729470e87 100644 --- a/transports/noise/CHANGELOG.md +++ b/transports/noise/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.34.0 [unreleased] + +- Update dependencies. + # 0.33.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 680902427d2..9c22752aa4d 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-noise" description = "Cryptographic handshake protocol using the noise framework." -version = "0.33.0" +version = "0.34.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,7 +12,7 @@ bytes = "1" curve25519-dalek = "3.0.0" futures = "0.3.1" lazy_static = "1.2" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4" prost = "0.9" rand = "0.8.3" diff --git a/transports/plaintext/CHANGELOG.md b/transports/plaintext/CHANGELOG.md index 56c8e4c2663..2ce6e439642 100644 --- a/transports/plaintext/CHANGELOG.md +++ b/transports/plaintext/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.31.0 [unreleased] + +- Update dependencies. + # 0.30.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index f09c60b607c..7e3d386a20a 100644 --- a/transports/plaintext/Cargo.toml +++ b/transports/plaintext/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-plaintext" edition = "2018" description = "Plaintext encryption dummy protocol for libp2p" -version = "0.30.0" +version = "0.31.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] bytes = "1" futures = "0.3.1" asynchronous-codec = "0.6" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4.8" prost = "0.9" unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } diff --git a/transports/tcp/CHANGELOG.md b/transports/tcp/CHANGELOG.md index aa04e30aa40..d091a39f0fb 100644 --- a/transports/tcp/CHANGELOG.md +++ b/transports/tcp/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.31.0 [unreleased] + +- Update dependencies. + # 0.30.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 7e56026a628..1970e21478e 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-tcp" edition = "2018" description = "TCP/IP transport protocol for libp2p" -version = "0.30.0" +version = "0.31.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -17,7 +17,7 @@ if-watch = { version = "0.2.0", optional = true } if-addrs = { version = "0.6.4", optional = true } ipnet = "2.0.0" libc = "0.2.80" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4.11" socket2 = { version = "0.4.0", features = ["all"] } tokio-crate = { package = "tokio", version = "1.0.1", default-features = false, features = ["net"], optional = true } diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index 84aca6450a1..4fe1b4334f4 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -11,7 +11,7 @@ categories = ["network-programming", "asynchronous"] [target.'cfg(all(unix, not(target_os = "emscripten")))'.dependencies] async-std = { version = "1.6.2", optional = true } -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4.1" futures = "0.3.1" tokio = { version = "1.0.1", default-features = false, features = ["net"], optional = true } diff --git a/transports/wasm-ext/CHANGELOG.md b/transports/wasm-ext/CHANGELOG.md index eb73938eb20..ea66e34dee9 100644 --- a/transports/wasm-ext/CHANGELOG.md +++ b/transports/wasm-ext/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.31.0 [unreleased] + +- Update dependencies. + # 0.30.0 [2021-11-01] - Make default features of `libp2p-core` optional. diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml index d5d0139ba03..2695629ced5 100644 --- a/transports/wasm-ext/Cargo.toml +++ b/transports/wasm-ext/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-wasm-ext" -version = "0.30.0" +version = "0.31.0" authors = ["Pierre Krieger "] edition = "2018" description = "Allows passing in an external transport in a WASM environment" @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" js-sys = "0.3.50" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } parity-send-wrapper = "0.1.0" wasm-bindgen = "0.2.42" wasm-bindgen-futures = "0.4.4" diff --git a/transports/websocket/CHANGELOG.md b/transports/websocket/CHANGELOG.md index 07f86fdaaff..f387b7b8cc0 100644 --- a/transports/websocket/CHANGELOG.md +++ b/transports/websocket/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.33.0 [unreleased] + +- Update dependencies. + # v0.32.0 [2021-11-16] - Handle websocket CLOSE with reason code (see [PR 2085]). diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index b82edb388f9..23876b1e761 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-websocket" edition = "2018" description = "WebSocket transport for libp2p" -version = "0.32.0" +version = "0.33.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] futures-rustls = "0.22" either = "1.5.3" futures = "0.3.1" -libp2p-core = { version = "0.30.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } log = "0.4.8" quicksink = "0.1" rw-stream-sink = "0.2.0"