From 5a7dec271e2ca68e89dda31d8ca9f41f4e107550 Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Wed, 31 Aug 2022 13:31:29 +0300 Subject: [PATCH 1/6] Allow disabling rsa identity, so ring could be disabled --- core/Cargo.toml | 5 +++-- core/src/identity.rs | 22 +++++++++++----------- core/src/identity/error.rs | 1 + 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index d20934adf1e..d772464e61f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -40,7 +40,7 @@ zeroize = "1" _serde = { package = "serde", version = "1", optional = true, features = ["derive"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false } +ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true} [dev-dependencies] async-std = { version = "1.6.2", features = ["attributes"] } @@ -59,9 +59,10 @@ serde_json = "1.0" prost-build = "0.11" [features] -default = [ "secp256k1", "ecdsa" ] +default = [ "secp256k1", "ecdsa", "rsa" ] secp256k1 = [ "libsecp256k1" ] ecdsa = [ "p256" ] +rsa = [ "ring" ] serde = ["multihash/serde-codec", "_serde"] [[bench]] diff --git a/core/src/identity.rs b/core/src/identity.rs index a2b3943d0e9..4f09c26b230 100644 --- a/core/src/identity.rs +++ b/core/src/identity.rs @@ -35,7 +35,7 @@ #[cfg(feature = "ecdsa")] pub mod ecdsa; pub mod ed25519; -#[cfg(not(target_arch = "wasm32"))] +#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] pub mod rsa; #[cfg(feature = "secp256k1")] pub mod secp256k1; @@ -68,7 +68,7 @@ use std::convert::{TryFrom, TryInto}; pub enum Keypair { /// An Ed25519 keypair. Ed25519(ed25519::Keypair), - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] /// An RSA keypair. Rsa(rsa::Keypair), /// A Secp256k1 keypair. @@ -101,7 +101,7 @@ impl Keypair { /// format (i.e. unencrypted) as defined in [RFC5208]. /// /// [RFC5208]: https://tools.ietf.org/html/rfc5208#section-5 - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] pub fn rsa_from_pkcs8(pkcs8_der: &mut [u8]) -> Result { rsa::Keypair::from_pkcs8(pkcs8_der).map(Keypair::Rsa) } @@ -122,7 +122,7 @@ impl Keypair { use Keypair::*; match self { Ed25519(ref pair) => Ok(pair.sign(msg)), - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] Rsa(ref pair) => pair.sign(msg), #[cfg(feature = "secp256k1")] Secp256k1(ref pair) => pair.secret().sign(msg), @@ -136,7 +136,7 @@ impl Keypair { use Keypair::*; match self { Ed25519(pair) => PublicKey::Ed25519(pair.public()), - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] Rsa(pair) => PublicKey::Rsa(pair.public()), #[cfg(feature = "secp256k1")] Secp256k1(pair) => PublicKey::Secp256k1(pair.public().clone()), @@ -154,7 +154,7 @@ impl Keypair { r#type: keys_proto::KeyType::Ed25519.into(), data: data.encode().into(), }, - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] Self::Rsa(_) => { return Err(DecodingError::new( "Encoding RSA key into Protobuf is unsupported", @@ -218,7 +218,7 @@ impl zeroize::Zeroize for keys_proto::PrivateKey { pub enum PublicKey { /// A public Ed25519 key. Ed25519(ed25519::PublicKey), - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] /// A public RSA key. Rsa(rsa::PublicKey), #[cfg(feature = "secp256k1")] @@ -239,7 +239,7 @@ impl PublicKey { use PublicKey::*; match self { Ed25519(pk) => pk.verify(msg, sig), - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] Rsa(pk) => pk.verify(msg, sig), #[cfg(feature = "secp256k1")] Secp256k1(pk) => pk.verify(msg, sig), @@ -286,7 +286,7 @@ impl From<&PublicKey> for keys_proto::PublicKey { r#type: keys_proto::KeyType::Ed25519 as i32, data: key.encode().to_vec(), }, - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] PublicKey::Rsa(key) => keys_proto::PublicKey { r#type: keys_proto::KeyType::Rsa as i32, data: key.encode_x509(), @@ -316,11 +316,11 @@ impl TryFrom for PublicKey { keys_proto::KeyType::Ed25519 => { ed25519::PublicKey::decode(&pubkey.data).map(PublicKey::Ed25519) } - #[cfg(not(target_arch = "wasm32"))] + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] keys_proto::KeyType::Rsa => { rsa::PublicKey::decode_x509(&pubkey.data).map(PublicKey::Rsa) } - #[cfg(target_arch = "wasm32")] + #[cfg(any(not(feature = "rsa"), target_arch = "wasm32"))] keys_proto::KeyType::Rsa => { log::debug!("support for RSA was disabled at compile-time"); Err(DecodingError::new("Unsupported")) diff --git a/core/src/identity/error.rs b/core/src/identity/error.rs index 76f41278d5d..77afb74089e 100644 --- a/core/src/identity/error.rs +++ b/core/src/identity/error.rs @@ -74,6 +74,7 @@ impl SigningError { } } + #[allow(dead_code)] pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self { Self { source: Some(Box::new(source)), From 14d8066e10268d09a858a85f378e556f250c5ab5 Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Wed, 31 Aug 2022 13:46:55 +0300 Subject: [PATCH 2/6] update changelog --- core/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 8e3bd24906b..6fa0f54099c 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.35.2 + +- Make `ring` dependency optional. See [PR 2860]. + +[PR 2860]: https://github.com/libp2p/rust-libp2p/pull/2860/ + # 0.35.1 - Update to `p256` `v0.11.0`. See [PR 2636]. From 4a2a1a0fad099e085fe24a91ba475fdef23c9b9a Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Wed, 31 Aug 2022 22:22:50 +0300 Subject: [PATCH 3/6] Bump libp2p-core version, fix warnings in tests --- Cargo.toml | 22 +++++++++++----------- core/CHANGELOG.md | 5 +++-- core/Cargo.toml | 2 +- core/src/identity.rs | 2 +- core/src/identity/error.rs | 1 + misc/keygen/Cargo.toml | 2 +- misc/metrics/CHANGELOG.md | 2 ++ misc/metrics/Cargo.toml | 2 +- muxers/mplex/CHANGELOG.md | 4 ++++ muxers/mplex/Cargo.toml | 4 ++-- muxers/yamux/CHANGELOG.md | 4 ++++ muxers/yamux/Cargo.toml | 4 ++-- protocols/autonat/CHANGELOG.md | 2 ++ protocols/autonat/Cargo.toml | 2 +- protocols/dcutr/CHANGELOG.md | 2 ++ protocols/dcutr/Cargo.toml | 2 +- protocols/floodsub/CHANGELOG.md | 2 ++ protocols/floodsub/Cargo.toml | 2 +- protocols/gossipsub/CHANGELOG.md | 2 ++ protocols/gossipsub/Cargo.toml | 2 +- protocols/gossipsub/src/protocol.rs | 7 +++++++ protocols/identify/CHANGELOG.md | 2 ++ protocols/identify/Cargo.toml | 2 +- protocols/kad/CHANGELOG.md | 2 ++ protocols/kad/Cargo.toml | 2 +- protocols/mdns/CHANGELOG.md | 2 ++ protocols/mdns/Cargo.toml | 2 +- protocols/ping/CHANGELOG.md | 2 ++ protocols/ping/Cargo.toml | 2 +- protocols/relay/CHANGELOG.md | 2 ++ protocols/relay/Cargo.toml | 2 +- protocols/rendezvous/CHANGELOG.md | 2 ++ protocols/rendezvous/Cargo.toml | 2 +- protocols/request-response/CHANGELOG.md | 2 ++ protocols/request-response/Cargo.toml | 2 +- swarm/CHANGELOG.md | 2 ++ swarm/Cargo.toml | 2 +- transports/deflate/CHANGELOG.md | 4 ++++ transports/deflate/Cargo.toml | 4 ++-- transports/dns/CHANGELOG.md | 4 ++++ transports/dns/Cargo.toml | 4 ++-- transports/noise/CHANGELOG.md | 4 ++++ transports/noise/Cargo.toml | 4 ++-- transports/noise/src/protocol/x25519.rs | 2 ++ transports/plaintext/CHANGELOG.md | 4 ++++ transports/plaintext/Cargo.toml | 4 ++-- transports/tcp/CHANGELOG.md | 4 ++++ transports/tcp/Cargo.toml | 4 ++-- transports/uds/CHANGELOG.md | 4 ++++ transports/uds/Cargo.toml | 4 ++-- transports/wasm-ext/CHANGELOG.md | 4 ++++ transports/wasm-ext/Cargo.toml | 4 ++-- transports/websocket/CHANGELOG.md | 4 ++++ transports/websocket/Cargo.toml | 4 ++-- 54 files changed, 126 insertions(+), 49 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b64c2f68756..fa2f5b7c619 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,25 +78,25 @@ instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature lazy_static = "1.2" libp2p-autonat = { version = "0.7.0", path = "protocols/autonat", optional = true } -libp2p-core = { version = "0.35.0", path = "core", default-features = false } +libp2p-core = { version = "0.36.0", path = "core", default-features = false } libp2p-dcutr = { version = "0.6.0", path = "protocols/dcutr", optional = true } libp2p-floodsub = { version = "0.39.0", path = "protocols/floodsub", optional = true } libp2p-identify = { version = "0.39.0", path = "protocols/identify", optional = true } libp2p-kad = { version = "0.40.0", path = "protocols/kad", optional = true } libp2p-metrics = { version = "0.9.0", path = "misc/metrics", optional = true } -libp2p-mplex = { version = "0.35.0", path = "muxers/mplex", optional = true } -libp2p-noise = { version = "0.38.0", path = "transports/noise", optional = true } +libp2p-mplex = { version = "0.36.0", path = "muxers/mplex", optional = true } +libp2p-noise = { version = "0.39.0", path = "transports/noise", optional = true } libp2p-ping = { version = "0.39.0", path = "protocols/ping", optional = true } -libp2p-plaintext = { version = "0.35.0", path = "transports/plaintext", optional = true } +libp2p-plaintext = { version = "0.36.0", path = "transports/plaintext", optional = true } libp2p-pnet = { version = "0.22.0", path = "transports/pnet", optional = true } libp2p-relay = { version = "0.12.0", path = "protocols/relay", optional = true } libp2p-rendezvous = { version = "0.9.0", path = "protocols/rendezvous", optional = true } libp2p-request-response = { version = "0.21.0", path = "protocols/request-response", optional = true } libp2p-swarm = { version = "0.39.0", path = "swarm" } libp2p-swarm-derive = { version = "0.30.0", path = "swarm-derive" } -libp2p-uds = { version = "0.34.0", path = "transports/uds", optional = true } -libp2p-wasm-ext = { version = "0.35.0", path = "transports/wasm-ext", default-features = false, optional = true } -libp2p-yamux = { version = "0.39.0", path = "muxers/yamux", optional = true } +libp2p-uds = { version = "0.35.0", path = "transports/uds", optional = true } +libp2p-wasm-ext = { version = "0.36.0", path = "transports/wasm-ext", default-features = false, optional = true } +libp2p-yamux = { version = "0.40.0", path = "muxers/yamux", optional = true } multiaddr = { version = "0.14.0" } parking_lot = "0.12.0" pin-project = "1.0.0" @@ -104,11 +104,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.35.0", path = "transports/deflate", optional = true } -libp2p-dns = { version = "0.35.0", path = "transports/dns", optional = true, default-features = false } +libp2p-deflate = { version = "0.36.0", path = "transports/deflate", optional = true } +libp2p-dns = { version = "0.36.0", path = "transports/dns", optional = true, default-features = false } libp2p-mdns = { version = "0.40.0", path = "protocols/mdns", optional = true } -libp2p-tcp = { version = "0.35.0", path = "transports/tcp", default-features = false, optional = true } -libp2p-websocket = { version = "0.37.0", path = "transports/websocket", optional = true } +libp2p-tcp = { version = "0.36.0", path = "transports/tcp", default-features = false, optional = true } +libp2p-websocket = { version = "0.38.0", path = "transports/websocket", optional = true } [target.'cfg(not(target_os = "unknown"))'.dependencies] libp2p-gossipsub = { version = "0.41.0", path = "protocols/gossipsub", optional = true } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 6fa0f54099c..f442d68bdb2 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,6 +1,7 @@ -# 0.35.2 +# 0.36.0 [unreleased] -- Make `ring` dependency optional. See [PR 2860]. +- Make RSA keypair support optional. To enable RSA support, `rsa` feature should be enabled. + See [PR 2860]. [PR 2860]: https://github.com/libp2p/rust-libp2p/pull/2860/ diff --git a/core/Cargo.toml b/core/Cargo.toml index d772464e61f..1e55d6a1fc9 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.35.1" +version = "0.36.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/core/src/identity.rs b/core/src/identity.rs index 4f09c26b230..73be1c78b57 100644 --- a/core/src/identity.rs +++ b/core/src/identity.rs @@ -68,8 +68,8 @@ use std::convert::{TryFrom, TryInto}; pub enum Keypair { /// An Ed25519 keypair. Ed25519(ed25519::Keypair), - #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] /// An RSA keypair. + #[cfg(all(feature = "rsa", not(target_arch = "wasm32")))] Rsa(rsa::Keypair), /// A Secp256k1 keypair. #[cfg(feature = "secp256k1")] diff --git a/core/src/identity/error.rs b/core/src/identity/error.rs index 77afb74089e..b56f56c14b3 100644 --- a/core/src/identity/error.rs +++ b/core/src/identity/error.rs @@ -67,6 +67,7 @@ pub struct SigningError { /// An error during encoding of key material. impl SigningError { + #[allow(dead_code)] pub(crate) fn new(msg: S) -> Self { Self { msg: msg.to_string(), diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index 4be54014f0a..36e01709df9 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -13,5 +13,5 @@ clap = {version = "3.1.6", features = ["derive"]} zeroize = "1" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" -libp2p-core = { path = "../../core", default-features = false, version = "0.35.0"} +libp2p-core = { path = "../../core", default-features = false, version = "0.36.0"} base64 = "0.13.0" diff --git a/misc/metrics/CHANGELOG.md b/misc/metrics/CHANGELOG.md index 72007e39c8b..974ff3ceac1 100644 --- a/misc/metrics/CHANGELOG.md +++ b/misc/metrics/CHANGELOG.md @@ -12,6 +12,8 @@ - Update to `libp2p-kad` `v0.40.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.8.0 - Update to `libp2p-swarm` `v0.38.0`. diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index fe2e4f3ec85..30df869248c 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -19,7 +19,7 @@ relay = ["libp2p-relay"] dcutr = ["libp2p-dcutr"] [dependencies] -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-dcutr = { version = "0.6.0", path = "../../protocols/dcutr", optional = true } libp2p-identify = { version = "0.39.0", path = "../../protocols/identify", optional = true } libp2p-kad = { version = "0.40.0", path = "../../protocols/kad", optional = true } diff --git a/muxers/mplex/CHANGELOG.md b/muxers/mplex/CHANGELOG.md index 45f2c217ce0..d70a1ff4647 100644 --- a/muxers/mplex/CHANGELOG.md +++ b/muxers/mplex/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.36.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0` + # 0.35.0 - Update to `libp2p-core` `v0.35.0` diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index ac053a5020f..1e4f6974aa3 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.35.0" +version = "0.36.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } log = "0.4" nohash-hasher = "0.2" parking_lot = "0.12" diff --git a/muxers/yamux/CHANGELOG.md b/muxers/yamux/CHANGELOG.md index 5544ad15ab4..bd5e89a4421 100644 --- a/muxers/yamux/CHANGELOG.md +++ b/muxers/yamux/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.40.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0` + # 0.39.0 - Update to `libp2p-core` `v0.35.0` diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index 02dfb832d8d..1ee7b4ae667 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.39.0" +version = "0.40.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } parking_lot = "0.12" thiserror = "1.0" yamux = "0.10.0" diff --git a/protocols/autonat/CHANGELOG.md b/protocols/autonat/CHANGELOG.md index da0fa1bd1f7..aadcb1ee4be 100644 --- a/protocols/autonat/CHANGELOG.md +++ b/protocols/autonat/CHANGELOG.md @@ -4,6 +4,8 @@ - Update to `libp2p-request-response` `v0.21.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.6.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index e6818a74817..b5fc9760d6d 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -18,7 +18,7 @@ async-trait = "0.1" futures = "0.3" futures-timer = "3.0" instant = "0.1" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } libp2p-request-response = { version = "0.21.0", path = "../request-response" } log = "0.4" diff --git a/protocols/dcutr/CHANGELOG.md b/protocols/dcutr/CHANGELOG.md index 16258919748..88be8bd10d0 100644 --- a/protocols/dcutr/CHANGELOG.md +++ b/protocols/dcutr/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.5.1 - Make default features of `libp2p-core` optional. See [PR 2836]. diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index 08d2815c6d9..bc015ab0d80 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -17,7 +17,7 @@ either = "1.6.0" futures = "0.3.1" futures-timer = "3.0" instant = "0.1.11" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4" prost-codec = { version = "0.2", path = "../../misc/prost-codec" } diff --git a/protocols/floodsub/CHANGELOG.md b/protocols/floodsub/CHANGELOG.md index 9f8ea64c43c..4c3d9888c4f 100644 --- a/protocols/floodsub/CHANGELOG.md +++ b/protocols/floodsub/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.38.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index 2b9ef8ee402..58977415005 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] cuckoofilter = "0.5.0" fnv = "1.0" futures = "0.3.1" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4" prost = "0.11" diff --git a/protocols/gossipsub/CHANGELOG.md b/protocols/gossipsub/CHANGELOG.md index 48993c987fb..6ef94a73e63 100644 --- a/protocols/gossipsub/CHANGELOG.md +++ b/protocols/gossipsub/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.40.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index c551d59cb14..2adccfd6607 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] libp2p-swarm = { version = "0.39.0", path = "../../swarm" } -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } bytes = "1.0" byteorder = "1.3.4" fnv = "1.0.7" diff --git a/protocols/gossipsub/src/protocol.rs b/protocols/gossipsub/src/protocol.rs index ce337c96455..0eb5f4ee56b 100644 --- a/protocols/gossipsub/src/protocol.rs +++ b/protocols/gossipsub/src/protocol.rs @@ -613,6 +613,7 @@ mod tests { struct TestKeypair(Keypair); impl Arbitrary for TestKeypair { + #[cfg(feature = "rsa")] fn arbitrary(g: &mut G) -> Self { let keypair = if g.gen() { // Small enough to be inlined. @@ -624,6 +625,12 @@ mod tests { }; TestKeypair(keypair) } + + #[cfg(not(feature = "rsa"))] + fn arbitrary(_g: &mut G) -> Self { + // Small enough to be inlined. + TestKeypair(Keypair::generate_ed25519()) + } } impl std::fmt::Debug for TestKeypair { diff --git a/protocols/identify/CHANGELOG.md b/protocols/identify/CHANGELOG.md index 596e6dcb0eb..97acce14812 100644 --- a/protocols/identify/CHANGELOG.md +++ b/protocols/identify/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.38.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index d0bc65379ad..f147c5bb2c8 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] asynchronous-codec = "0.6" futures = "0.3.1" futures-timer = "3.0.2" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4.1" lru = "0.7.2" diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index 380604b0b66..d8a60f30ef0 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.39.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index bf7d0957bd3..5ccf32b9de8 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -18,7 +18,7 @@ fnv = "1.0" asynchronous-codec = "0.6" futures = "0.3.1" log = "0.4" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } prost = "0.11" rand = "0.7.2" diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index a6b05044fa5..74e8b931eef 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.39.0 - Update to `libp2p-swarm` `v0.38.0`. diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 306f052cc69..1fccc8c4f9d 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -17,7 +17,7 @@ dns-parser = "0.8.0" futures = "0.3.13" if-watch = "1.1.1" lazy_static = "1.4.0" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4.14" rand = "0.8.3" diff --git a/protocols/ping/CHANGELOG.md b/protocols/ping/CHANGELOG.md index cf1f2fedf42..a7170eb0569 100644 --- a/protocols/ping/CHANGELOG.md +++ b/protocols/ping/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.38.0 - Update to `libp2p-swarm` `v0.38.0`. diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 568f8f83aac..aa2b596d5f1 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] futures = "0.3.1" futures-timer = "3.0.2" instant = "0.1.11" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4.1" rand = "0.7.2" diff --git a/protocols/relay/CHANGELOG.md b/protocols/relay/CHANGELOG.md index d6245cd5c45..6206eb34514 100644 --- a/protocols/relay/CHANGELOG.md +++ b/protocols/relay/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.11.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index ee059d02d50..41964edcf41 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -17,7 +17,7 @@ either = "1.6.0" futures = "0.3.1" futures-timer = "3" instant = "0.1.11" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4" pin-project = "1" diff --git a/protocols/rendezvous/CHANGELOG.md b/protocols/rendezvous/CHANGELOG.md index cadc355e407..86838071410 100644 --- a/protocols/rendezvous/CHANGELOG.md +++ b/protocols/rendezvous/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.8.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index a21dd300447..fadcaf59580 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] asynchronous-codec = "0.6" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } prost = "0.11" void = "1" diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index aef9f49f72f..97a3d2f55d0 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -2,6 +2,8 @@ - Update to `libp2p-swarm` `v0.39.0`. +- Update to `libp2p-core` `v0.36.0`. + # 0.20.0 - Update to `libp2p-swarm` `v0.38.0`. diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index c2649de6012..76e802cfca4 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1" bytes = "1" futures = "0.3.1" instant = "0.1.11" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } libp2p-swarm = { version = "0.39.0", path = "../../swarm" } log = "0.4.11" rand = "0.7" diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 75add0d524a..6498ce56835 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -3,6 +3,8 @@ - Remove deprecated `NetworkBehaviourEventProcess`. See [libp2p-swarm v0.38.0 changelog entry] for migration path. +- Update to `libp2p-core` `v0.36.0`. + [libp2p-swarm v0.38.0 changelog entry]: https://github.com/libp2p/rust-libp2p/blob/master/swarm/CHANGELOG.md#0380 # 0.38.0 diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index 6f4a87adb0d..a22b114f82e 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -16,7 +16,7 @@ fnv = "1.0" futures = "0.3.1" futures-timer = "3.0.2" instant = "0.1.11" -libp2p-core = { version = "0.35.0", path = "../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../core", default-features = false } log = "0.4" pin-project = "1.0.0" rand = "0.7" diff --git a/transports/deflate/CHANGELOG.md b/transports/deflate/CHANGELOG.md index a2e4112caa2..01dbbe84cb5 100644 --- a/transports/deflate/CHANGELOG.md +++ b/transports/deflate/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.36.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.35.0 - Update to `libp2p-core` `v0.35.0`. diff --git a/transports/deflate/Cargo.toml b/transports/deflate/Cargo.toml index 4ac8661d0a3..904500c1cd0 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.35.0" +version = "0.36.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } flate2 = "1.0" [dev-dependencies] diff --git a/transports/dns/CHANGELOG.md b/transports/dns/CHANGELOG.md index 6c8a49af7b4..168961e9aa5 100644 --- a/transports/dns/CHANGELOG.md +++ b/transports/dns/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.36.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.35.0 - Update to `libp2p-core` `v0.35.0`. diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index 46ca3aca1af..51c9b688c73 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.35.0" +version = "0.36.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } log = "0.4.1" futures = "0.3.1" async-std-resolver = { version = "0.21", optional = true } diff --git a/transports/noise/CHANGELOG.md b/transports/noise/CHANGELOG.md index f17fc29616e..a000bec1d6b 100644 --- a/transports/noise/CHANGELOG.md +++ b/transports/noise/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.39.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.38.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 351b8d826d3..5ee9330818d 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.38.0" +version = "0.39.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } log = "0.4" prost = "0.11" rand = "0.8.3" diff --git a/transports/noise/src/protocol/x25519.rs b/transports/noise/src/protocol/x25519.rs index 297122c325e..0ffa9991ae6 100644 --- a/transports/noise/src/protocol/x25519.rs +++ b/transports/noise/src/protocol/x25519.rs @@ -120,6 +120,7 @@ impl Protocol for X25519 { Ok(PublicKey(X25519(pk))) } + #[allow(irrefutable_let_patterns)] fn linked(id_pk: &identity::PublicKey, dh_pk: &PublicKey) -> bool { if let identity::PublicKey::Ed25519(ref p) = id_pk { PublicKey::from_ed25519(p).as_ref() == dh_pk.as_ref() @@ -162,6 +163,7 @@ impl Keypair { /// > See also: /// > /// > * [Noise: Static Key Reuse](http://www.noiseprotocol.org/noise.html#security-considerations) + #[allow(unreachable_patterns)] pub fn from_identity(id_keys: &identity::Keypair) -> Option> { match id_keys { identity::Keypair::Ed25519(p) => { diff --git a/transports/plaintext/CHANGELOG.md b/transports/plaintext/CHANGELOG.md index 9eb4d5551be..7b962614ee8 100644 --- a/transports/plaintext/CHANGELOG.md +++ b/transports/plaintext/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.36.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.35.0 - Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index 354782d9253..f250c2a4287 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.35.0" +version = "0.36.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } log = "0.4.8" prost = "0.11" unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } diff --git a/transports/tcp/CHANGELOG.md b/transports/tcp/CHANGELOG.md index 8e876fd90a9..d426abca833 100644 --- a/transports/tcp/CHANGELOG.md +++ b/transports/tcp/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.36.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.35.0 - Update to `libp2p-core` `v0.35.0`. diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 7273db58c51..d4577c74252 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-tcp" edition = "2021" rust-version = "1.56.1" description = "TCP/IP transport protocol for libp2p" -version = "0.35.0" +version = "0.36.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -18,7 +18,7 @@ if-watch = { version = "1.1.1", optional = true } if-addrs = { version = "0.7.0", optional = true } ipnet = "2.0.0" libc = "0.2.80" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } 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/uds/CHANGELOG.md b/transports/uds/CHANGELOG.md index b2f4751b63f..371d5698a85 100644 --- a/transports/uds/CHANGELOG.md +++ b/transports/uds/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.35.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.34.0 - Update to `libp2p-core` `v0.35.0`. diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index e00e6ae09f3..3b7f1eb0a3f 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.34.0" +version = "0.35.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } 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 323ee80cbe0..379d044e493 100644 --- a/transports/wasm-ext/CHANGELOG.md +++ b/transports/wasm-ext/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.36.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.35.0 - Update to `libp2p-core` `v0.35.0`. diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml index 34926d04b52..6c6a645c8c2 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.35.0" +version = "0.36.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.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.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 65f9eea1e96..1c8c86ddd47 100644 --- a/transports/websocket/CHANGELOG.md +++ b/transports/websocket/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.38.0 [unreleased] + +- Update to `libp2p-core` `v0.36.0`. + # 0.37.0 - Update to `libp2p-core` `v0.35.0`. diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 49121c4f22b..b470864a959 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.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"] futures-rustls = "0.22" either = "1.5.3" futures = "0.3.1" -libp2p-core = { version = "0.35.0", path = "../../core", default-features = false } +libp2p-core = { version = "0.36.0", path = "../../core", default-features = false } log = "0.4.8" parking_lot = "0.12.0" quicksink = "0.1" From 553b4dde0a230209ea9b8a6b9e56e2286c57423d Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Fri, 2 Sep 2022 16:12:06 +0300 Subject: [PATCH 4/6] Replace #[allow(dead_code)] with conditional compilation --- core/src/identity/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/identity/error.rs b/core/src/identity/error.rs index b56f56c14b3..32c7edc55a4 100644 --- a/core/src/identity/error.rs +++ b/core/src/identity/error.rs @@ -67,7 +67,7 @@ pub struct SigningError { /// An error during encoding of key material. impl SigningError { - #[allow(dead_code)] + #[cfg(any(feature = "secp256k1", feature = "rsa"))] pub(crate) fn new(msg: S) -> Self { Self { msg: msg.to_string(), @@ -75,7 +75,7 @@ impl SigningError { } } - #[allow(dead_code)] + #[cfg(feature = "rsa")] pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self { Self { source: Some(Box::new(source)), From 78402c1a385a503b5351e2293f8b59c6f7af1e8e Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Sun, 4 Sep 2022 12:26:22 +0300 Subject: [PATCH 5/6] Use dep:ring + remove "rsa" feature from defaults --- core/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index 1e55d6a1fc9..626daf2cf8e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -59,10 +59,10 @@ serde_json = "1.0" prost-build = "0.11" [features] -default = [ "secp256k1", "ecdsa", "rsa" ] +default = [ "secp256k1", "ecdsa" ] secp256k1 = [ "libsecp256k1" ] ecdsa = [ "p256" ] -rsa = [ "ring" ] +rsa = [ "dep:ring" ] serde = ["multihash/serde-codec", "_serde"] [[bench]] From 536a068db14d8e7d75499cfb9250a70ed41e2a57 Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Mon, 5 Sep 2022 09:50:15 +0300 Subject: [PATCH 6/6] Add rsa as a default feature for libp2p --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index f24c8df2779..62b8df404f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ default = [ "relay", "request-response", "rendezvous", + "rsa", "secp256k1", "tcp-async-io", "uds", @@ -65,6 +66,7 @@ wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"] websocket = ["dep:libp2p-websocket"] yamux = ["dep:libp2p-yamux"] secp256k1 = ["libp2p-core/secp256k1"] +rsa = ["libp2p-core/rsa"] serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"] [package.metadata.docs.rs]