diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c7185d7..28bc6874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,30 @@ See [PR 3001]. - Introduce [`libp2p-tls` `v0.1.0`](transports/tls/CHANGELOG.md#010). See [PR 2945]. - Update individual crates. + - Update to [`libp2p-autonat` `v0.89.0`](protocols/autonat/CHANGELOG.md#090). + - Update to [`libp2p-core` `v0.38.0`](core/CHANGELOG.md#0380). + - Update to [`libp2p-dcutr` `v0.8.0`](protocols/dcutr/CHANGELOG.md#080). + - Update to [`libp2p-deflate` `v0.38.0`](transports/deflate/CHANGELOG.md#0380). + - Update to [`libp2p-dns` `v0.38.0`](transports/dns/CHANGELOG.md#0380). + - Update to [`libp2p-floodsub` `v0.41.0`](protocols/floodsub/CHANGELOG.md#0410). + - Update to [`libp2p-gossipsub` `v0.43.0`](protocols/gossipsub/CHANGELOG.md#0430). + - Update to [`libp2p-identify` `v0.41.0`](protocols/identify/CHANGELOG.md#0410). + - Update to [`libp2p-kad` `v0.42.0`](protocols/kad/CHANGELOG.md#0420). + - Update to [`libp2p-mdns` `v0.42.0`](protocols/mdns/CHANGELOG.md#0420). + - Update to [`libp2p-metrics` `v0.11.0`](misc/metrics/CHANGELOG.md#0110). + - Update to [`libp2p-mplex` `v0.38.0`](muxers/mplex/CHANGELOG.md#0380). + - Update to [`libp2p-noise` `v0.41.0`](transports/noise/CHANGELOG.md#0410). + - Update to [`libp2p-ping` `v0.41.0`](protocols/ping/CHANGELOG.md#0410). + - Update to [`libp2p-plaintext` `v0.38.0`](transports/plaintext/CHANGELOG.md#0380). + - Update to [`libp2p-relay` `v0.14.0`](protocols/relay/CHANGELOG.md#0140). + - Update to [`libp2p-rendezvous` `v0.11.0`](protocols/rendezovus/CHANGELOG.md#0110). + - Update to [`libp2p-request-response` `v0.23.0`](protocols/request-response/CHANGELOG.md#0230). + - Update to [`libp2p-swarm` `v0.41.0`](swarm/CHANGELOG.md#0410). - Update to [`libp2p-tcp` `v0.38.0`](transports/tcp/CHANGELOG.md#0380). + - Update to [`libp2p-uds` `v0.37.0`](transports/uds/CHANGELOG.md#0370). + - Update to [`libp2p-wasm-ext` `v0.38.0`](transports/wasm-ext/CHANGELOG.md#0380). + - Update to [`libp2p-websocket` `v0.40.0`](transports/websocket/CHANGELOG.md#0400). + - Update to [`libp2p-yamux` `v0.42.0`](muxers/yamux/CHANGELOG.md#0420). [PR 2945]: https://github.com/libp2p/rust-libp2p/pull/2945 [PR 3001]: https://github.com/libp2p/rust-libp2p/pull/3001 diff --git a/Cargo.toml b/Cargo.toml index 53922f38..b5f74e7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,41 +86,41 @@ 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-autonat = { version = "0.8.0", path = "protocols/autonat", optional = true } -libp2p-core = { version = "0.37.0", path = "core" } -libp2p-dcutr = { version = "0.7.0", path = "protocols/dcutr", optional = true } -libp2p-floodsub = { version = "0.40.1", path = "protocols/floodsub", optional = true } -libp2p-identify = { version = "0.40.0", path = "protocols/identify", optional = true } -libp2p-kad = { version = "0.41.0", path = "protocols/kad", optional = true } -libp2p-metrics = { version = "0.10.0", path = "misc/metrics", optional = true } -libp2p-mplex = { version = "0.37.0", path = "muxers/mplex", optional = true } -libp2p-noise = { version = "0.40.0", path = "transports/noise", optional = true } -libp2p-ping = { version = "0.40.1", path = "protocols/ping", optional = true } -libp2p-plaintext = { version = "0.37.0", path = "transports/plaintext", optional = true } +libp2p-autonat = { version = "0.9.0", path = "protocols/autonat", optional = true } +libp2p-core = { version = "0.38.0", path = "core" } +libp2p-dcutr = { version = "0.8.0", path = "protocols/dcutr", optional = true } +libp2p-floodsub = { version = "0.41.0", path = "protocols/floodsub", optional = true } +libp2p-identify = { version = "0.41.0", path = "protocols/identify", optional = true } +libp2p-kad = { version = "0.42.0", path = "protocols/kad", optional = true } +libp2p-metrics = { version = "0.11.0", path = "misc/metrics", optional = true } +libp2p-mplex = { version = "0.38.0", path = "muxers/mplex", optional = true } +libp2p-noise = { version = "0.41.0", path = "transports/noise", optional = true } +libp2p-ping = { version = "0.41.0", path = "protocols/ping", optional = true } +libp2p-plaintext = { version = "0.38.0", path = "transports/plaintext", optional = true } libp2p-pnet = { version = "0.22.1", path = "transports/pnet", optional = true } -libp2p-relay = { version = "0.13.0", path = "protocols/relay", optional = true } -libp2p-rendezvous = { version = "0.10.0", path = "protocols/rendezvous", optional = true } -libp2p-request-response = { version = "0.22.1", path = "protocols/request-response", optional = true } -libp2p-swarm = { version = "0.40.1", path = "swarm" } +libp2p-relay = { version = "0.14.0", path = "protocols/relay", optional = true } +libp2p-rendezvous = { version = "0.11.0", path = "protocols/rendezvous", optional = true } +libp2p-request-response = { version = "0.23.0", path = "protocols/request-response", optional = true } +libp2p-swarm = { version = "0.41.0", path = "swarm" } libp2p-swarm-derive = { version = "0.30.1", path = "swarm-derive" } -libp2p-uds = { version = "0.36.0", path = "transports/uds", optional = true } -libp2p-wasm-ext = { version = "0.37.0", path = "transports/wasm-ext", optional = true } -libp2p-yamux = { version = "0.41.0", path = "muxers/yamux", optional = true } +libp2p-uds = { version = "0.37.0", path = "transports/uds", optional = true } +libp2p-wasm-ext = { version = "0.38.0", path = "transports/wasm-ext", optional = true } +libp2p-yamux = { version = "0.42.0", path = "muxers/yamux", optional = true } multiaddr = { version = "0.14.0" } parking_lot = "0.12.0" pin-project = "1.0.0" smallvec = "1.6.1" [target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies] -libp2p-deflate = { version = "0.37.0", path = "transports/deflate", optional = true } -libp2p-dns = { version = "0.37.0", path = "transports/dns", optional = true } -libp2p-mdns = { version = "0.41.0", path = "protocols/mdns", optional = true } +libp2p-deflate = { version = "0.38.0", path = "transports/deflate", optional = true } +libp2p-dns = { version = "0.38.0", path = "transports/dns", optional = true } +libp2p-mdns = { version = "0.42.0", path = "protocols/mdns", optional = true } libp2p-tcp = { version = "0.38.0", path = "transports/tcp", optional = true } -libp2p-websocket = { version = "0.39.0", path = "transports/websocket", optional = true } +libp2p-websocket = { version = "0.40.0", path = "transports/websocket", optional = true } libp2p-tls = { version = "0.1.0-alpha", path = "transports/tls", optional = true } [target.'cfg(not(target_os = "unknown"))'.dependencies] -libp2p-gossipsub = { version = "0.42.1", path = "protocols/gossipsub", optional = true } +libp2p-gossipsub = { version = "0.43.0", path = "protocols/gossipsub", optional = true } [dev-dependencies] async-std = { version = "1.6.2", features = ["attributes"] } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index e9968242..c4a57cb6 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.38.0 [unreleased] + +- Hide `prost::Error` from public API in `FromEnvelopeError::InvalidPeerRecord` and `signed_envelope::DecodingError`. See [PR 3058]. + +[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 + # 0.37.0 - Implement `Hash` and `Ord` for `PublicKey`. See [PR 2915]. diff --git a/core/Cargo.toml b/core/Cargo.toml index 027cd6bd..5a8a61db 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-core" edition = "2021" rust-version = "1.56.1" description = "Core traits and structs of libp2p" -version = "0.37.0" +version = "0.38.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/core/src/lib.rs b/core/src/lib.rs index 88c6cc0d..c7b9aa60 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -79,6 +79,10 @@ pub use translation::address_translation; pub use transport::Transport; pub use upgrade::{InboundUpgrade, OutboundUpgrade, ProtocolName, UpgradeError, UpgradeInfo}; +#[derive(thiserror::Error, Debug)] +#[error(transparent)] +pub struct DecodeError(prost::DecodeError); + use std::{future::Future, pin::Pin}; /// Implemented on objects that can run a `Future` in the background. diff --git a/core/src/peer_record.rs b/core/src/peer_record.rs index d0d8e21a..39cf985e 100644 --- a/core/src/peer_record.rs +++ b/core/src/peer_record.rs @@ -1,10 +1,9 @@ use crate::identity::error::SigningError; use crate::identity::Keypair; use crate::signed_envelope::SignedEnvelope; -use crate::{peer_record_proto, signed_envelope, Multiaddr, PeerId}; +use crate::{peer_record_proto, signed_envelope, DecodeError, Multiaddr, PeerId}; use instant::SystemTime; use std::convert::TryInto; -use std::fmt; const PAYLOAD_TYPE: &str = "/libp2p/routing-state-record"; const DOMAIN_SEP: &str = "libp2p-routing-state"; @@ -34,7 +33,7 @@ impl PeerRecord { let (payload, signing_key) = envelope.payload_and_signing_key(String::from(DOMAIN_SEP), PAYLOAD_TYPE.as_bytes())?; - let record = peer_record_proto::PeerRecord::decode(payload)?; + let record = peer_record_proto::PeerRecord::decode(payload).map_err(DecodeError)?; let peer_id = PeerId::from_bytes(&record.peer_id)?; @@ -124,73 +123,23 @@ impl PeerRecord { } } -#[derive(Debug)] +#[derive(thiserror::Error, Debug)] pub enum FromEnvelopeError { /// Failed to extract the payload from the envelope. - BadPayload(signed_envelope::ReadPayloadError), + #[error("Failed to extract payload from envelope")] + BadPayload(#[from] signed_envelope::ReadPayloadError), /// Failed to decode the provided bytes as a [`PeerRecord`]. - InvalidPeerRecord(prost::DecodeError), + #[error("Failed to decode bytes as PeerRecord")] + InvalidPeerRecord(#[from] DecodeError), /// Failed to decode the peer ID. - InvalidPeerId(multihash::Error), + #[error("Failed to decode bytes as PeerId")] + InvalidPeerId(#[from] multihash::Error), /// The signer of the envelope is different than the peer id in the record. + #[error("The signer of the envelope is different than the peer id in the record")] MismatchedSignature, /// Failed to decode a multi-address. - InvalidMultiaddr(multiaddr::Error), -} - -impl From for FromEnvelopeError { - fn from(e: signed_envelope::ReadPayloadError) -> Self { - Self::BadPayload(e) - } -} - -impl From for FromEnvelopeError { - fn from(e: prost::DecodeError) -> Self { - Self::InvalidPeerRecord(e) - } -} - -impl From for FromEnvelopeError { - fn from(e: multihash::Error) -> Self { - Self::InvalidPeerId(e) - } -} - -impl From for FromEnvelopeError { - fn from(e: multiaddr::Error) -> Self { - Self::InvalidMultiaddr(e) - } -} - -impl fmt::Display for FromEnvelopeError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::BadPayload(_) => write!(f, "Failed to extract payload from envelope"), - Self::InvalidPeerRecord(_) => { - write!(f, "Failed to decode bytes as PeerRecord") - } - Self::InvalidPeerId(_) => write!(f, "Failed to decode bytes as PeerId"), - Self::MismatchedSignature => write!( - f, - "The signer of the envelope is different than the peer id in the record" - ), - Self::InvalidMultiaddr(_) => { - write!(f, "Failed to decode bytes as MultiAddress") - } - } - } -} - -impl std::error::Error for FromEnvelopeError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - Self::InvalidPeerRecord(inner) => Some(inner), - Self::InvalidPeerId(inner) => Some(inner), - Self::MismatchedSignature => None, - Self::InvalidMultiaddr(inner) => Some(inner), - Self::BadPayload(inner) => Some(inner), - } - } + #[error("Failed to decode bytes as MultiAddress")] + InvalidMultiaddr(#[from] multiaddr::Error), } #[cfg(test)] diff --git a/core/src/signed_envelope.rs b/core/src/signed_envelope.rs index 33bfdf2d..10acdf3c 100644 --- a/core/src/signed_envelope.rs +++ b/core/src/signed_envelope.rs @@ -1,6 +1,6 @@ use crate::identity::error::SigningError; use crate::identity::Keypair; -use crate::{identity, PublicKey}; +use crate::{identity, DecodeError, PublicKey}; use std::convert::TryInto; use std::fmt; use unsigned_varint::encode::usize_buffer; @@ -94,7 +94,7 @@ impl SignedEnvelope { pub fn from_protobuf_encoding(bytes: &[u8]) -> Result { use prost::Message; - let envelope = crate::envelope_proto::Envelope::decode(bytes)?; + let envelope = crate::envelope_proto::Envelope::decode(bytes).map_err(DecodeError)?; Ok(Self { key: envelope @@ -140,48 +140,19 @@ fn signature_payload(domain_separation: String, payload_type: &[u8], payload: &[ } /// Errors that occur whilst decoding a [`SignedEnvelope`] from its byte representation. -#[derive(Debug)] +#[derive(thiserror::Error, Debug)] pub enum DecodingError { /// Decoding the provided bytes as a signed envelope failed. - InvalidEnvelope(prost::DecodeError), + #[error("Failed to decode envelope")] + InvalidEnvelope(#[from] DecodeError), /// The public key in the envelope could not be converted to our internal public key type. - InvalidPublicKey(identity::error::DecodingError), + #[error("Failed to convert public key")] + InvalidPublicKey(#[from] identity::error::DecodingError), /// The public key in the envelope could not be converted to our internal public key type. + #[error("Public key is missing from protobuf struct")] MissingPublicKey, } -impl From for DecodingError { - fn from(e: prost::DecodeError) -> Self { - Self::InvalidEnvelope(e) - } -} - -impl From for DecodingError { - fn from(e: identity::error::DecodingError) -> Self { - Self::InvalidPublicKey(e) - } -} - -impl fmt::Display for DecodingError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::InvalidEnvelope(_) => write!(f, "Failed to decode envelope"), - Self::InvalidPublicKey(_) => write!(f, "Failed to convert public key"), - Self::MissingPublicKey => write!(f, "Public key is missing from protobuf struct"), - } - } -} - -impl std::error::Error for DecodingError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - Self::InvalidEnvelope(inner) => Some(inner), - Self::InvalidPublicKey(inner) => Some(inner), - Self::MissingPublicKey => None, - } - } -} - /// Errors that occur whilst extracting the payload of a [`SignedEnvelope`]. #[derive(Debug)] pub enum ReadPayloadError { diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index a5007fcb..30117398 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -14,5 +14,5 @@ clap = { version = "4.0.13", features = ["derive"] } zeroize = "1" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } base64 = "0.13.0" diff --git a/misc/metrics/CHANGELOG.md b/misc/metrics/CHANGELOG.md index d76ef307..c8eecc36 100644 --- a/misc/metrics/CHANGELOG.md +++ b/misc/metrics/CHANGELOG.md @@ -1,3 +1,21 @@ +# 0.11.0 [unreleased] + +- Update to `libp2p-dcutr` `v0.8.0`. + +- Update to `libp2p-identify` `v0.41.0`. + +- Update to `libp2p-relay` `v0.14.0`. + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + +- Update to `libp2p-ping` `v0.41.0`. + +- Update to `libp2p-kad` `v0.42.0`. + +- Update to `libp2p-gossipsub` `v0.43.0`. + # 0.10.0 - Update to `libp2p-swarm` `v0.40.0`. @@ -129,6 +147,7 @@ - Drop support for gossipsub in wasm32-unknown-unknown target (see [PR 2506]). [PR 2442]: https://github.com/libp2p/rust-libp2p/pull/2442 + [PR 2506]: https://github.com/libp2p/rust-libp2p/pull/2506 # 0.3.0 [2022-01-27] diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index ca9acacb..54f3271f 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-metrics" edition = "2021" rust-version = "1.56.1" description = "Metrics for libp2p" -version = "0.10.0" +version = "0.11.0" authors = ["Max Inden "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -19,17 +19,17 @@ relay = ["libp2p-relay"] dcutr = ["libp2p-dcutr"] [dependencies] -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-dcutr = { version = "0.7.0", path = "../../protocols/dcutr", optional = true } -libp2p-identify = { version = "0.40.0", path = "../../protocols/identify", optional = true } -libp2p-kad = { version = "0.41.0", path = "../../protocols/kad", optional = true } -libp2p-ping = { version = "0.40.0", path = "../../protocols/ping", optional = true } -libp2p-relay = { version = "0.13.0", path = "../../protocols/relay", optional = true } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-dcutr = { version = "0.8.0", path = "../../protocols/dcutr", optional = true } +libp2p-identify = { version = "0.41.0", path = "../../protocols/identify", optional = true } +libp2p-kad = { version = "0.42.0", path = "../../protocols/kad", optional = true } +libp2p-ping = { version = "0.41.0", path = "../../protocols/ping", optional = true } +libp2p-relay = { version = "0.14.0", path = "../../protocols/relay", optional = true } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } prometheus-client = "0.18.0" [target.'cfg(not(target_os = "unknown"))'.dependencies] -libp2p-gossipsub = { version = "0.42.0", path = "../../protocols/gossipsub", optional = true } +libp2p-gossipsub = { version = "0.43.0", path = "../../protocols/gossipsub", optional = true } [dev-dependencies] log = "0.4.0" diff --git a/misc/prost-codec/CHANGELOG.md b/misc/prost-codec/CHANGELOG.md index d9380ea3..382d68ac 100644 --- a/misc/prost-codec/CHANGELOG.md +++ b/misc/prost-codec/CHANGELOG.md @@ -1,5 +1,11 @@ +# 0.3.0 [unreleased] + +- Don't leak `prost` dependency in `Error` type. See [PR 3058]. + +[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058/ + # 0.2.0 - Update to prost(-build) `v0.11`. See [PR 2788]. -[PR 2788]: https://github.com/libp2p/rust-libp2p/pull/2788/ \ No newline at end of file +[PR 2788]: https://github.com/libp2p/rust-libp2p/pull/2788/ diff --git a/misc/prost-codec/Cargo.toml b/misc/prost-codec/Cargo.toml index 34a5c451..09c725c1 100644 --- a/misc/prost-codec/Cargo.toml +++ b/misc/prost-codec/Cargo.toml @@ -3,7 +3,7 @@ name = "prost-codec" edition = "2021" rust-version = "1.56.1" description = "Asynchronous de-/encoding of Protobuf structs using asynchronous-codec, unsigned-varint and prost." -version = "0.2.0" +version = "0.3.0" authors = ["Max Inden "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/misc/prost-codec/src/lib.rs b/misc/prost-codec/src/lib.rs index f8efa147..61c980d3 100644 --- a/misc/prost-codec/src/lib.rs +++ b/misc/prost-codec/src/lib.rs @@ -5,7 +5,6 @@ use bytes::BytesMut; use prost::Message; use std::io::Cursor; use std::marker::PhantomData; -use thiserror::Error; use unsigned_varint::codec::UviBytes; /// [`Codec`] implements [`Encoder`] and [`Decoder`], uses [`unsigned_varint`] @@ -36,17 +35,13 @@ impl Encoder for Codec { type Item = In; type Error = Error; - fn encode( - &mut self, - item: Self::Item, - dst: &mut asynchronous_codec::BytesMut, - ) -> Result<(), Self::Error> { + fn encode(&mut self, item: Self::Item, dst: &mut BytesMut) -> Result<(), Self::Error> { let mut encoded_msg = BytesMut::new(); item.encode(&mut encoded_msg) .expect("BytesMut to have sufficient capacity."); - self.uvi - .encode(encoded_msg.freeze(), dst) - .map_err(|e| e.into()) + self.uvi.encode(encoded_msg.freeze(), dst)?; + + Ok(()) } } @@ -54,30 +49,19 @@ impl Decoder for Codec { type Item = Out; type Error = Error; - fn decode( - &mut self, - src: &mut asynchronous_codec::BytesMut, - ) -> Result, Self::Error> { - Ok(self - .uvi - .decode(src)? - .map(|msg| Message::decode(Cursor::new(msg))) - .transpose()?) + fn decode(&mut self, src: &mut BytesMut) -> Result, Self::Error> { + let msg = match self.uvi.decode(src)? { + None => return Ok(None), + Some(msg) => msg, + }; + + let message = Message::decode(Cursor::new(msg)) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))?; + + Ok(Some(message)) } } -#[derive(Debug, Error)] -pub enum Error { - #[error("Failed to decode response: {0}.")] - Decode( - #[from] - #[source] - prost::DecodeError, - ), - #[error("Io error {0}")] - Io( - #[from] - #[source] - std::io::Error, - ), -} +#[derive(thiserror::Error, Debug)] +#[error("Failed to encode/decode message")] +pub struct Error(#[from] std::io::Error); diff --git a/muxers/mplex/CHANGELOG.md b/muxers/mplex/CHANGELOG.md index ed1c5c73..061d65ff 100644 --- a/muxers/mplex/CHANGELOG.md +++ b/muxers/mplex/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.38.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.37.0 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index 0008e9b7..94bd697c 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-mplex" edition = "2021" rust-version = "1.56.1" description = "Mplex multiplexing protocol for libp2p" -version = "0.37.0" +version = "0.38.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] bytes = "1" futures = "0.3.1" asynchronous-codec = "0.6" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4" nohash-hasher = "0.2" parking_lot = "0.12" diff --git a/muxers/yamux/CHANGELOG.md b/muxers/yamux/CHANGELOG.md index b3aa8dac..3e6ac4e4 100644 --- a/muxers/yamux/CHANGELOG.md +++ b/muxers/yamux/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.42.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.41.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index 270c0a75..cb8a1e4e 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-yamux" edition = "2021" rust-version = "1.56.1" description = "Yamux multiplexing protocol for libp2p" -version = "0.41.0" +version = "0.42.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } parking_lot = "0.12" thiserror = "1.0" yamux = "0.10.0" diff --git a/protocols/autonat/CHANGELOG.md b/protocols/autonat/CHANGELOG.md index 6f55afa4..7cbcc4d8 100644 --- a/protocols/autonat/CHANGELOG.md +++ b/protocols/autonat/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.9.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + +- Update to `libp2p-request-response` `v0.23.0`. + # 0.8.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index 68ff289a..10fd0e71 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-autonat" edition = "2021" rust-version = "1.56.1" description = "NAT and firewall detection for libp2p" -version = "0.8.0" +version = "0.9.0" authors = ["David Craven ", "Elena Frank "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -18,9 +18,9 @@ async-trait = "0.1" futures = "0.3" futures-timer = "3.0" instant = "0.1" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } -libp2p-request-response = { version = "0.22.0", path = "../request-response" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } +libp2p-request-response = { version = "0.23.0", path = "../request-response" } log = "0.4" rand = "0.8" prost = "0.11" diff --git a/protocols/dcutr/CHANGELOG.md b/protocols/dcutr/CHANGELOG.md index 0d49f90d..b7890a8d 100644 --- a/protocols/dcutr/CHANGELOG.md +++ b/protocols/dcutr/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.8.0 [unreleased] + +- Update to `prost-codec` `v0.3.0`. + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.7.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index c90af2f7..33486f49 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-dcutr" edition = "2021" rust-version = "1.56.1" description = "Direct connection upgrade through relay" -version = "0.7.0" +version = "0.8.0" authors = ["Max Inden "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -17,10 +17,10 @@ either = "1.6.0" futures = "0.3.1" futures-timer = "3.0" instant = "0.1.11" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } log = "0.4" -prost-codec = { version = "0.2", path = "../../misc/prost-codec" } +prost-codec = { version = "0.3", path = "../../misc/prost-codec" } prost = "0.11" thiserror = "1.0" void = "1" diff --git a/protocols/dcutr/src/protocol/inbound.rs b/protocols/dcutr/src/protocol/inbound.rs index cfb28ca5..3b964881 100644 --- a/protocols/dcutr/src/protocol/inbound.rs +++ b/protocols/dcutr/src/protocol/inbound.rs @@ -118,12 +118,8 @@ impl PendingConnect { #[derive(Debug, Error)] pub enum UpgradeError { - #[error("Failed to encode or decode")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Stream closed")] StreamClosed, #[error("Expected at least one address in reservation.")] diff --git a/protocols/dcutr/src/protocol/outbound.rs b/protocols/dcutr/src/protocol/outbound.rs index a0ea8449..ca2a340a 100644 --- a/protocols/dcutr/src/protocol/outbound.rs +++ b/protocols/dcutr/src/protocol/outbound.rs @@ -116,12 +116,8 @@ pub struct Connect { #[derive(Debug, Error)] pub enum UpgradeError { - #[error("Failed to encode or decode: {0}")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Stream closed")] StreamClosed, #[error("Expected 'status' field to be set.")] diff --git a/protocols/floodsub/CHANGELOG.md b/protocols/floodsub/CHANGELOG.md index dd42387e..7ecf1560 100644 --- a/protocols/floodsub/CHANGELOG.md +++ b/protocols/floodsub/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.41.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.40.0 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index cfbf03eb..1225d1cd 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-floodsub" edition = "2021" rust-version = "1.56.1" description = "Floodsub protocol for libp2p" -version = "0.40.1" +version = "0.41.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,12 +14,13 @@ categories = ["network-programming", "asynchronous"] cuckoofilter = "0.5.0" fnv = "1.0" futures = "0.3.1" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } log = "0.4" prost = "0.11" rand = "0.8" smallvec = "1.6.1" +thiserror = "1.0.37" [build-dependencies] prost-build = "0.11" diff --git a/protocols/floodsub/src/protocol.rs b/protocols/floodsub/src/protocol.rs index df694b2e..104e92e4 100644 --- a/protocols/floodsub/src/protocol.rs +++ b/protocols/floodsub/src/protocol.rs @@ -26,7 +26,7 @@ use futures::{ }; use libp2p_core::{upgrade, InboundUpgrade, OutboundUpgrade, PeerId, UpgradeInfo}; use prost::Message; -use std::{error, fmt, io, iter, pin::Pin}; +use std::{io, iter, pin::Pin}; /// Implementation of `ConnectionUpgrade` for the floodsub protocol. #[derive(Debug, Clone, Default)] @@ -59,7 +59,7 @@ where fn upgrade_inbound(self, mut socket: TSocket, _: Self::Info) -> Self::Future { Box::pin(async move { let packet = upgrade::read_length_prefixed(&mut socket, 2048).await?; - let rpc = rpc_proto::Rpc::decode(&packet[..])?; + let rpc = rpc_proto::Rpc::decode(&packet[..]).map_err(DecodeError)?; let mut messages = Vec::with_capacity(rpc.publish.len()); for publish in rpc.publish.into_iter() { @@ -92,53 +92,22 @@ where } /// Reach attempt interrupt errors. -#[derive(Debug)] +#[derive(thiserror::Error, Debug)] pub enum FloodsubDecodeError { /// Error when reading the packet from the socket. - ReadError(io::Error), + #[error("Failed to read from socket")] + ReadError(#[from] io::Error), /// Error when decoding the raw buffer into a protobuf. - ProtobufError(prost::DecodeError), + #[error("Failed to decode protobuf")] + ProtobufError(#[from] DecodeError), /// Error when parsing the `PeerId` in the message. + #[error("Failed to decode PeerId from message")] InvalidPeerId, } -impl From for FloodsubDecodeError { - fn from(err: io::Error) -> Self { - FloodsubDecodeError::ReadError(err) - } -} - -impl From for FloodsubDecodeError { - fn from(err: prost::DecodeError) -> Self { - FloodsubDecodeError::ProtobufError(err) - } -} - -impl fmt::Display for FloodsubDecodeError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self { - FloodsubDecodeError::ReadError(ref err) => { - write!(f, "Error while reading from socket: {}", err) - } - FloodsubDecodeError::ProtobufError(ref err) => { - write!(f, "Error while decoding protobuf: {}", err) - } - FloodsubDecodeError::InvalidPeerId => { - write!(f, "Error while decoding PeerId from message") - } - } - } -} - -impl error::Error for FloodsubDecodeError { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - match *self { - FloodsubDecodeError::ReadError(ref err) => Some(err), - FloodsubDecodeError::ProtobufError(ref err) => Some(err), - FloodsubDecodeError::InvalidPeerId => None, - } - } -} +#[derive(thiserror::Error, Debug)] +#[error(transparent)] +pub struct DecodeError(prost::DecodeError); /// An RPC received by the floodsub system. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/protocols/gossipsub/CHANGELOG.md b/protocols/gossipsub/CHANGELOG.md index 555c146a..3e10bb3e 100644 --- a/protocols/gossipsub/CHANGELOG.md +++ b/protocols/gossipsub/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.43.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.42.0 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index cc337869..4f34aada 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-gossipsub" edition = "2021" rust-version = "1.56.1" description = "Gossipsub protocol for libp2p" -version = "0.42.1" +version = "0.43.0" authors = ["Age Manning "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,8 +11,8 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } bytes = "1.0" byteorder = "1.3.4" fnv = "1.0.7" diff --git a/protocols/identify/CHANGELOG.md b/protocols/identify/CHANGELOG.md index f60ace8a..f06b8602 100644 --- a/protocols/identify/CHANGELOG.md +++ b/protocols/identify/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.41.0 [unreleased] + +- Update to `prost-codec` `v0.3.0`. + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.40.0 - Update dependencies. diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index d52155ba..c0d05b70 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-identify" edition = "2021" rust-version = "1.56.1" description = "Nodes identifcation protocol for libp2p" -version = "0.40.0" +version = "0.41.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,11 +14,11 @@ categories = ["network-programming", "asynchronous"] asynchronous-codec = "0.6" futures = "0.3.1" futures-timer = "3.0.2" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } log = "0.4.1" lru = "0.8.0" -prost-codec = { version = "0.2", path = "../../misc/prost-codec" } +prost-codec = { version = "0.3", path = "../../misc/prost-codec" } prost = "0.11" smallvec = "1.6.1" thiserror = "1.0" diff --git a/protocols/identify/src/protocol.rs b/protocols/identify/src/protocol.rs index 470e926d..1a969c6a 100644 --- a/protocols/identify/src/protocol.rs +++ b/protocols/identify/src/protocol.rs @@ -259,32 +259,16 @@ impl TryFrom for Info { #[derive(Debug, Error)] pub enum UpgradeError { - #[error("Failed to encode or decode")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("I/O interaction failed")] - Io( - #[from] - #[source] - io::Error, - ), + Io(#[from] io::Error), #[error("Stream closed")] StreamClosed, #[error("Failed decoding multiaddr")] - Multiaddr( - #[from] - #[source] - multiaddr::Error, - ), + Multiaddr(#[from] multiaddr::Error), #[error("Failed decoding public key")] - PublicKey( - #[from] - #[source] - identity::error::DecodingError, - ), + PublicKey(#[from] identity::error::DecodingError), } #[cfg(test)] diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index 9a76bb9c..3d996c67 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.42.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.41.0 - Remove deprecated `set_protocol_name()` from `KademliaConfig` & `KademliaProtocolConfig`. diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 89354c74..8f91f341 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-kad" edition = "2021" rust-version = "1.56.1" description = "Kademlia protocol for libp2p" -version = "0.41.0" +version = "0.42.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -18,8 +18,8 @@ fnv = "1.0" asynchronous-codec = "0.6" futures = "0.3.1" log = "0.4" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } prost = "0.11" rand = "0.8" sha2 = "0.10.0" diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index 66a2ee57..33f9816e 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.42.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.41.0 - Remove default features. If you previously depended on `async-io` you need to enable this explicitly now. See [PR 2918]. diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 1209d670..57290435 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-mdns" edition = "2021" rust-version = "1.56.1" -version = "0.41.0" +version = "0.42.0" description = "Implementation of the libp2p mDNS discovery method" authors = ["Parity Technologies "] license = "MIT" @@ -15,8 +15,8 @@ data-encoding = "2.3.2" dns-parser = "0.8.0" futures = "0.3.13" if-watch = "2.0.0" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.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 bcdcdf9a..d9011e22 100644 --- a/protocols/ping/CHANGELOG.md +++ b/protocols/ping/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.41.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.40.0 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 51c1f8e7..c26dbb22 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-ping" edition = "2021" rust-version = "1.56.1" description = "Ping protocol for libp2p" -version = "0.40.1" +version = "0.41.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,8 +14,8 @@ categories = ["network-programming", "asynchronous"] futures = "0.3.1" futures-timer = "3.0.2" instant = "0.1.11" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } log = "0.4.1" rand = "0.8" void = "1.0" diff --git a/protocols/relay/CHANGELOG.md b/protocols/relay/CHANGELOG.md index b21d4123..088dd802 100644 --- a/protocols/relay/CHANGELOG.md +++ b/protocols/relay/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.14.0 [unreleased] + +- Update to `prost-codec` `v0.3.0`. + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.13.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index f4b12ccb..9c6e3528 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-relay" edition = "2021" rust-version = "1.56.1" description = "Communications relaying for libp2p" -version = "0.13.0" +version = "0.14.0" authors = ["Parity Technologies ", "Max Inden "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -17,11 +17,11 @@ either = "1.6.0" futures = "0.3.1" futures-timer = "3" instant = "0.1.11" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } log = "0.4" pin-project = "1" -prost-codec = { version = "0.2", path = "../../misc/prost-codec" } +prost-codec = { version = "0.3", path = "../../misc/prost-codec" } prost = "0.11" rand = "0.8.4" smallvec = "1.6.1" diff --git a/protocols/relay/src/v2/protocol/inbound_hop.rs b/protocols/relay/src/v2/protocol/inbound_hop.rs index 2a6cf01c..48c851c7 100644 --- a/protocols/relay/src/v2/protocol/inbound_hop.rs +++ b/protocols/relay/src/v2/protocol/inbound_hop.rs @@ -104,12 +104,8 @@ impl From for UpgradeError { #[derive(Debug, Error)] pub enum FatalUpgradeError { - #[error("Failed to encode or decode")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Stream closed")] StreamClosed, #[error("Failed to parse response type field.")] diff --git a/protocols/relay/src/v2/protocol/inbound_stop.rs b/protocols/relay/src/v2/protocol/inbound_stop.rs index 8a23f34e..5c761ebd 100644 --- a/protocols/relay/src/v2/protocol/inbound_stop.rs +++ b/protocols/relay/src/v2/protocol/inbound_stop.rs @@ -92,12 +92,8 @@ impl From for UpgradeError { #[derive(Debug, Error)] pub enum FatalUpgradeError { - #[error("Failed to encode or decode")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Stream closed")] StreamClosed, #[error("Failed to parse response type field.")] diff --git a/protocols/relay/src/v2/protocol/outbound_hop.rs b/protocols/relay/src/v2/protocol/outbound_hop.rs index c8381df3..c8b6bd4e 100644 --- a/protocols/relay/src/v2/protocol/outbound_hop.rs +++ b/protocols/relay/src/v2/protocol/outbound_hop.rs @@ -233,12 +233,8 @@ pub enum ReservationFailedReason { #[derive(Debug, Error)] pub enum FatalUpgradeError { - #[error("Failed to encode or decode")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Stream closed")] StreamClosed, #[error("Expected 'status' field to be set.")] diff --git a/protocols/relay/src/v2/protocol/outbound_stop.rs b/protocols/relay/src/v2/protocol/outbound_stop.rs index 26b51407..8bd866f0 100644 --- a/protocols/relay/src/v2/protocol/outbound_stop.rs +++ b/protocols/relay/src/v2/protocol/outbound_stop.rs @@ -146,12 +146,8 @@ pub enum CircuitFailedReason { #[derive(Debug, Error)] pub enum FatalUpgradeError { - #[error("Failed to encode or decode")] - Codec( - #[from] - #[source] - prost_codec::Error, - ), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Stream closed")] StreamClosed, #[error("Expected 'status' field to be set.")] diff --git a/protocols/rendezvous/CHANGELOG.md b/protocols/rendezvous/CHANGELOG.md index 1b858855..8f250415 100644 --- a/protocols/rendezvous/CHANGELOG.md +++ b/protocols/rendezvous/CHANGELOG.md @@ -1,3 +1,13 @@ +# 0.11.0 [unreleased] + +- De- and encode protobuf messages using `prost-codec`. See [PR 3058]. + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + +[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 + # 0.10.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index 378ec567..4f53d3cf 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-rendezvous" edition = "2021" rust-version = "1.56.1" description = "Rendezvous protocol for libp2p" -version = "0.10.0" +version = "0.11.0" authors = ["The COMIT guys "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,19 +12,20 @@ categories = ["network-programming", "asynchronous"] [dependencies] asynchronous-codec = "0.6" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } -prost = "0.11" -void = "1" -log = "0.4" -futures = { version = "0.3", default-features = false, features = ["std"] } -thiserror = "1" -unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } bimap = "0.6.1" -sha2 = "0.10" -rand = "0.8" +futures = { version = "0.3", default-features = false, features = ["std"] } futures-timer = "3.0.2" instant = "0.1.11" +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } +log = "0.4" +prost = "0.11" +prost-codec = { version = "0.3.0", path = "../../misc/prost-codec" } +rand = "0.8" +sha2 = "0.10" +thiserror = "1" +unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } +void = "1" [dev-dependencies] async-trait = "0.1" diff --git a/protocols/rendezvous/src/codec.rs b/protocols/rendezvous/src/codec.rs index 375ebd6c..88af5a1f 100644 --- a/protocols/rendezvous/src/codec.rs +++ b/protocols/rendezvous/src/codec.rs @@ -19,12 +19,11 @@ // DEALINGS IN THE SOFTWARE. use crate::DEFAULT_TTL; -use asynchronous_codec::{Bytes, BytesMut, Decoder, Encoder}; +use asynchronous_codec::{BytesMut, Decoder, Encoder}; use libp2p_core::{peer_record, signed_envelope, PeerRecord, SignedEnvelope}; use rand::RngCore; use std::convert::{TryFrom, TryInto}; use std::fmt; -use unsigned_varint::codec::UviBytes; pub type Ttl = u64; @@ -201,16 +200,14 @@ pub enum ErrorCode { } pub struct RendezvousCodec { - /// Codec to encode/decode the Unsigned varint length prefix of the frames. - length_codec: UviBytes, + inner: prost_codec::Codec, } impl Default for RendezvousCodec { fn default() -> Self { - let mut length_codec = UviBytes::default(); - length_codec.set_max_len(1024 * 1024); // 1MB - - Self { length_codec } + Self { + inner: prost_codec::Codec::new(1024 * 1024), // 1MB + } } } @@ -219,18 +216,7 @@ impl Encoder for RendezvousCodec { type Error = Error; fn encode(&mut self, item: Self::Item, dst: &mut BytesMut) -> Result<(), Self::Error> { - use prost::Message; - - let message = wire::Message::from(item); - - let mut buf = Vec::with_capacity(message.encoded_len()); - - message - .encode(&mut buf) - .expect("Buffer has sufficient capacity"); - - // Length prefix the protobuf message, ensuring the max limit is not hit - self.length_codec.encode(Bytes::from(buf), dst)?; + self.inner.encode(wire::Message::from(item), dst)?; Ok(()) } @@ -241,25 +227,19 @@ impl Decoder for RendezvousCodec { type Error = Error; fn decode(&mut self, src: &mut BytesMut) -> Result, Self::Error> { - use prost::Message; - - let message = match self.length_codec.decode(src)? { + let message = match self.inner.decode(src)? { Some(p) => p, None => return Ok(None), }; - let message = wire::Message::decode(message)?; - Ok(Some(message.try_into()?)) } } #[derive(Debug, thiserror::Error)] pub enum Error { - #[error("Failed to encode message as bytes")] - Encode(#[from] prost::EncodeError), - #[error("Failed to decode message from bytes")] - Decode(#[from] prost::DecodeError), + #[error(transparent)] + Codec(#[from] prost_codec::Error), #[error("Failed to read/write")] Io(#[from] std::io::Error), #[error("Failed to convert wire message to internal data model")] diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index a48d74ee..f70e2f99 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.23.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + +- Update to `libp2p-swarm` `v0.41.0`. + # 0.22.0 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index f35bf92f..63df7cd5 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-request-response" edition = "2021" rust-version = "1.56.1" description = "Generic Request/Response Protocols" -version = "0.22.1" +version = "0.23.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -15,8 +15,8 @@ async-trait = "0.1" bytes = "1" futures = "0.3.1" instant = "0.1.11" -libp2p-core = { version = "0.37.0", path = "../../core" } -libp2p-swarm = { version = "0.40.0", path = "../../swarm" } +libp2p-core = { version = "0.38.0", path = "../../core" } +libp2p-swarm = { version = "0.41.0", path = "../../swarm" } log = "0.4.11" rand = "0.8" smallvec = "1.6.1" diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 1758579d..d853fa93 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.41.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.40.0 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index bf3fb3fe..75dd0968 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-swarm" edition = "2021" rust-version = "1.56.1" description = "The libp2p swarm" -version = "0.40.1" +version = "0.41.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -16,7 +16,7 @@ fnv = "1.0" futures = "0.3.1" futures-timer = "3.0.2" instant = "0.1.11" -libp2p-core = { version = "0.37.0", path = "../core" } +libp2p-core = { version = "0.38.0", path = "../core" } log = "0.4" pin-project = "1.0.0" rand = "0.8" diff --git a/transports/deflate/CHANGELOG.md b/transports/deflate/CHANGELOG.md index 941efc42..542184b2 100644 --- a/transports/deflate/CHANGELOG.md +++ b/transports/deflate/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.38.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.37.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/deflate/Cargo.toml b/transports/deflate/Cargo.toml index 999db9f8..144a9af7 100644 --- a/transports/deflate/Cargo.toml +++ b/transports/deflate/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-deflate" edition = "2021" rust-version = "1.56.1" description = "Deflate encryption protocol for libp2p" -version = "0.37.0" +version = "0.38.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } flate2 = "1.0" [dev-dependencies] diff --git a/transports/dns/CHANGELOG.md b/transports/dns/CHANGELOG.md index 6d03b237..c0a79751 100644 --- a/transports/dns/CHANGELOG.md +++ b/transports/dns/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.38.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.37.0 - Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918]. diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index 0bd9afa3..e0d27ba6 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-dns" edition = "2021" rust-version = "1.56.1" description = "DNS transport implementation for libp2p" -version = "0.37.0" +version = "0.38.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,7 +11,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4.1" futures = "0.3.1" async-std-resolver = { version = "0.22", optional = true } diff --git a/transports/noise/CHANGELOG.md b/transports/noise/CHANGELOG.md index ec28bb3f..0c1987bf 100644 --- a/transports/noise/CHANGELOG.md +++ b/transports/noise/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.41.0 [unreleased] + +- Remove `prost::Error` from public API. See [PR 3058]. + +- Update to `libp2p-core` `v0.38.0`. + +[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 + # 0.40.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 3dd07ee8..33800c1e 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-noise" edition = "2021" rust-version = "1.56.1" description = "Cryptographic handshake protocol using the noise framework." -version = "0.40.0" +version = "0.41.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,7 +13,7 @@ bytes = "1" curve25519-dalek = "3.0.0" futures = "0.3.1" lazy_static = "1.2" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4" prost = "0.11" rand = "0.8.3" diff --git a/transports/noise/src/error.rs b/transports/noise/src/error.rs index 4e1d240f..4a9df3a6 100644 --- a/transports/noise/src/error.rs +++ b/transports/noise/src/error.rs @@ -36,11 +36,26 @@ pub enum NoiseError { /// upgrade failed. AuthenticationFailed, /// A handshake payload is invalid. - InvalidPayload(prost::DecodeError), + InvalidPayload(DecodeError), /// A signature was required and could not be created. SigningError(identity::error::SigningError), } +#[derive(Debug)] +pub struct DecodeError(prost::DecodeError); + +impl fmt::Display for DecodeError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.0.fmt(f) + } +} + +impl Error for DecodeError { + fn source(&self) -> Option<&(dyn Error + 'static)> { + self.0.source() + } +} + impl fmt::Display for NoiseError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -81,7 +96,7 @@ impl From for NoiseError { impl From for NoiseError { fn from(e: prost::DecodeError) -> Self { - NoiseError::InvalidPayload(e) + NoiseError::InvalidPayload(DecodeError(e)) } } diff --git a/transports/plaintext/CHANGELOG.md b/transports/plaintext/CHANGELOG.md index 93162dfa..6af953ee 100644 --- a/transports/plaintext/CHANGELOG.md +++ b/transports/plaintext/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.38.0 [unreleased] + +- Add more specific error reporting and remove `prost::Error` from public API. See [PR 3058]. + +- Update to `libp2p-core` `v0.38.0`. + +[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 + # 0.37.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index 7c2051d2..02317233 100644 --- a/transports/plaintext/Cargo.toml +++ b/transports/plaintext/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-plaintext" edition = "2021" rust-version = "1.56.1" description = "Plaintext encryption dummy protocol for libp2p" -version = "0.37.0" +version = "0.38.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,10 +11,10 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] +asynchronous-codec = "0.6" bytes = "1" futures = "0.3.1" -asynchronous-codec = "0.6" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4.8" prost = "0.11" unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } diff --git a/transports/plaintext/src/error.rs b/transports/plaintext/src/error.rs index 9f512c4f..63930602 100644 --- a/transports/plaintext/src/error.rs +++ b/transports/plaintext/src/error.rs @@ -28,17 +28,40 @@ pub enum PlainTextError { IoError(IoError), /// Failed to parse the handshake protobuf message. - InvalidPayload(Option), + InvalidPayload(DecodeError), + + /// Failed to parse public key from bytes in protobuf message. + InvalidPublicKey(libp2p_core::identity::error::DecodingError), + + /// Failed to parse the [`PeerId`](libp2p_core::PeerId) from bytes in the protobuf message. + InvalidPeerId(libp2p_core::multihash::Error), /// The peer id of the exchange isn't consistent with the remote public key. - InvalidPeerId, + PeerIdMismatch, +} + +#[derive(Debug)] +pub struct DecodeError(prost::DecodeError); + +impl fmt::Display for DecodeError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.0.fmt(f) + } +} + +impl error::Error for DecodeError { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + self.0.source() + } } impl error::Error for PlainTextError { fn cause(&self) -> Option<&dyn error::Error> { match *self { PlainTextError::IoError(ref err) => Some(err), - PlainTextError::InvalidPayload(Some(ref err)) => Some(err), + PlainTextError::InvalidPayload(ref err) => Some(err), + PlainTextError::InvalidPublicKey(ref err) => Some(err), + PlainTextError::InvalidPeerId(ref err) => Some(err), _ => None, } } @@ -48,13 +71,12 @@ impl fmt::Display for PlainTextError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { match self { PlainTextError::IoError(e) => write!(f, "I/O error: {}", e), - PlainTextError::InvalidPayload(protobuf_error) => match protobuf_error { - Some(e) => write!(f, "Protobuf error: {}", e), - None => f.write_str("Failed to parse one of the handshake protobuf messages"), - }, - PlainTextError::InvalidPeerId => f.write_str( + PlainTextError::InvalidPayload(_) => f.write_str("Failed to decode protobuf"), + PlainTextError::PeerIdMismatch => f.write_str( "The peer id of the exchange isn't consistent with the remote public key", ), + PlainTextError::InvalidPublicKey(_) => f.write_str("Failed to decode public key"), + PlainTextError::InvalidPeerId(_) => f.write_str("Failed to decode PeerId"), } } } @@ -67,6 +89,18 @@ impl From for PlainTextError { impl From for PlainTextError { fn from(err: prost::DecodeError) -> PlainTextError { - PlainTextError::InvalidPayload(Some(err)) + PlainTextError::InvalidPayload(DecodeError(err)) + } +} + +impl From for PlainTextError { + fn from(err: libp2p_core::identity::error::DecodingError) -> PlainTextError { + PlainTextError::InvalidPublicKey(err) + } +} + +impl From for PlainTextError { + fn from(err: libp2p_core::multihash::Error) -> PlainTextError { + PlainTextError::InvalidPeerId(err) } } diff --git a/transports/plaintext/src/handshake.rs b/transports/plaintext/src/handshake.rs index 6534c6d7..0e17ac5b 100644 --- a/transports/plaintext/src/handshake.rs +++ b/transports/plaintext/src/handshake.rs @@ -73,34 +73,14 @@ impl HandshakeContext { self, exchange_bytes: BytesMut, ) -> Result, PlainTextError> { - let prop = match Exchange::decode(exchange_bytes) { - Ok(prop) => prop, - Err(e) => { - debug!("failed to parse remote's exchange protobuf message"); - return Err(PlainTextError::InvalidPayload(Some(e))); - } - }; + let prop = Exchange::decode(exchange_bytes)?; - let pb_pubkey = prop.pubkey.unwrap_or_default(); - let public_key = match PublicKey::from_protobuf_encoding(pb_pubkey.as_slice()) { - Ok(p) => p, - Err(_) => { - debug!("failed to parse remote's exchange's pubkey protobuf"); - return Err(PlainTextError::InvalidPayload(None)); - } - }; - let peer_id = match PeerId::from_bytes(&prop.id.unwrap_or_default()) { - Ok(p) => p, - Err(_) => { - debug!("failed to parse remote's exchange's id protobuf"); - return Err(PlainTextError::InvalidPayload(None)); - } - }; + let public_key = PublicKey::from_protobuf_encoding(&prop.pubkey.unwrap_or_default())?; + let peer_id = PeerId::from_bytes(&prop.id.unwrap_or_default())?; // Check the validity of the remote's `Exchange`. if peer_id != public_key.to_peer_id() { - debug!("the remote's `PeerId` isn't consistent with the remote's public key"); - return Err(PlainTextError::InvalidPeerId); + return Err(PlainTextError::PeerIdMismatch); } Ok(HandshakeContext { diff --git a/transports/tcp/CHANGELOG.md b/transports/tcp/CHANGELOG.md index 45d9a4b1..4a9ed144 100644 --- a/transports/tcp/CHANGELOG.md +++ b/transports/tcp/CHANGELOG.md @@ -4,6 +4,8 @@ - Remove `TcpListenStream` and `TcpListenerEvent` from public API. See [PR 2961]. +- Update to `libp2p-core` `v0.38.0`. + [PR 2961]: https://github.com/libp2p/rust-libp2p/pull/2961 # 0.37.0 diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 1eaf27fd..502e05cd 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -16,7 +16,7 @@ futures = "0.3.8" futures-timer = "3.0" if-watch = "2.0.0" libc = "0.2.80" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4.11" socket2 = { version = "0.4.0", features = ["all"] } tokio-crate = { package = "tokio", version = "1.19.0", default-features = false, features = ["net"], optional = true } diff --git a/transports/tls/Cargo.toml b/transports/tls/Cargo.toml index ac8244ae..2882d85c 100644 --- a/transports/tls/Cargo.toml +++ b/transports/tls/Cargo.toml @@ -8,7 +8,7 @@ exclude = ["src/test_assets"] [dependencies] futures = { version = "0.3.24", default-features = false } futures-rustls = "0.22.2" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } rcgen = "0.9.2" ring = "0.16.20" thiserror = "1.0.36" diff --git a/transports/uds/CHANGELOG.md b/transports/uds/CHANGELOG.md index 97ae4721..2f1426af 100644 --- a/transports/uds/CHANGELOG.md +++ b/transports/uds/CHANGELOG.md @@ -1,3 +1,5 @@ +# 0.37.0 [unreleased] + # 0.36.0 - Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918]. diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index 5ec9ba8c..8bad4c54 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-uds" edition = "2021" rust-version = "1.56.1" description = "Unix domain sockets transport for libp2p" -version = "0.36.0" +version = "0.37.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,7 +12,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.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4.1" futures = "0.3.1" tokio = { version = "1.15", default-features = false, features = ["net"], optional = true } diff --git a/transports/wasm-ext/CHANGELOG.md b/transports/wasm-ext/CHANGELOG.md index ea8ef101..8cb87863 100644 --- a/transports/wasm-ext/CHANGELOG.md +++ b/transports/wasm-ext/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.38.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.37.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml index 50ea584c..e6317240 100644 --- a/transports/wasm-ext/Cargo.toml +++ b/transports/wasm-ext/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-wasm-ext" edition = "2021" rust-version = "1.56.1" description = "Allows passing in an external transport in a WASM environment" -version = "0.37.0" +version = "0.38.0" authors = ["Pierre Krieger "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.1" js-sys = "0.3.50" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } 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 dde91054..382b0951 100644 --- a/transports/websocket/CHANGELOG.md +++ b/transports/websocket/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.40.0 [unreleased] + +- Update to `libp2p-core` `v0.38.0`. + # 0.39.0 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 078fd748..4b5e1da6 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-websocket" edition = "2021" rust-version = "1.56.1" description = "WebSocket transport for libp2p" -version = "0.39.0" +version = "0.40.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] futures-rustls = "0.22" either = "1.5.3" futures = "0.3.1" -libp2p-core = { version = "0.37.0", path = "../../core" } +libp2p-core = { version = "0.38.0", path = "../../core" } log = "0.4.8" parking_lot = "0.12.0" quicksink = "0.1"