diff --git a/CHANGELOG.md b/CHANGELOG.md index a70dd5bc1454..485df8e2a180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,12 @@ # `libp2p` facade crate -## Version 0.39.0 [unreleased] +## Version 0.39.1 [2021-07-12] + +- Update individual crates. + - `libp2p-swarm-derive` + +## Version 0.39.0 [2021-07-12] - Update individual crates. - `libp2p-core` diff --git a/Cargo.toml b/Cargo.toml index 5dd91c0b361c..78121eab9f91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p" edition = "2018" description = "Peer-to-peer networking library" -version = "0.39.0" +version = "0.39.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -79,7 +79,7 @@ libp2p-pnet = { version = "0.21.0", path = "transports/pnet", optional = true } libp2p-relay = { version = "0.3.0", path = "protocols/relay", optional = true } libp2p-request-response = { version = "0.12.0", path = "protocols/request-response", optional = true } libp2p-swarm = { version = "0.30.0", path = "swarm" } -libp2p-swarm-derive = { version = "0.23.0", path = "swarm-derive" } +libp2p-swarm-derive = { version = "0.24.0", path = "swarm-derive" } libp2p-uds = { version = "0.29.0", path = "transports/uds", optional = true } libp2p-wasm-ext = { version = "0.29.0", path = "transports/wasm-ext", default-features = false, optional = true } libp2p-yamux = { version = "0.33.0", path = "muxers/yamux", optional = true } @@ -99,7 +99,7 @@ libp2p-websocket = { version = "0.30.0", path = "transports/websocket", optional [dev-dependencies] async-std = { version = "1.6.2", features = ["attributes"] } -env_logger = "0.8.1" +env_logger = "0.9.0" tokio = { version = "1.0.1", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] } [workspace] diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 46177efeeea1..dd6596be1cba 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Switch from `parity-multiaddr` to upstream `multiaddr`. diff --git a/core/src/peer_id.rs b/core/src/peer_id.rs index 5f9a8f786292..c4a12f703b31 100644 --- a/core/src/peer_id.rs +++ b/core/src/peer_id.rs @@ -68,8 +68,8 @@ impl PeerId { /// Parses a `PeerId` from bytes. pub fn from_bytes(data: &[u8]) -> Result { - Ok(PeerId::from_multihash(Multihash::from_bytes(&data)?) - .map_err(|mh| Error::UnsupportedCode(mh.code()))?) + PeerId::from_multihash(Multihash::from_bytes(&data)?) + .map_err(|mh| Error::UnsupportedCode(mh.code())) } /// Tries to turn a `Multihash` into a `PeerId`. diff --git a/misc/multistream-select/Cargo.toml b/misc/multistream-select/Cargo.toml index 7c86be9e6ac2..ef64832d465a 100644 --- a/misc/multistream-select/Cargo.toml +++ b/misc/multistream-select/Cargo.toml @@ -19,7 +19,7 @@ unsigned-varint = "0.7" [dev-dependencies] async-std = "1.6.2" -env_logger = "0.8" +env_logger = "0.9" libp2p-core = { path = "../../core" } libp2p-mplex = { path = "../../muxers/mplex" } libp2p-plaintext = { path = "../../transports/plaintext" } diff --git a/muxers/mplex/CHANGELOG.md b/muxers/mplex/CHANGELOG.md index 877433c6e16e..7350c34199c1 100644 --- a/muxers/mplex/CHANGELOG.md +++ b/muxers/mplex/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index ae668ac92d4a..7a3a018b5bf9 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -24,7 +24,7 @@ unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } [dev-dependencies] async-std = "1.7.0" criterion = "0.3" -env_logger = "0.8" +env_logger = "0.9" futures = "0.3" libp2p-tcp = { path = "../../transports/tcp" } libp2p-plaintext = { path = "../../transports/plaintext" } diff --git a/muxers/mplex/src/codec.rs b/muxers/mplex/src/codec.rs index 23ba1fcb6329..f56bb146ad0b 100644 --- a/muxers/mplex/src/codec.rs +++ b/muxers/mplex/src/codec.rs @@ -244,25 +244,25 @@ impl Encoder for Codec { fn encode(&mut self, item: Self::Item, dst: &mut BytesMut) -> Result<(), Self::Error> { let (header, data) = match item { Frame::Open { stream_id } => { - (u64::from(stream_id.num) << 3, Bytes::new()) + (stream_id.num << 3, Bytes::new()) }, Frame::Data { stream_id: LocalStreamId { num, role: Endpoint::Listener }, data } => { - (u64::from(num) << 3 | 1, data) + (num << 3 | 1, data) }, Frame::Data { stream_id: LocalStreamId { num, role: Endpoint::Dialer }, data } => { - (u64::from(num) << 3 | 2, data) + (num << 3 | 2, data) }, Frame::Close { stream_id: LocalStreamId { num, role: Endpoint::Listener } } => { - (u64::from(num) << 3 | 3, Bytes::new()) + (num << 3 | 3, Bytes::new()) }, Frame::Close { stream_id: LocalStreamId { num, role: Endpoint::Dialer } } => { - (u64::from(num) << 3 | 4, Bytes::new()) + (num << 3 | 4, Bytes::new()) }, Frame::Reset { stream_id: LocalStreamId { num, role: Endpoint::Listener } } => { - (u64::from(num) << 3 | 5, Bytes::new()) + (num << 3 | 5, Bytes::new()) }, Frame::Reset { stream_id: LocalStreamId { num, role: Endpoint::Dialer } } => { - (u64::from(num) << 3 | 6, Bytes::new()) + (num << 3 | 6, Bytes::new()) }, }; diff --git a/muxers/yamux/CHANGELOG.md b/muxers/yamux/CHANGELOG.md index 9698f9f40dda..9c58fbe9f9ad 100644 --- a/muxers/yamux/CHANGELOG.md +++ b/muxers/yamux/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.33.0 [unreleased] +# 0.33.0 [2021-07-12] - Update dependencies. diff --git a/protocols/floodsub/CHANGELOG.md b/protocols/floodsub/CHANGELOG.md index 6fe20028e1c8..162fc0eb5635 100644 --- a/protocols/floodsub/CHANGELOG.md +++ b/protocols/floodsub/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.30.0 [unreleased] +# 0.30.0 [2021-07-12] - Update dependencies. diff --git a/protocols/gossipsub/CHANGELOG.md b/protocols/gossipsub/CHANGELOG.md index 42694c9a5dd2..0f2a4d6e40ac 100644 --- a/protocols/gossipsub/CHANGELOG.md +++ b/protocols/gossipsub/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.32.0 [unreleased] +# 0.32.0 [2021-07-12] - Update dependencies. diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 7fd5c05a466a..feaa120606c1 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -30,7 +30,7 @@ regex = "1.4.0" [dev-dependencies] async-std = "1.6.3" -env_logger = "0.8.1" +env_logger = "0.9.0" libp2p-plaintext = { path = "../../transports/plaintext" } libp2p-yamux = { path = "../../muxers/yamux" } libp2p-mplex = { path = "../../muxers/mplex" } diff --git a/protocols/identify/CHANGELOG.md b/protocols/identify/CHANGELOG.md index 567823594d69..861fba49cb10 100644 --- a/protocols/identify/CHANGELOG.md +++ b/protocols/identify/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.30.0 [unreleased] +# 0.30.0 [2021-07-12] - Update dependencies. diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index 257f45eeb663..dc996acff762 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -20,7 +20,7 @@ wasm-timer = "0.2" [dev-dependencies] async-std = "1.6.2" -env_logger = "0.8" +env_logger = "0.9" libp2p-mplex = { path = "../../muxers/mplex" } libp2p-noise = { path = "../../transports/noise" } libp2p-tcp = { path = "../../transports/tcp" } diff --git a/protocols/identify/src/handler.rs b/protocols/identify/src/handler.rs index 0f541a86587a..11c239cdfab9 100644 --- a/protocols/identify/src/handler.rs +++ b/protocols/identify/src/handler.rs @@ -211,7 +211,7 @@ impl ProtocolsHandler for IdentifyHandler { }; Poll::Ready(ev) } - Poll::Ready(Err(err)) => Poll::Ready(ProtocolsHandlerEvent::Close(err.into())) + Poll::Ready(Err(err)) => Poll::Ready(ProtocolsHandlerEvent::Close(err)) } } } diff --git a/protocols/identify/src/protocol.rs b/protocols/identify/src/protocol.rs index c3a323ddd0d9..896abd7186cb 100644 --- a/protocols/identify/src/protocol.rs +++ b/protocols/identify/src/protocol.rs @@ -207,7 +207,7 @@ where Ok(v) => v, Err(err) => { debug!("Invalid message: {:?}", err); - return Err(err.into()) + return Err(err) } }; diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index 18c03d53faf6..02c18627d0c6 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.31.0 [unreleased] +# 0.31.0 [2021-07-12] - Update dependencies. diff --git a/protocols/kad/src/kbucket.rs b/protocols/kad/src/kbucket.rs index a77d39f0ee76..ff00b0d7ed09 100644 --- a/protocols/kad/src/kbucket.rs +++ b/protocols/kad/src/kbucket.rs @@ -186,7 +186,7 @@ where /// /// The buckets are ordered by proximity to the `local_key`, i.e. the first /// bucket is the closest bucket (containing at most one key). - pub fn iter<'a>(&'a mut self) -> impl Iterator> + 'a { + pub fn iter(&mut self) -> impl Iterator> + '_ { let applied_pending = &mut self.applied_pending; self.buckets.iter_mut().enumerate().map(move |(i, b)| { if let Some(applied) = b.apply_pending() { diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index 010c57cb6b1c..97489bb764f8 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.31.0 [unreleased] +# 0.31.0 [2021-07-12] - Update dependencies. diff --git a/protocols/mdns/src/dns.rs b/protocols/mdns/src/dns.rs index e0645feac82e..fa89caa3fc69 100644 --- a/protocols/mdns/src/dns.rs +++ b/protocols/mdns/src/dns.rs @@ -371,8 +371,7 @@ fn append_txt_record( if value.len() > MAX_TXT_VALUE_LENGTH { return Err(MdnsResponseError::TxtRecordTooLong); } - let mut buffer = Vec::new(); - buffer.push(value.len() as u8); + let mut buffer = vec![value.len() as u8]; append_character_string(&mut buffer, value)?; append_u16(out, buffer.len() as u16); diff --git a/protocols/ping/CHANGELOG.md b/protocols/ping/CHANGELOG.md index c656e9aeb6c3..68ff4c0f6c95 100644 --- a/protocols/ping/CHANGELOG.md +++ b/protocols/ping/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.30.0 [unreleased] +# 0.30.0 [2021-07-12] - Update dependencies. diff --git a/protocols/relay/CHANGELOG.md b/protocols/relay/CHANGELOG.md index c644204da9fc..4ba329456d02 100644 --- a/protocols/relay/CHANGELOG.md +++ b/protocols/relay/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.3.0 [unreleased] +# 0.3.0 [2021-07-12] - Update dependencies. diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index 66495cf78d51..36c9ff250a46 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -29,7 +29,7 @@ wasm-timer = "0.2" prost-build = "0.8" [dev-dependencies] -env_logger = "0.8.3" +env_logger = "0.9.0" structopt = "0.3.21" libp2p = { path = "../.." } libp2p-kad = { path = "../kad" } diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index 093f5b4580dd..3f82fe12459f 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.12.0 [unreleased] +# 0.12.0 [2021-07-12] - Update dependencies. diff --git a/swarm-derive/CHANGELOG.md b/swarm-derive/CHANGELOG.md index 52031b8837cf..94ea25f6b106 100644 --- a/swarm-derive/CHANGELOG.md +++ b/swarm-derive/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.24.0 [2021-07-12] + +- Handle `NetworkBehaviourAction::CloseConnection`. See [PR 2110] for details. + +[PR 2110]: https://github.com/libp2p/rust-libp2p/pull/2110/ + # 0.23.0 [2021-04-14] - Extend `NetworkBehaviour` callbacks, more concretely introducing new `fn diff --git a/swarm-derive/Cargo.toml b/swarm-derive/Cargo.toml index 9fa9080b8481..e63b7a71dd86 100644 --- a/swarm-derive/Cargo.toml +++ b/swarm-derive/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-swarm-derive" edition = "2018" description = "Procedural macros of libp2p-core" -version = "0.23.0" +version = "0.24.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index ebf7071f0c47..fe91936cb76f 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.30.0 [unreleased] +# 0.30.0 [2021-07-12] - Update dependencies. @@ -20,7 +20,7 @@ peer via an `ExpandedSwarm` or `NetworkBehaviour`. See [PR 2110] for details. - Expose the `ListenerId` in `SwarmEvent`s that are associated with a listener. - + See [PR 2123] for details. [PR 2100]: https://github.com/libp2p/rust-libp2p/pull/2100 diff --git a/transports/deflate/CHANGELOG.md b/transports/deflate/CHANGELOG.md index f69325171397..3ba359ac5584 100644 --- a/transports/deflate/CHANGELOG.md +++ b/transports/deflate/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/transports/dns/CHANGELOG.md b/transports/dns/CHANGELOG.md index 736e25c67ed0..40acc71c23e6 100644 --- a/transports/dns/CHANGELOG.md +++ b/transports/dns/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index 311dfb54c2de..aaa6a82a2e66 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -18,7 +18,7 @@ async-std-resolver = { version = "0.20", optional = true } smallvec = "1.6.1" [dev-dependencies] -env_logger = "0.8" +env_logger = "0.9" tokio-crate = { package = "tokio", version = "1.0", default-features = false, features = ["rt", "time"] } async-std-crate = { package = "async-std", version = "1.6" } diff --git a/transports/noise/CHANGELOG.md b/transports/noise/CHANGELOG.md index 92e9c1e66211..016ab8e3c86c 100644 --- a/transports/noise/CHANGELOG.md +++ b/transports/noise/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.32.0 [unreleased] +# 0.32.0 [2021-07-12] - Update dependencies. diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 2f35a5081be6..9e0c5e88b6da 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -29,7 +29,7 @@ snow = { version = "0.8.0", features = ["default-resolver"], default-features = [dev-dependencies] async-io = "1.2.0" -env_logger = "0.8.1" +env_logger = "0.9.0" libp2p-tcp = { path = "../../transports/tcp" } quickcheck = "0.9.0" sodiumoxide = "0.2.5" diff --git a/transports/noise/src/protocol/x25519.rs b/transports/noise/src/protocol/x25519.rs index 389c5b94e93b..c4e79bc33aee 100644 --- a/transports/noise/src/protocol/x25519.rs +++ b/transports/noise/src/protocol/x25519.rs @@ -235,7 +235,7 @@ impl snow::types::Dh for Keypair { fn set(&mut self, sk: &[u8]) { let mut secret = [0u8; 32]; - secret.copy_from_slice(&sk[..]); + secret.copy_from_slice(&sk); self.secret = SecretKey(X25519(secret)); // Copy self.public = PublicKey(X25519(x25519(secret, X25519_BASEPOINT_BYTES))); secret.zeroize(); diff --git a/transports/noise/src/protocol/x25519_spec.rs b/transports/noise/src/protocol/x25519_spec.rs index c2f3209580b3..16e3ffeafee4 100644 --- a/transports/noise/src/protocol/x25519_spec.rs +++ b/transports/noise/src/protocol/x25519_spec.rs @@ -146,7 +146,7 @@ impl snow::types::Dh for Keypair { fn set(&mut self, sk: &[u8]) { let mut secret = [0u8; 32]; - secret.copy_from_slice(&sk[..]); + secret.copy_from_slice(&sk); self.secret = SecretKey(X25519Spec(secret)); // Copy self.public = PublicKey(X25519Spec(x25519(secret, X25519_BASEPOINT_BYTES))); secret.zeroize(); diff --git a/transports/plaintext/CHANGELOG.md b/transports/plaintext/CHANGELOG.md index 3b6a67e6930c..6ed0eb794424 100644 --- a/transports/plaintext/CHANGELOG.md +++ b/transports/plaintext/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index 87c7d4792032..58ae9b025833 100644 --- a/transports/plaintext/Cargo.toml +++ b/transports/plaintext/Cargo.toml @@ -20,7 +20,7 @@ unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } void = "1.0.2" [dev-dependencies] -env_logger = "0.8.1" +env_logger = "0.9.0" quickcheck = "0.9.0" rand = "0.7" diff --git a/transports/tcp/CHANGELOG.md b/transports/tcp/CHANGELOG.md index ebf67d0857ce..6b01961caa32 100644 --- a/transports/tcp/CHANGELOG.md +++ b/transports/tcp/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 04eaa28079d7..96599bfdfc42 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -30,4 +30,4 @@ async-io = ["async-io-crate", "if-watch"] [dev-dependencies] async-std = { version = "1.6.5", features = ["attributes"] } tokio-crate = { package = "tokio", version = "1.0.1", default-features = false, features = ["net", "rt"] } -env_logger = "0.8.2" +env_logger = "0.9.0" diff --git a/transports/uds/CHANGELOG.md b/transports/uds/CHANGELOG.md index a14aaf82f33d..60618cc1df20 100644 --- a/transports/uds/CHANGELOG.md +++ b/transports/uds/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/transports/wasm-ext/CHANGELOG.md b/transports/wasm-ext/CHANGELOG.md index c8331b7d2e15..fc8f8e69d6d8 100644 --- a/transports/wasm-ext/CHANGELOG.md +++ b/transports/wasm-ext/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.29.0 [unreleased] +# 0.29.0 [2021-07-12] - Update dependencies. diff --git a/transports/websocket/CHANGELOG.md b/transports/websocket/CHANGELOG.md index 5b7bfb023a04..81d98bfb77b3 100644 --- a/transports/websocket/CHANGELOG.md +++ b/transports/websocket/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.30.0 [unreleased] +# 0.30.0 [2021-07-12] - Update dependencies.