From 20a51727ba70737488adbe37f47cc79ba7c155a0 Mon Sep 17 00:00:00 2001 From: bochaco Date: Fri, 5 Apr 2024 16:13:02 -0300 Subject: [PATCH 1/7] feat(networking): adding API to perform sybil attack check --- Cargo.lock | 1 + sn_networking/Cargo.toml | 1 + sn_networking/src/lib.rs | 34 ++++++++++++++---- sn_networking/src/sybil.rs | 71 ++++++++++++++++++++++++++++++++++++++ sn_node/src/node.rs | 15 ++++++++ 5 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 sn_networking/src/sybil.rs diff --git a/Cargo.lock b/Cargo.lock index c82f4972be..31191cc9b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7234,6 +7234,7 @@ dependencies = [ "lazy_static", "libp2p", "libp2p-identity", + "num", "prometheus-client", "quickcheck", "rand 0.8.5", diff --git a/sn_networking/Cargo.toml b/sn_networking/Cargo.toml index 91d8424b18..b4009eff6a 100644 --- a/sn_networking/Cargo.toml +++ b/sn_networking/Cargo.toml @@ -49,6 +49,7 @@ hyper = { version = "0.14", features = [ ], optional = true } itertools = "~0.12.1" custom_debug = "~0.6.1" +num = "0.4.1" prometheus-client = { version = "0.22", optional = true } rand = { version = "~0.8.5", features = ["small_rng"] } rayon = "1.8.0" diff --git a/sn_networking/src/lib.rs b/sn_networking/src/lib.rs index 848c8210a8..c09b659426 100644 --- a/sn_networking/src/lib.rs +++ b/sn_networking/src/lib.rs @@ -26,6 +26,7 @@ mod record_store_api; mod relay_manager; mod replication_fetcher; mod spends; +mod sybil; pub mod target_arch; mod transfers; mod transport; @@ -45,7 +46,7 @@ pub use self::{ transfers::{get_raw_signed_spends_from_record, get_signed_spend_from_record}, }; -use self::{cmd::SwarmCmd, error::Result}; +use self::{cmd::SwarmCmd, error::Result, sybil::check_for_sybil_attack}; use backoff::{Error as BackoffError, ExponentialBackoff}; use futures::future::select_all; use libp2p::{ @@ -58,7 +59,7 @@ use rand::Rng; use sn_protocol::{ error::Error as ProtocolError, messages::{ChunkProof, Cmd, Nonce, Query, QueryResponse, Request, Response}, - storage::{RecordType, RetryStrategy}, + storage::{ChunkAddress, RecordType, RetryStrategy}, NetworkAddress, PrettyPrintKBucketKey, PrettyPrintRecordKey, }; use sn_transfers::{MainPubkey, NanoTokens, PaymentQuote, QuotingMetrics}; @@ -67,13 +68,15 @@ use std::{ path::PathBuf, sync::Arc, }; -use tokio::sync::{ - mpsc::{self, Sender}, - oneshot, +use tokio::{ + sync::{ + mpsc::{self, Sender}, + oneshot, + }, + time::Duration, }; - -use tokio::time::Duration; use tracing::trace; +use xor_name::XorName; /// The type of quote for a selected payee. pub type PayeeQuote = (PeerId, MainPubkey, PaymentQuote); @@ -863,6 +866,23 @@ impl Network { Ok(closest_peers.into_iter().cloned().collect()) } + /// Using a random address, check if there is a sybil attack around it + pub async fn perform_sybil_attack_check(&self) { + let random_addr = { + let mut rng = rand::thread_rng(); + let chunk_addr = ChunkAddress::new(XorName::random(&mut rng)); + NetworkAddress::from_chunk_address(chunk_addr) + }; + + match self.get_closest_peers(&random_addr, true).await { + Ok(closest_peers) => match check_for_sybil_attack(&closest_peers).await { + Ok(is_attack) => info!(">>> Sybil attack detection result: {is_attack}"), + Err(err) => error!(">>> Failed to check for sybil attack: {err:?}"), + }, + Err(err) => error!(">>> Failed to get closes peer to check for sybil attack: {err:?}"), + } + } + /// Send a `Request` to the provided set of peers and wait for their responses concurrently. /// If `get_all_responses` is true, we wait for the responses from all the peers. /// NB TODO: Will return an error if the request timeouts. diff --git a/sn_networking/src/sybil.rs b/sn_networking/src/sybil.rs new file mode 100644 index 0000000000..f79a959df8 --- /dev/null +++ b/sn_networking/src/sybil.rs @@ -0,0 +1,71 @@ +// Copyright 2024 MaidSafe.net limited. +// +// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3. +// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed +// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. Please review the Licences for the specific language governing +// permissions and limitations relating to use of the SAFE Network Software. + +use crate::Result; + +use libp2p::PeerId; +use num::{integer::binomial, pow::Pow}; + +// Threshold to determine if there is an attack using Kullback-Liebler (KL) divergence +// between model peer ids distribution vs. actual distribution around any point in the address space. +const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a good value + +const K: usize = 20; +const N: usize = 25; // TODO: replace with network size estimation; + +pub(super) async fn check_for_sybil_attack(peers: &[PeerId]) -> Result { + // TODO: do we go ahead even if we don't have at least K peer ids...? + info!( + ">>> CHECKING SYBIL ATTACK WITH {} PEERS: {peers:?}", + peers.len() + ); + let q = num_peers_per_cpl(peers)? / K; + let n = get_net_size_estimate()?; + let p = compute_model_distribution(n); + let kl_divergence = compute_kl_divergence(p, q); + + let is_attack = kl_divergence > KL_DIVERGENCE_THRESHOLD; + Ok(is_attack) +} + +// Formula 6 in page 7 +fn num_peers_per_cpl(peers: &[PeerId]) -> Result { + // TODO! + Ok(0usize) +} + +// Formula 1 and 2 in page ?? +fn get_net_size_estimate() -> Result { + // TODO! + Ok(N) +} + +// Formula 3 in page 7 +fn distrib_j_th_largest_prefix_length(j: usize, x: usize) -> f64 { + (0..j).fold(0f64, |acc, i| { + acc + binomial(N, i) as f64 + * (1f64 - 0.5.pow((x + 1) as f64)).pow((N - i) as f64) + * 0.5.pow(((x + 1) * i) as f64) + }) +} + +// Formula 4 in page 7 +fn compute_model_distribution(x: usize) -> f64 { + let model_dist = (1..K + 1).fold(0f64, |acc, j| { + acc + distrib_j_th_largest_prefix_length(j, x) + - distrib_j_th_largest_prefix_length(j, x - 1) + }); + + model_dist / K as f64 +} + +// Formula 5 in page 7 +fn compute_kl_divergence(model_dist: f64, peers_per_cpl: usize) -> f64 { + // TODO! + model_dist * peers_per_cpl as f64 +} diff --git a/sn_node/src/node.rs b/sn_node/src/node.rs index c8ccf090ed..f899051aeb 100644 --- a/sn_node/src/node.rs +++ b/sn_node/src/node.rs @@ -368,11 +368,26 @@ impl Node { let network = self.network().clone(); self.record_metrics(Marker::IntervalBadNodesCheckTriggered); + // we also spawn a task to check for sybil peers + let network = self.network.clone(); + let _handle = spawn(async move { + network.perform_sybil_attack_check().await; + info!(">>> Checking for sybil peers took {:?}", start.elapsed()); + }); + + let network = self.network.clone(); let _handle = spawn(async move { Self::try_bad_nodes_check(network, rolling_index).await; trace!("Periodic bad_nodes check took {:?}", start.elapsed()); }); + // we also spawn a task to check for sybil peers + let network = self.network.clone(); + let _handle = spawn(async move { + network.perform_sybil_attack_check().await; + info!(">>> Checking for sybil peers took {:?}", start.elapsed()); + }); + if rolling_index == 511 { rolling_index = 0; } else { From c08dc43ba40c4c5e73220be90dd0f4cb5f68ec6d Mon Sep 17 00:00:00 2001 From: bochaco Date: Mon, 8 Apr 2024 13:51:05 -0300 Subject: [PATCH 2/7] draft: formula to get num peers per cpl --- sn_networking/src/lib.rs | 16 +++++++++------- sn_networking/src/sybil.rs | 39 ++++++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/sn_networking/src/lib.rs b/sn_networking/src/lib.rs index c09b659426..6b29a55131 100644 --- a/sn_networking/src/lib.rs +++ b/sn_networking/src/lib.rs @@ -868,17 +868,19 @@ impl Network { /// Using a random address, check if there is a sybil attack around it pub async fn perform_sybil_attack_check(&self) { - let random_addr = { + let (random_addr, cid) = { let mut rng = rand::thread_rng(); - let chunk_addr = ChunkAddress::new(XorName::random(&mut rng)); - NetworkAddress::from_chunk_address(chunk_addr) + let cid = XorName::random(&mut rng); + let chunk_addr = ChunkAddress::new(cid); + (NetworkAddress::from_chunk_address(chunk_addr), cid) }; match self.get_closest_peers(&random_addr, true).await { - Ok(closest_peers) => match check_for_sybil_attack(&closest_peers).await { - Ok(is_attack) => info!(">>> Sybil attack detection result: {is_attack}"), - Err(err) => error!(">>> Failed to check for sybil attack: {err:?}"), - }, + Ok(closest_peers) => { + if check_for_sybil_attack(&closest_peers, &cid).await { + info!(">>> Sybil attack detected around xorname: {cid}"); + } + } Err(err) => error!(">>> Failed to get closes peer to check for sybil attack: {err:?}"), } } diff --git a/sn_networking/src/sybil.rs b/sn_networking/src/sybil.rs index f79a959df8..1756e8c31e 100644 --- a/sn_networking/src/sybil.rs +++ b/sn_networking/src/sybil.rs @@ -6,10 +6,9 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. -use crate::Result; - use libp2p::PeerId; use num::{integer::binomial, pow::Pow}; +use xor_name::{XorName, XOR_NAME_LEN}; // Threshold to determine if there is an attack using Kullback-Liebler (KL) divergence // between model peer ids distribution vs. actual distribution around any point in the address space. @@ -18,31 +17,47 @@ const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a good value const K: usize = 20; const N: usize = 25; // TODO: replace with network size estimation; -pub(super) async fn check_for_sybil_attack(peers: &[PeerId]) -> Result { +pub(super) async fn check_for_sybil_attack(peers: &[PeerId], cid: &XorName) -> bool { // TODO: do we go ahead even if we don't have at least K peer ids...? info!( ">>> CHECKING SYBIL ATTACK WITH {} PEERS: {peers:?}", peers.len() ); - let q = num_peers_per_cpl(peers)? / K; - let n = get_net_size_estimate()?; + let q = num_peers_per_cpl(peers, cid); + let n = get_net_size_estimate(); let p = compute_model_distribution(n); + info!(">>> MODEL DIST WITH {} PEERS: {p}", peers.len()); let kl_divergence = compute_kl_divergence(p, q); - let is_attack = kl_divergence > KL_DIVERGENCE_THRESHOLD; - Ok(is_attack) + kl_divergence > KL_DIVERGENCE_THRESHOLD } // Formula 6 in page 7 -fn num_peers_per_cpl(peers: &[PeerId]) -> Result { - // TODO! - Ok(0usize) +fn num_peers_per_cpl(peers: &[PeerId], cid: &XorName) -> usize { + let peers_per_cpl = peers.iter().fold(0, |acc, peer| { + let peer_kad_id = XorName::from_content(&peer.to_bytes()); + acc + common_prefix(&peer_kad_id, cid) + }); + + peers_per_cpl / K +} + +// TODO: this is a copy of the private XorName::common_prefix method which could be made public. +/// Returns the length of the common prefix with the `other` name; e. g. +/// the when `other = 11110000` and `self = 11111111` this is 4. +fn common_prefix(lhs: &XorName, rhs: &XorName) -> usize { + for byte_index in 0..XOR_NAME_LEN { + if lhs[byte_index] != rhs[byte_index] { + return (byte_index * 8) + (lhs[byte_index] ^ rhs[byte_index]).leading_zeros() as usize; + } + } + 8 * XOR_NAME_LEN } // Formula 1 and 2 in page ?? -fn get_net_size_estimate() -> Result { +fn get_net_size_estimate() -> usize { // TODO! - Ok(N) + N } // Formula 3 in page 7 From bdf2140e38caf0bc8b00c57278658637fd40a7bd Mon Sep 17 00:00:00 2001 From: bochaco Date: Mon, 8 Apr 2024 15:38:16 -0300 Subject: [PATCH 3/7] draft: node-mgr and node args to run as sybil nodes eclipsing a specified xorname --- Cargo.lock | 926 ++++++++++++++-------------- sn_networking/src/cmd.rs | 6 + sn_networking/src/driver.rs | 9 + sn_node/src/bin/safenode/main.rs | 18 + sn_node/src/node.rs | 6 + sn_node_manager/Cargo.toml | 2 + sn_node_manager/src/bin/cli/main.rs | 9 + sn_node_manager/src/cmd/local.rs | 17 + sn_node_manager/src/local.rs | 12 + 9 files changed, 546 insertions(+), 459 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31191cc9b1..1de6564b36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,7 +86,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.12", "once_cell", "version_check", "zerocopy", @@ -118,9 +118,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-tzdata" @@ -145,48 +145,47 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -194,9 +193,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "arc-swap" @@ -224,9 +223,9 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "asn1-rs" -version = "0.6.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -240,25 +239,25 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", - "synstructure 0.13.1", + "syn 1.0.109", + "synstructure 0.12.6", ] [[package]] name = "asn1-rs-impl" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 1.0.109", ] [[package]] @@ -346,18 +345,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -414,14 +413,14 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" @@ -445,7 +444,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -475,7 +474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.15", + "getrandom 0.2.12", "instant", "pin-project-lite", "rand 0.8.5", @@ -523,9 +522,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" [[package]] name = "base64ct" @@ -724,9 +723,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.12" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" dependencies = [ "cc", "glob", @@ -823,9 +822,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byte-slice-cast" @@ -841,9 +840,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "byteorder" @@ -954,13 +953,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -995,16 +993,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -1089,7 +1087,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", "terminal_size", "unicase", "unicode-width", @@ -1104,7 +1102,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -1157,9 +1155,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" @@ -1187,9 +1185,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -1258,7 +1256,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "once_cell", "tiny-keccak", ] @@ -1323,9 +1321,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -1380,9 +1378,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -1408,9 +1406,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -1525,7 +1523,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -1547,15 +1545,15 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", "synstructure 0.13.1", ] [[package]] name = "darling" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -1563,40 +1561,40 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.66", + "strsim 0.10.0", + "syn 2.0.58", ] [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "data-encoding-macro" -version = "0.1.15" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1604,9 +1602,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" dependencies = [ "data-encoding", "syn 1.0.109", @@ -1643,14 +1641,14 @@ dependencies = [ [[package]] name = "der-parser" -version = "9.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.5", + "num-bigint 0.4.4", "num-traits", "rusticata-macros", ] @@ -1799,7 +1797,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -1889,9 +1887,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" @@ -1921,9 +1919,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1937,7 +1935,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -1972,9 +1970,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2025,9 +2023,9 @@ checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "ff" @@ -2068,15 +2066,15 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.9" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" [[package]] name = "file-rotate" -version = "0.7.6" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3ed82142801f5b1363f7d463963d114db80f467e860b1cd82228eaebc627a0" +checksum = "ddf221ceec4517f3cb764dae3541b2bd87666fc8832e51322fbb97250b468c71" dependencies = [ "chrono", "flate2", @@ -2090,7 +2088,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "windows-sys 0.52.0", ] @@ -2114,9 +2112,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -2257,7 +2255,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -2267,18 +2265,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.21.12", -] - -[[package]] -name = "futures-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" -dependencies = [ - "futures-io", - "rustls 0.23.8", - "rustls-pki-types", + "rustls 0.21.10", ] [[package]] @@ -2364,9 +2351,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -2516,9 +2503,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367ee9093b0c2b04fd04c5c7c8b6a1082713534eab537597ae343663a518fa99" +checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" dependencies = [ "bstr", "itoa", @@ -2609,7 +2596,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" dependencies = [ "gix-hash", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "parking_lot", ] @@ -2657,7 +2644,7 @@ checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -2720,9 +2707,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23623cf0f475691a6d943f898c4d0b89f5c1a2a64d0f92bce0e0322ee6528783" +checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" dependencies = [ "bstr", "gix-trace", @@ -2977,15 +2964,15 @@ dependencies = [ "indexmap 2.2.6", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tracing", ] [[package]] name = "half" -version = "2.4.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" dependencies = [ "cfg-if", "crunchy", @@ -3005,9 +2992,9 @@ checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -3090,9 +3077,9 @@ dependencies = [ [[package]] name = "hex-conservative" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" +checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" [[package]] name = "hex_fmt" @@ -3108,9 +3095,9 @@ checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" dependencies = [ "async-trait", "cfg-if", @@ -3133,9 +3120,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" dependencies = [ "cfg-if", "futures-util", @@ -3310,9 +3297,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" dependencies = [ "bytes", "futures-channel", @@ -3336,26 +3323,27 @@ dependencies = [ "futures-util", "http 0.2.12", "hyper 0.14.28", - "rustls 0.21.12", + "rustls 0.21.10", "tokio", "tokio-rustls 0.24.1", ] [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.2.0", "hyper-util", - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.1", ] [[package]] @@ -3372,16 +3360,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.2.0", "pin-project-lite", "socket2", "tokio", @@ -3515,7 +3503,7 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", "hashbrown 0.12.3", ] @@ -3526,7 +3514,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.14.3", ] [[package]] @@ -3573,9 +3561,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", "js-sys", @@ -3634,12 +3622,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" - [[package]] name = "itertools" version = "0.10.5" @@ -3666,9 +3648,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] @@ -3710,9 +3692,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -3730,7 +3712,7 @@ dependencies = [ "either", "futures", "futures-timer", - "getrandom 0.2.15", + "getrandom 0.2.12", "instant", "libp2p-allow-block-list", "libp2p-autonat", @@ -3886,7 +3868,7 @@ dependencies = [ "fnv", "futures", "futures-ticker", - "getrandom 0.2.15", + "getrandom 0.2.12", "hex_fmt", "instant", "libp2p-core", @@ -3905,9 +3887,9 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.44.2" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" +checksum = "20499a945d2f0221fdc6269b3848892c0f370d2ee3e19c7f65a29d8f860f6126" dependencies = [ "asynchronous-codec 0.7.0", "either", @@ -4041,9 +4023,9 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.10.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" +checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" dependencies = [ "bytes", "futures", @@ -4053,10 +4035,10 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "parking_lot", - "quinn", + "quinn 0.10.2", "rand 0.8.5", - "ring 0.17.8", - "rustls 0.23.8", + "ring 0.16.20", + "rustls 0.21.10", "socket2", "thiserror", "tokio", @@ -4065,9 +4047,9 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.17.2" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1c667cfabf3dd675c8e3cea63b7b98434ecf51721b7894cbb01d29983a6a9b" +checksum = "0aadb213ffc8e1a6f2b9c48dcf0fc07bf370f2ea4db7981813d45e50671c8d9d" dependencies = [ "asynchronous-codec 0.7.0", "bytes", @@ -4075,6 +4057,7 @@ dependencies = [ "futures", "futures-bounded", "futures-timer", + "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", @@ -4085,14 +4068,13 @@ dependencies = [ "thiserror", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-request-response" -version = "0.26.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6946e5456240b3173187cc37a17cb40c3cd1f7138c76e2c773e0d792a42a8de1" +checksum = "e12823250fe0c45bdddea6eefa2be9a609aff1283ff4e1d8a294fdbb89572f6f" dependencies = [ "async-trait", "cbor4ii", @@ -4112,20 +4094,19 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.44.2" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" +checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" dependencies = [ "either", "fnv", "futures", "futures-timer", - "getrandom 0.2.15", + "getrandom 0.2.12", "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "lru 0.12.3", "multistream-select", "once_cell", "rand 0.8.5", @@ -4138,14 +4119,14 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.34.2" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" +checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -4167,17 +4148,17 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.4.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251b17aebdd29df7e8f80e4d94b782fae42e934c49086e1a81ba23b60a8314f2" +checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" dependencies = [ "futures", - "futures-rustls 0.26.0", + "futures-rustls", "libp2p-core", "libp2p-identity", "rcgen", - "ring 0.17.8", - "rustls 0.23.8", + "ring 0.16.20", + "rustls 0.21.10", "rustls-webpki 0.101.7", "thiserror", "x509-parser", @@ -4186,9 +4167,9 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" +checksum = "b49cc89949bf0e06869297cd4fe2c132358c23fe93e76ad43950453df4da3d35" dependencies = [ "futures", "futures-timer", @@ -4208,7 +4189,7 @@ checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" dependencies = [ "either", "futures", - "futures-rustls 0.24.0", + "futures-rustls", "libp2p-core", "libp2p-identity", "parking_lot", @@ -4222,9 +4203,9 @@ dependencies = [ [[package]] name = "libp2p-websocket-websys" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f6c7ad3960dc9da18bead8468fc2dce9992d23d84557fd2345c86a992d70d" +checksum = "550e578dcc9cd572be9dd564831d1f5efe8e6661953768b1d56c1d462855bf6f" dependencies = [ "bytes", "futures", @@ -4250,7 +4231,7 @@ dependencies = [ "thiserror", "tracing", "yamux 0.12.1", - "yamux 0.13.2", + "yamux 0.13.1", ] [[package]] @@ -4277,17 +4258,17 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", "scopeguard", ] @@ -4303,7 +4284,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.14.3", ] [[package]] @@ -4312,7 +4293,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.14.3", ] [[package]] @@ -4393,22 +4374,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "minreq" -version = "2.11.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fdef521c74c2884a4f3570bcdb6d2a77b3c533feb6b27ac2ae72673cc221c64" +checksum = "00a000cf8bbbfb123a9bdc66b61c2885a4bb038df4f2629884caafabeb76b0f9" dependencies = [ "log", "once_cell", - "rustls 0.21.12", + "rustls 0.21.10", "rustls-webpki 0.101.7", "webpki-roots 0.25.4", ] @@ -4476,7 +4457,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -4698,7 +4679,7 @@ dependencies = [ "prometheus-parse", "rand 0.8.5", "ratatui", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "signal-hook", @@ -4710,7 +4691,7 @@ dependencies = [ "strum", "sysinfo", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tracing", "tracing-error", "tracing-subscriber", @@ -4762,11 +4743,11 @@ dependencies = [ [[package]] name = "num" -version = "0.4.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.4", "num-complex", "num-integer", "num-iter", @@ -4780,17 +4761,18 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", "num-integer", "num-traits", ] [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ + "autocfg 1.2.0", "num-integer", "num-traits", "serde", @@ -4798,9 +4780,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", "serde", @@ -4833,22 +4815,23 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", "num-integer", "num-traits", ] [[package]] name = "num-rational" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ - "num-bigint 0.4.5", + "autocfg 1.2.0", + "num-bigint 0.4.4", "num-integer", "num-traits", "serde", @@ -4856,11 +4839,11 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", "libm", ] @@ -4900,9 +4883,9 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.7.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ "asn1-rs", ] @@ -5111,9 +5094,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -5121,15 +5104,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] @@ -5145,9 +5128,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pathdiff" @@ -5169,11 +5152,11 @@ dependencies = [ [[package]] name = "pem" -version = "3.0.4" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "serde", ] @@ -5185,9 +5168,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -5196,9 +5179,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -5206,22 +5189,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -5230,9 +5213,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", "indexmap 2.2.6", @@ -5257,7 +5240,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -5320,9 +5303,9 @@ dependencies = [ [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -5333,24 +5316,24 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] [[package]] name = "polling" -version = "3.7.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" dependencies = [ "cfg-if", "concurrent-queue", @@ -5503,9 +5486,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -5536,7 +5519,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -5719,33 +5702,67 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "futures-io", "pin-project-lite", - "quinn-proto", - "quinn-udp", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", "rustc-hash", - "rustls 0.23.8", + "rustls 0.21.10", "thiserror", "tokio", "tracing", ] [[package]] -name = "quinn-proto" +name = "quinn" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto 0.11.3", + "quinn-udp 0.5.2", + "rustc-hash", + "rustls 0.23.10", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.21.10", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand 0.8.5", "ring 0.17.8", "rustc-hash", - "rustls 0.23.8", + "rustls 0.23.10", "slab", "thiserror", "tinyvec", @@ -5754,9 +5771,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", @@ -5767,9 +5797,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -5896,7 +5926,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", ] [[package]] @@ -6059,22 +6089,13 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - [[package]] name = "redox_users" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "libredox", "thiserror", ] @@ -6146,12 +6167,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.12", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -6166,19 +6187,19 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "base64 0.22.1", + "base64 0.22.0", "bytes", "futures-core", "futures-util", "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", - "hyper-rustls 0.26.0", + "hyper 1.2.0", + "hyper-rustls 0.27.2", "hyper-util", "ipnet", "js-sys", @@ -6187,15 +6208,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", + "quinn 0.11.2", + "rustls 0.23.10", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", "url", "wasm-bindgen", @@ -6258,7 +6280,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -6267,9 +6289,9 @@ dependencies = [ [[package]] name = "rmp" -version = "0.8.14" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", "num-traits", @@ -6278,9 +6300,9 @@ dependencies = [ [[package]] name = "rmp-serde" -version = "1.3.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" dependencies = [ "byteorder", "rmp", @@ -6326,9 +6348,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -6356,9 +6378,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ "bitflags 2.5.0", "errno", @@ -6394,9 +6416,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.12" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring 0.17.8", @@ -6406,23 +6428,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-pki-types", - "rustls-webpki 0.102.4", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls" -version = "0.23.8" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ "once_cell", "ring 0.17.8", @@ -6456,7 +6464,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.1", + "base64 0.22.0", "rustls-pki-types", ] @@ -6489,9 +6497,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rusty-fork" @@ -6518,9 +6526,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -6619,9 +6627,9 @@ dependencies = [ [[package]] name = "self_encryption" -version = "0.29.2" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894da3241a9e426c16fb8cb28b19416eae5fafdc7742e4bc505c1821661c140f" +checksum = "1ab2cd87e583738aba86278972e9116e2aabdb7fceda2be1fb3abe543be2336e" dependencies = [ "aes 0.8.4", "bincode", @@ -6644,9 +6652,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -6665,38 +6673,38 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -6875,9 +6883,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -6907,7 +6915,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.2.0", ] [[package]] @@ -6929,6 +6937,7 @@ dependencies = [ "color-eyre", "colored", "dirs-next", + "hex 0.4.3", "indicatif", "libp2p", "libp2p-identity", @@ -6936,7 +6945,7 @@ dependencies = [ "nix 0.27.1", "predicates 3.1.0", "prost 0.9.0", - "reqwest 0.12.4", + "reqwest 0.12.5", "semver", "serde", "serde_json", @@ -6955,6 +6964,7 @@ dependencies = [ "users", "uuid", "which 6.0.1", + "xor_name", ] [[package]] @@ -6968,7 +6978,7 @@ dependencies = [ "flate2", "lazy_static", "regex", - "reqwest 0.12.4", + "reqwest 0.12.5", "semver", "serde_json", "tar", @@ -7023,7 +7033,7 @@ name = "sn_cli" version = "0.93.8" dependencies = [ "aes 0.7.5", - "base64 0.22.1", + "base64 0.22.0", "bitcoin", "block-modes", "blsttc", @@ -7042,7 +7052,7 @@ dependencies = [ "libp2p", "rand 0.8.5", "rayon", - "reqwest 0.12.4", + "reqwest 0.12.5", "rmp-serde", "serde", "sn_build_info", @@ -7075,7 +7085,7 @@ dependencies = [ "dirs-next", "eyre", "futures", - "getrandom 0.2.15", + "getrandom 0.2.12", "hex 0.4.3", "itertools 0.12.1", "lazy_static", @@ -7125,7 +7135,7 @@ dependencies = [ "hmac 0.11.0", "lazy_static", "merkle-cbt", - "num-bigint 0.4.5", + "num-bigint 0.4.4", "num-integer", "num-traits", "p256", @@ -7149,7 +7159,7 @@ name = "sn_faucet" version = "0.4.29" dependencies = [ "assert_fs", - "base64 0.22.1", + "base64 0.22.0", "bitcoin", "blsttc", "clap", @@ -7160,7 +7170,7 @@ dependencies = [ "hex 0.4.3", "indicatif", "minreq", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "sn_build_info", @@ -7227,7 +7237,7 @@ dependencies = [ "custom_debug", "eyre", "futures", - "getrandom 0.2.15", + "getrandom 0.2.12", "hex 0.4.3", "hyper 0.14.28", "itertools 0.12.1", @@ -7284,7 +7294,7 @@ dependencies = [ "prost 0.9.0", "rand 0.8.5", "rayon", - "reqwest 0.12.4", + "reqwest 0.12.5", "rmp-serde", "self_encryption", "serde", @@ -7348,7 +7358,7 @@ dependencies = [ "lazy_static", "libp2p", "rand 0.8.5", - "reqwest 0.12.4", + "reqwest 0.12.5", "sn_networking", "thiserror", "tokio", @@ -7474,9 +7484,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", "windows-sys 0.52.0", @@ -7536,7 +7546,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -7566,6 +7576,12 @@ dependencies = [ "vte", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -7591,7 +7607,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -7636,9 +7652,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -7651,6 +7667,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -7671,7 +7693,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -7768,22 +7790,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -7807,9 +7829,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", @@ -7830,9 +7852,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ "num-conv", "time-core", @@ -7901,9 +7923,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -7930,13 +7952,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -7956,17 +7978,17 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.12", + "rustls 0.21.10", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", ] @@ -7984,9 +8006,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", @@ -8010,22 +8032,23 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", + "tracing", ] [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", @@ -8044,15 +8067,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.9", + "winnow 0.6.13", ] [[package]] @@ -8141,7 +8164,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tower-layer", "tower-service", "tracing", @@ -8191,7 +8214,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] @@ -8345,14 +8368,14 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http 0.2.12", "httparse", "log", "rand 0.8.5", @@ -8446,9 +8469,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -8545,7 +8568,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", ] [[package]] @@ -8593,9 +8616,9 @@ dependencies = [ [[package]] name = "vte_generate_state_changes" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" dependencies = [ "proc-macro2", "quote", @@ -8631,9 +8654,9 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.7" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" +checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" dependencies = [ "bytes", "futures-channel", @@ -8647,13 +8670,15 @@ dependencies = [ "multer", "percent-encoding", "pin-project", + "rustls-pemfile 1.0.4", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", + "tokio-stream", "tokio-tungstenite", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tower-service", "tracing", ] @@ -8691,7 +8716,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -8725,7 +8750,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8760,16 +8785,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webpki" version = "0.21.4" @@ -8831,9 +8846,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.1.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -8853,11 +8868,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "windows-sys 0.52.0", + "winapi", ] [[package]] @@ -8883,7 +8898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -8901,7 +8916,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -8919,7 +8934,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -8939,18 +8954,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -8961,9 +8975,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -8973,9 +8987,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -8985,15 +8999,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -9003,9 +9011,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -9015,9 +9023,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -9027,9 +9035,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -9039,9 +9047,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" @@ -9054,9 +9062,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.9" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -9110,9 +9118,9 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.16.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" dependencies = [ "asn1-rs", "data-encoding", @@ -9191,9 +9199,9 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f97202f6b125031b95d83e01dc57292b529384f80bfae4677e4bbc10178cf72" +checksum = "ad1d0148b89300047e72994bee99ecdabd15a9166a7b70c8b8c37c314dcc9002" dependencies = [ "futures", "instant", @@ -9222,29 +9230,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -9257,7 +9265,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.58", ] [[package]] diff --git a/sn_networking/src/cmd.rs b/sn_networking/src/cmd.rs index f84c09804e..21a165502c 100644 --- a/sn_networking/src/cmd.rs +++ b/sn_networking/src/cmd.rs @@ -379,6 +379,8 @@ impl SwarmDriver { .payment_received(); } SwarmCmd::GetLocalRecord { key, sender } => { + // TODO: eclipse content if sybil was set, if sybil xorname set is close to the key ....? + cmd_string = "GetLocalRecord"; let record = self .swarm @@ -394,6 +396,8 @@ impl SwarmDriver { sender, quorum, } => { + // TODO: eclipse content if sybil was set, if sybil xorname set is close to the key ....? + cmd_string = "PutRecord"; let record_key = PrettyPrintRecordKey::from(&record.key).into_owned(); trace!( @@ -446,6 +450,8 @@ impl SwarmDriver { } } SwarmCmd::PutLocalRecord { record } => { + // TODO: eclipse content if sybil was set, if sybil xorname set is close to the key ....? + cmd_string = "PutLocalRecord"; let key = record.key.clone(); let record_key = PrettyPrintRecordKey::from(&key); diff --git a/sn_networking/src/driver.rs b/sn_networking/src/driver.rs index 1917d53def..340bfae6aa 100644 --- a/sn_networking/src/driver.rs +++ b/sn_networking/src/driver.rs @@ -217,6 +217,7 @@ pub struct NetworkBuilder { metrics_server_port: Option, #[cfg(feature = "upnp")] upnp: bool, + sybil: Option, } impl NetworkBuilder { @@ -236,6 +237,7 @@ impl NetworkBuilder { metrics_server_port: None, #[cfg(feature = "upnp")] upnp: false, + sybil: None, } } @@ -274,6 +276,10 @@ impl NetworkBuilder { self.upnp = upnp; } + pub fn set_sybil_mode(&mut self, sybil: Option) { + self.sybil = sybil; + } + /// Creates a new `SwarmDriver` instance, along with a `Network` handle /// for sending commands and an `mpsc::Receiver` for receiving /// network events. It initializes the swarm, sets up the transport, and @@ -596,6 +602,7 @@ impl NetworkBuilder { replication_fetcher, #[cfg(feature = "open-metrics")] network_metrics, + sybil: self.sybil, cmd_receiver: swarm_cmd_receiver, event_sender: network_event_sender, pending_get_closest_peers: Default::default(), @@ -640,6 +647,8 @@ pub struct SwarmDriver { #[cfg(feature = "open-metrics")] pub(crate) network_metrics: Option, + sybil: Option, + cmd_receiver: mpsc::Receiver, event_sender: mpsc::Sender, // Use `self.send_event()` to send a NetworkEvent. diff --git a/sn_node/src/bin/safenode/main.rs b/sn_node/src/bin/safenode/main.rs index eaf734380e..1cb79ca712 100644 --- a/sn_node/src/bin/safenode/main.rs +++ b/sn_node/src/bin/safenode/main.rs @@ -158,6 +158,14 @@ struct Opt { /// Specify the owner(readable discord user name). #[clap(long)] owner: Option, + /// Set to have the node to act as sybil node eclipsing a specified CID/address. + /// + /// A hex-encoded xorname shall be provided to eclipse the content at such address + /// by dropping any provider record, as well as queries, targeting such address. + /// This can be used for testing sybil defense and detection using an address which belongs to + /// only test content so real users content is not affected. + #[clap(long, name = "CID's xorname")] + sybil: Option, #[cfg(feature = "open-metrics")] /// Specify the port for the OpenMetrics server. @@ -204,6 +212,15 @@ fn main() -> Result<()> { info!("Node started with initial_peers {bootstrap_peers:?}"); + let sybil = opt.sybil.map(|xorname_str| { + let bytes = hex::decode(xorname_str).unwrap(); + let mut arr = [0u8; xor_name::XOR_NAME_LEN]; + arr.copy_from_slice(&bytes); + let xorname = xor_name::XorName(arr); + info!("Running as sybil node to eclipse XorName: {xorname}"); + xorname + }); + // Create a tokio runtime per `run_node` attempt, this ensures // any spawned tasks are closed before we would attempt to run // another process with these args. @@ -220,6 +237,7 @@ fn main() -> Result<()> { opt.owner.clone(), #[cfg(feature = "upnp")] opt.upnp, + sybil, ); node_builder.is_behind_home_network = opt.home_network; #[cfg(feature = "open-metrics")] diff --git a/sn_node/src/node.rs b/sn_node/src/node.rs index f899051aeb..2df4db4dda 100644 --- a/sn_node/src/node.rs +++ b/sn_node/src/node.rs @@ -45,6 +45,7 @@ use tokio::{ sync::{broadcast, mpsc::Receiver}, task::{spawn, JoinHandle}, }; +use xor_name::XorName; #[cfg(feature = "reward-forward")] use libp2p::kad::{Quorum, Record}; @@ -78,6 +79,7 @@ pub struct NodeBuilder { initial_peers: Vec, local: bool, root_dir: PathBuf, + sybil: Option, #[cfg(feature = "open-metrics")] /// Set to Some to enable the metrics server metrics_server_port: Option, @@ -98,6 +100,7 @@ impl NodeBuilder { root_dir: PathBuf, owner: Option, #[cfg(feature = "upnp")] upnp: bool, + sybil: Option, ) -> Self { Self { keypair, @@ -105,6 +108,7 @@ impl NodeBuilder { initial_peers, local, root_dir, + sybil, #[cfg(feature = "open-metrics")] metrics_server_port: None, is_behind_home_network: false, @@ -169,6 +173,8 @@ impl NodeBuilder { #[cfg(feature = "upnp")] network_builder.upnp(self.upnp); + network_builder.set_sybil_mode(self.sybil); + let (network, network_event_receiver, swarm_driver) = network_builder.build_node()?; let node_events_channel = NodeEventsChannel::default(); let (node_cmds, _) = broadcast::channel(10); diff --git a/sn_node_manager/Cargo.toml b/sn_node_manager/Cargo.toml index 5e877cbc6d..9898dad81b 100644 --- a/sn_node_manager/Cargo.toml +++ b/sn_node_manager/Cargo.toml @@ -35,6 +35,7 @@ clap = { version = "4.4.6", features = ["derive", "env"] } colored = "2.0.4" color-eyre = "~0.6" dirs-next = "2.0.0" +hex = "0.4.3" indicatif = { version = "0.17.5", features = ["tokio"] } libp2p = { version = "0.53", features = [] } libp2p-identity = { version = "0.2.7", features = ["rand"] } @@ -56,6 +57,7 @@ tracing = { version = "~0.1.26" } tonic = { version = "0.6.2" } uuid = { version = "1.5.0", features = ["v4"] } which = "6.0.1" +xor_name = "5.0.0" [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies] nix = { version = "0.27.1", features = ["fs", "user"] } diff --git a/sn_node_manager/src/bin/cli/main.rs b/sn_node_manager/src/bin/cli/main.rs index 804edbd30e..0bdb9be9bf 100644 --- a/sn_node_manager/src/bin/cli/main.rs +++ b/sn_node_manager/src/bin/cli/main.rs @@ -212,6 +212,14 @@ pub enum SubCmd { /// The binary will be downloaded. #[clap(long)] version: Option, + /// Set to have the node/s joining to act as sybil nodes eclipsing a specified CID/address. + /// + /// A hex-encoded xorname shall be provided to have nodes to eclipse the content at such address + /// by dropping any provider record, as well as queries, targeting such address. + /// This can be used for testing sybil defense and detection using an address which belongs to + /// only test content so real users content is not affected. + #[clap(long, name = "CID's xorname")] + sybil: Option, }, #[clap(subcommand)] Auditor(AuditorSubCmd), @@ -1033,6 +1041,7 @@ async fn main() -> Result<()> { LocalSubCmd::Join { build, count, + sybil, faucet_path, faucet_version, interval, diff --git a/sn_node_manager/src/cmd/local.rs b/sn_node_manager/src/cmd/local.rs index ccef08613c..6d572f5623 100644 --- a/sn_node_manager/src/cmd/local.rs +++ b/sn_node_manager/src/cmd/local.rs @@ -21,10 +21,12 @@ use sn_service_management::{ control::ServiceController, get_local_node_registry_path, NodeRegistry, }; use std::path::PathBuf; +use xor_name::XOR_NAME_LEN; pub async fn join( build: bool, count: u16, + sybil: Option, faucet_path: Option, faucet_version: Option, interval: u64, @@ -41,6 +43,19 @@ pub async fn join( print_banner("Joining Local Network"); } info!("Joining local network"); + let sybil = sybil.map(|xorname_str| { + let bytes = hex::decode(xorname_str).unwrap(); + let mut arr = [0u8; XOR_NAME_LEN]; + arr.copy_from_slice(&bytes); + xor_name::XorName(arr) + }); + + println!("===================================================="); + println!(" Joining Local Network "); + if let Some(xorname) = sybil { + println!("** WITH SYBIL NODE/s TO ECLIPSE XorName: {xorname} **"); + } + println!("===================================================="); let local_node_reg_path = &get_local_node_registry_path()?; let mut local_node_registry = NodeRegistry::load(local_node_reg_path)?; @@ -87,6 +102,7 @@ pub async fn join( node_count: count, owner, owner_prefix, + sybil, peers, safenode_bin_path: node_path, skip_validation, @@ -184,6 +200,7 @@ pub async fn run( node_count: count, owner, owner_prefix, + sybil: None, peers: None, safenode_bin_path: node_path, skip_validation, diff --git a/sn_node_manager/src/local.rs b/sn_node_manager/src/local.rs index aea74eb106..20a8ecfed1 100644 --- a/sn_node_manager/src/local.rs +++ b/sn_node_manager/src/local.rs @@ -39,6 +39,7 @@ pub trait Launcher { rpc_socket_addr: SocketAddr, bootstrap_peers: Vec, log_format: Option, + sybil: Option, ) -> Result<()>; fn wait(&self, delay: u64); } @@ -75,6 +76,7 @@ impl Launcher for LocalSafeLauncher { rpc_socket_addr: SocketAddr, bootstrap_peers: Vec, log_format: Option, + sybil: Option, ) -> Result<()> { let mut args = Vec::new(); @@ -100,6 +102,10 @@ impl Launcher for LocalSafeLauncher { args.push("--local".to_string()); args.push("--rpc".to_string()); args.push(rpc_socket_addr.to_string()); + if let Some(xorname) = sybil { + args.push("--sybil".to_string()); + args.push(hex::encode(xorname)); + } Command::new(self.safenode_bin_path.clone()) .args(args) @@ -192,6 +198,7 @@ pub struct LocalNetworkOptions { pub node_count: u16, pub owner: Option, pub owner_prefix: Option, + pub sybil: Option, pub peers: Option>, pub safenode_bin_path: PathBuf, pub skip_validation: bool, @@ -236,6 +243,7 @@ pub async fn run_network( log_format: options.log_format, number, owner, + sybil: None, rpc_socket_addr, version: get_bin_version(&launcher.get_safenode_path())?, }, @@ -266,6 +274,7 @@ pub async fn run_network( log_format: options.log_format, number, owner, + sybil: options.sybil, rpc_socket_addr, version: get_bin_version(&launcher.get_safenode_path())?, }, @@ -316,6 +325,7 @@ pub struct RunNodeOptions { pub log_format: Option, pub number: u16, pub owner: Option, + pub sybil: Option, pub rpc_socket_addr: SocketAddr, pub version: String, } @@ -332,6 +342,7 @@ pub async fn run_node( run_options.rpc_socket_addr, run_options.bootstrap_peers.clone(), run_options.log_format, + run_options.sybil, )?; launcher.wait(run_options.interval); @@ -516,6 +527,7 @@ mod tests { log_format: None, number: 1, owner: None, + sybil: None, rpc_socket_addr, version: "0.100.12".to_string(), }, From 4210def0098b528916c87dad8365dd8b9a11f98a Mon Sep 17 00:00:00 2001 From: bochaco Date: Tue, 9 Apr 2024 14:58:31 -0300 Subject: [PATCH 4/7] draft: find a PeerId closer to the attacked CID when running as sybil --- sn_networking/src/sybil.rs | 6 +-- sn_node/src/bin/safenode/main.rs | 64 +++++++++++++++++++++++++++----- sn_node_manager/src/cmd/local.rs | 17 +++++---- 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/sn_networking/src/sybil.rs b/sn_networking/src/sybil.rs index 1756e8c31e..317fa9d143 100644 --- a/sn_networking/src/sybil.rs +++ b/sn_networking/src/sybil.rs @@ -17,6 +17,8 @@ const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a good value const K: usize = 20; const N: usize = 25; // TODO: replace with network size estimation; +// Given the set of closest K peers ids to the passed content address, return 'true' +// if there is probabilistically a sybil attack around that CID address. pub(super) async fn check_for_sybil_attack(peers: &[PeerId], cid: &XorName) -> bool { // TODO: do we go ahead even if we don't have at least K peer ids...? info!( @@ -42,9 +44,7 @@ fn num_peers_per_cpl(peers: &[PeerId], cid: &XorName) -> usize { peers_per_cpl / K } -// TODO: this is a copy of the private XorName::common_prefix method which could be made public. -/// Returns the length of the common prefix with the `other` name; e. g. -/// the when `other = 11110000` and `self = 11111111` this is 4. +// TODO: use released https://github.com/maidsafe/xor_name/pull/96 instead fn common_prefix(lhs: &XorName, rhs: &XorName) -> usize { for byte_index in 0..XOR_NAME_LEN { if lhs[byte_index] != rhs[byte_index] { diff --git a/sn_node/src/bin/safenode/main.rs b/sn_node/src/bin/safenode/main.rs index 1cb79ca712..3f1727059d 100644 --- a/sn_node/src/bin/safenode/main.rs +++ b/sn_node/src/bin/safenode/main.rs @@ -21,6 +21,7 @@ use sn_node::{Marker, NodeBuilder, NodeEvent, NodeEventsReceiver}; use sn_peers_acquisition::PeersArgs; use sn_protocol::{node::get_safenode_root_dir, node_rpc::NodeCtrl}; use std::{ + cmp::Ordering, env, io::Write, net::{IpAddr, Ipv4Addr, SocketAddr}, @@ -34,6 +35,7 @@ use tokio::{ time::sleep, }; use tracing_appender::non_blocking::WorkerGuard; +use xor_name::XorName; #[derive(Debug, Clone)] pub enum LogOutputDestArg { @@ -192,7 +194,24 @@ fn main() -> Result<()> { let opt = Opt::parse(); let node_socket_addr = SocketAddr::new(opt.ip, opt.port); - let (root_dir, keypair) = get_root_dir_and_keypair(&opt.root_dir)?; + let (root_dir, keypair, sybil) = if let Some(xorname_str) = &opt.sybil { + let bytes = hex::decode(xorname_str)?; + let mut arr = [0u8; xor_name::XOR_NAME_LEN]; + arr.copy_from_slice(&bytes); + let xorname = xor_name::XorName(arr); + info!("Running as sybil node to eclipse XorName: {xorname}"); + + // FIXME: use the PeerId closest to the address found in routing table, + // we might need to connect with a random peerid andd get-closest-peer... + let closest_peer = PeerId::random(); + let (root_dir, keypair) = + gen_keypair_closer_to_address(&opt.root_dir, &xorname, &closest_peer)?; + + (root_dir, keypair, Some(xorname)) + } else { + let (root_dir, keypair) = get_root_dir_and_keypair(&opt.root_dir)?; + (root_dir, keypair, None) + }; let (log_output_dest, log_reload_handle, _log_appender_guard) = init_logging(&opt, keypair.public().to_peer_id())?; @@ -212,15 +231,6 @@ fn main() -> Result<()> { info!("Node started with initial_peers {bootstrap_peers:?}"); - let sybil = opt.sybil.map(|xorname_str| { - let bytes = hex::decode(xorname_str).unwrap(); - let mut arr = [0u8; xor_name::XOR_NAME_LEN]; - arr.copy_from_slice(&bytes); - let xorname = xor_name::XorName(arr); - info!("Running as sybil node to eclipse XorName: {xorname}"); - xorname - }); - // Create a tokio runtime per `run_node` attempt, this ensures // any spawned tasks are closed before we would attempt to run // another process with these args. @@ -558,6 +568,40 @@ fn get_root_dir_and_keypair(root_dir: &Option) -> Result<(PathBuf, Keyp } } +/// Generate a keypair such that the PeerId is closer to the given address +/// than the closes peer found on the routing table. +fn gen_keypair_closer_to_address( + root_dir: &Option, + addr: &XorName, + closest_peer: &PeerId, +) -> Result<(PathBuf, Keypair)> { + // TODO: put a limit to the number of iterations...? + let closest = XorName::from_content(&closest_peer.to_bytes()); + info!("Trying to find a PeerId closer to {addr} than {closest} to act as sybil node..."); + loop { + let secret_key = libp2p::identity::ed25519::SecretKey::generate(); + let keypair: Keypair = libp2p::identity::ed25519::Keypair::from(secret_key.clone()).into(); + let peer_id = keypair.public().to_peer_id(); + let peer_kad_id = XorName::from_content(&peer_id.to_bytes()); + + if addr.cmp_distance(&peer_kad_id, &closest) == Ordering::Less { + // we found a closer peer id + let dir = if let Some(dir) = root_dir { + dir.to_owned() + } else { + get_safenode_root_dir(peer_id)? + }; + std::fs::create_dir_all(&dir)?; + let secret_key_path = dir.join("secret-key"); + let mut file = create_secret_key_file(secret_key_path) + .map_err(|err| eyre!("could not create secret key file: {err}"))?; + file.write_all(secret_key.as_ref())?; + + break Ok((dir, keypair)); + } + } +} + /// Starts a new process running the binary with the same args as /// the current process /// Optionally provide the node's root dir and listen port to retain it's PeerId diff --git a/sn_node_manager/src/cmd/local.rs b/sn_node_manager/src/cmd/local.rs index 6d572f5623..b8cbedfb9b 100644 --- a/sn_node_manager/src/cmd/local.rs +++ b/sn_node_manager/src/cmd/local.rs @@ -43,18 +43,19 @@ pub async fn join( print_banner("Joining Local Network"); } info!("Joining local network"); - let sybil = sybil.map(|xorname_str| { - let bytes = hex::decode(xorname_str).unwrap(); - let mut arr = [0u8; XOR_NAME_LEN]; - arr.copy_from_slice(&bytes); - xor_name::XorName(arr) - }); println!("===================================================="); println!(" Joining Local Network "); - if let Some(xorname) = sybil { + let sybil = if let Some(xorname_str) = sybil { + let bytes = hex::decode(xorname_str)?; + let mut arr = [0u8; XOR_NAME_LEN]; + arr.copy_from_slice(&bytes); + let xorname = xor_name::XorName(arr); println!("** WITH SYBIL NODE/s TO ECLIPSE XorName: {xorname} **"); - } + Some(xorname) + } else { + None + }; println!("===================================================="); let local_node_reg_path = &get_local_node_registry_path()?; From d55f62e76a8fe4e1087948d5227c7938184142fa Mon Sep 17 00:00:00 2001 From: bochaco Date: Wed, 10 Apr 2024 17:41:15 -0300 Subject: [PATCH 5/7] draft: implementing and fine-tuning algorithm formulas --- sn_networking/src/lib.rs | 15 ++-- sn_networking/src/sybil.rs | 159 ++++++++++++++++++++++++++----------- 2 files changed, 123 insertions(+), 51 deletions(-) diff --git a/sn_networking/src/lib.rs b/sn_networking/src/lib.rs index 6b29a55131..7d149bba36 100644 --- a/sn_networking/src/lib.rs +++ b/sn_networking/src/lib.rs @@ -868,17 +868,22 @@ impl Network { /// Using a random address, check if there is a sybil attack around it pub async fn perform_sybil_attack_check(&self) { - let (random_addr, cid) = { + let random_addr = { let mut rng = rand::thread_rng(); let cid = XorName::random(&mut rng); - let chunk_addr = ChunkAddress::new(cid); - (NetworkAddress::from_chunk_address(chunk_addr), cid) + NetworkAddress::from_chunk_address(ChunkAddress::new(cid)) }; match self.get_closest_peers(&random_addr, true).await { Ok(closest_peers) => { - if check_for_sybil_attack(&closest_peers, &cid).await { - info!(">>> Sybil attack detected around xorname: {cid}"); + if check_for_sybil_attack( + &closest_peers, + random_addr.as_kbucket_key(), + &BTreeMap::default(), + ) + .await + { + info!(">>> Sybil attack detected around addr: {random_addr}"); } } Err(err) => error!(">>> Failed to get closes peer to check for sybil attack: {err:?}"), diff --git a/sn_networking/src/sybil.rs b/sn_networking/src/sybil.rs index 317fa9d143..7f3ab9ad75 100644 --- a/sn_networking/src/sybil.rs +++ b/sn_networking/src/sybil.rs @@ -6,81 +6,148 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. -use libp2p::PeerId; +use std::collections::{BTreeMap, HashMap}; + +use itertools::Itertools; +use libp2p::{ + kad::{KBucketKey, K_VALUE}, + PeerId, +}; use num::{integer::binomial, pow::Pow}; -use xor_name::{XorName, XOR_NAME_LEN}; // Threshold to determine if there is an attack using Kullback-Liebler (KL) divergence // between model peer ids distribution vs. actual distribution around any point in the address space. -const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a good value +const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a proper value + +const ITERATIONS_FOR_NET_SIZE_ESTIMATION: usize = 50; -const K: usize = 20; -const N: usize = 25; // TODO: replace with network size estimation; +// The container maps each random KAD Key to the ordered list +// of its K_VALUE closest peers, sorted by increasing distance. This order +// is a prerequisite for the functions this container is used by, +// i.e. their result is dependant on the correct ordering of these values. +pub(super) type RandomKeysAndClosestPeerIds = BTreeMap>, Vec>; // Given the set of closest K peers ids to the passed content address, return 'true' // if there is probabilistically a sybil attack around that CID address. -pub(super) async fn check_for_sybil_attack(peers: &[PeerId], cid: &XorName) -> bool { - // TODO: do we go ahead even if we don't have at least K peer ids...? - info!( - ">>> CHECKING SYBIL ATTACK WITH {} PEERS: {peers:?}", - peers.len() - ); - let q = num_peers_per_cpl(peers, cid); - let n = get_net_size_estimate(); - let p = compute_model_distribution(n); - info!(">>> MODEL DIST WITH {} PEERS: {p}", peers.len()); - let kl_divergence = compute_kl_divergence(p, q); +// This implements the algorithm proposed in https://ssg.lancs.ac.uk/wp-content/uploads/ndss_preprint.pdf +pub(super) async fn check_for_sybil_attack( + peers: &[PeerId], + cid: KBucketKey>, + random_keys: &RandomKeysAndClosestPeerIds, +) -> bool { + let k = peers.len(); + info!(">>> CHECKING SYBIL ATTACK WITH {k} PEERS: {peers:?}"); + + // FIXME: return error if we don't have at least K peer ids per key + assert!(k >= K_VALUE.get()); + assert!(random_keys + .iter() + .all(|(_, peers)| peers.len() >= K_VALUE.get())); + + let cpls_freqs = average_num_peers_per_cpl(peers, cid.clone()); + let q = |x| cpls_freqs.get(&x).cloned().unwrap_or(0) as f64 / k as f64; + + let n = get_net_size_estimate(random_keys); + let model_dist = compute_model_distribution(n); + let p = |x| model_dist.get(&x).cloned().unwrap_or(0f64) / k as f64; + + let kl_divergence = compute_kl_divergence(&p, &q); kl_divergence > KL_DIVERGENCE_THRESHOLD } -// Formula 6 in page 7 -fn num_peers_per_cpl(peers: &[PeerId], cid: &XorName) -> usize { - let peers_per_cpl = peers.iter().fold(0, |acc, peer| { - let peer_kad_id = XorName::from_content(&peer.to_bytes()); - acc + common_prefix(&peer_kad_id, cid) +// Formula 1 in page 3 +// Compute the average distance between each of the passed random keys, +// and their i-th closest peer +fn average_between_keys_and_i_th_closest_peer( + i: usize, + random_keys: &RandomKeysAndClosestPeerIds, +) -> f64 { + let m = random_keys.len() as f64; + let distances = random_keys.iter().fold(0f64, |acc, (key_j, peers)| { + let i_th_peer: KBucketKey = peers[i].into(); + let distance = key_j.distance(&i_th_peer).ilog2().unwrap_or(0) as f64; + acc + distance }); - peers_per_cpl / K + distances / m } -// TODO: use released https://github.com/maidsafe/xor_name/pull/96 instead -fn common_prefix(lhs: &XorName, rhs: &XorName) -> usize { - for byte_index in 0..XOR_NAME_LEN { - if lhs[byte_index] != rhs[byte_index] { - return (byte_index * 8) + (lhs[byte_index] ^ rhs[byte_index]).leading_zeros() as usize; +// Formula 2 in page 3 +// Estimates the network size based on the distances between the provided +// random KAD Keys and their closest PeerIds. +fn get_net_size_estimate(random_keys: &RandomKeysAndClosestPeerIds) -> usize { + let mut best_n_found = 0; + let mut smallest_value_found = f64::MAX; + for n in 0..ITERATIONS_FOR_NET_SIZE_ESTIMATION { + let value = (1..=K_VALUE.get()).fold(0f64, |acc, i| { + let d_i = average_between_keys_and_i_th_closest_peer(i, random_keys); + let dist: f64 = d_i - ((2f64.pow(256) * i as f64) / (n + 1) as f64); + acc + dist.pow(2) + }); + if value < smallest_value_found { + smallest_value_found = value; + best_n_found = n; } } - 8 * XOR_NAME_LEN -} -// Formula 1 and 2 in page ?? -fn get_net_size_estimate() -> usize { - // TODO! - N + best_n_found } // Formula 3 in page 7 -fn distrib_j_th_largest_prefix_length(j: usize, x: usize) -> f64 { +fn distrib_j_th_largest_prefix_length(n: usize, j: usize, x: usize) -> f64 { (0..j).fold(0f64, |acc, i| { - acc + binomial(N, i) as f64 - * (1f64 - 0.5.pow((x + 1) as f64)).pow((N - i) as f64) - * 0.5.pow(((x + 1) * i) as f64) + acc + (binomial(n, i) as f64 + * (1f64 - 0.5.pow((x + 1) as f64)).pow((n - i) as f64) + * 0.5.pow(((x + 1) * i) as f64)) }) } // Formula 4 in page 7 -fn compute_model_distribution(x: usize) -> f64 { - let model_dist = (1..K + 1).fold(0f64, |acc, j| { - acc + distrib_j_th_largest_prefix_length(j, x) - - distrib_j_th_largest_prefix_length(j, x - 1) - }); +// Returns a map of common prefix lengths to their probabilistically expected frequency. +fn compute_model_distribution(n: usize) -> HashMap { + let f = |x| { + (1..=K_VALUE.get()).fold(0f64, |acc, j| { + acc + distrib_j_th_largest_prefix_length(n, j, x) + - distrib_j_th_largest_prefix_length(n, j, x - 1) + }) + }; - model_dist / K as f64 + (0..=256).map(|x| (x, f(x))).collect() } // Formula 5 in page 7 -fn compute_kl_divergence(model_dist: f64, peers_per_cpl: usize) -> f64 { - // TODO! - model_dist * peers_per_cpl as f64 +// Compute the Kullback-Liebler (KL) divergence between the two given distribution +fn compute_kl_divergence(p: &dyn Fn(usize) -> f64, q: &dyn Fn(usize) -> f64) -> f64 { + (0..256).fold(0f64, |acc, x| { + let q_x = q(x); + acc + (q_x * (q_x / p(x)).ln()) + }) +} + +// Formula 6 in page 7 +// Returns a map with common prefix lengths of given peers and their frequency. +fn average_num_peers_per_cpl(peers: &[PeerId], cid: KBucketKey>) -> HashMap { + let cid_bytes = cid.hashed_bytes(); + peers + .iter() + .map(|peer| { + let peer_key: KBucketKey = (*peer).into(); + common_prefix_length(peer_key.hashed_bytes(), cid_bytes) + }) + .counts() +} + +// Helper to calculate number of common prefix bits between two slices +fn common_prefix_length(lhs: &[u8], rhs: &[u8]) -> usize { + let mut common_prefix_length = 0usize; + for byte_index in 0..32 { + if lhs[byte_index] == rhs[byte_index] { + common_prefix_length += 8; + } else { + common_prefix_length += (lhs[byte_index] ^ rhs[byte_index]).leading_zeros() as usize; + break; + } + } + common_prefix_length } From ed51a2a647ac415f8dd49f8fe46f77c40fd19110 Mon Sep 17 00:00:00 2001 From: bochaco Date: Thu, 11 Apr 2024 15:06:51 -0300 Subject: [PATCH 6/7] draft: minor fixes and adding unit tests for the algorithm formulas --- sn_networking/src/lib.rs | 8 ++---- sn_networking/src/sybil.rs | 59 +++++++++++++++++++++++++++++++------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/sn_networking/src/lib.rs b/sn_networking/src/lib.rs index 7d149bba36..8c35811296 100644 --- a/sn_networking/src/lib.rs +++ b/sn_networking/src/lib.rs @@ -876,12 +876,8 @@ impl Network { match self.get_closest_peers(&random_addr, true).await { Ok(closest_peers) => { - if check_for_sybil_attack( - &closest_peers, - random_addr.as_kbucket_key(), - &BTreeMap::default(), - ) - .await + if check_for_sybil_attack(&closest_peers, random_addr.as_kbucket_key(), &vec![]) + .await { info!(">>> Sybil attack detected around addr: {random_addr}"); } diff --git a/sn_networking/src/sybil.rs b/sn_networking/src/sybil.rs index 7f3ab9ad75..6ec81ffa37 100644 --- a/sn_networking/src/sybil.rs +++ b/sn_networking/src/sybil.rs @@ -6,7 +6,7 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. -use std::collections::{BTreeMap, HashMap}; +use std::collections::HashMap; use itertools::Itertools; use libp2p::{ @@ -25,7 +25,7 @@ const ITERATIONS_FOR_NET_SIZE_ESTIMATION: usize = 50; // of its K_VALUE closest peers, sorted by increasing distance. This order // is a prerequisite for the functions this container is used by, // i.e. their result is dependant on the correct ordering of these values. -pub(super) type RandomKeysAndClosestPeerIds = BTreeMap>, Vec>; +pub(super) type RandomKeysAndClosestPeerIds = Vec<(KBucketKey>, Vec)>; // Given the set of closest K peers ids to the passed content address, return 'true' // if there is probabilistically a sybil attack around that CID address. @@ -44,10 +44,11 @@ pub(super) async fn check_for_sybil_attack( .iter() .all(|(_, peers)| peers.len() >= K_VALUE.get())); - let cpls_freqs = average_num_peers_per_cpl(peers, cid.clone()); + let cpls_freqs = num_peers_per_cpl(peers, cid.clone()); let q = |x| cpls_freqs.get(&x).cloned().unwrap_or(0) as f64 / k as f64; let n = get_net_size_estimate(random_keys); + info!(">>> NET SIZE ESTIMATE: {n}"); let model_dist = compute_model_distribution(n); let p = |x| model_dist.get(&x).cloned().unwrap_or(0f64) / k as f64; @@ -79,10 +80,11 @@ fn average_between_keys_and_i_th_closest_peer( fn get_net_size_estimate(random_keys: &RandomKeysAndClosestPeerIds) -> usize { let mut best_n_found = 0; let mut smallest_value_found = f64::MAX; + // FIXME: this iteration needs to be smarter for n in 0..ITERATIONS_FOR_NET_SIZE_ESTIMATION { - let value = (1..=K_VALUE.get()).fold(0f64, |acc, i| { + let value = (0..K_VALUE.get()).fold(0f64, |acc, i| { let d_i = average_between_keys_and_i_th_closest_peer(i, random_keys); - let dist: f64 = d_i - ((2f64.pow(256) * i as f64) / (n + 1) as f64); + let dist: f64 = d_i - ((2f64.pow(256) * (i + 1) as f64) / (n + 1) as f64); acc + dist.pow(2) }); if value < smallest_value_found { @@ -96,18 +98,18 @@ fn get_net_size_estimate(random_keys: &RandomKeysAndClosestPeerIds) -> usize { // Formula 3 in page 7 fn distrib_j_th_largest_prefix_length(n: usize, j: usize, x: usize) -> f64 { - (0..j).fold(0f64, |acc, i| { + (0..=j).fold(0f64, |acc, i| { acc + (binomial(n, i) as f64 * (1f64 - 0.5.pow((x + 1) as f64)).pow((n - i) as f64) * 0.5.pow(((x + 1) * i) as f64)) }) } -// Formula 4 in page 7 +// Formula 4 (partially) in page 7 // Returns a map of common prefix lengths to their probabilistically expected frequency. fn compute_model_distribution(n: usize) -> HashMap { let f = |x| { - (1..=K_VALUE.get()).fold(0f64, |acc, j| { + (0..K_VALUE.get()).fold(0f64, |acc, j| { acc + distrib_j_th_largest_prefix_length(n, j, x) - distrib_j_th_largest_prefix_length(n, j, x - 1) }) @@ -125,9 +127,9 @@ fn compute_kl_divergence(p: &dyn Fn(usize) -> f64, q: &dyn Fn(usize) -> f64) -> }) } -// Formula 6 in page 7 +// Formula 6 (partially) in page 7 // Returns a map with common prefix lengths of given peers and their frequency. -fn average_num_peers_per_cpl(peers: &[PeerId], cid: KBucketKey>) -> HashMap { +fn num_peers_per_cpl(peers: &[PeerId], cid: KBucketKey>) -> HashMap { let cid_bytes = cid.hashed_bytes(); peers .iter() @@ -151,3 +153,40 @@ fn common_prefix_length(lhs: &[u8], rhs: &[u8]) -> usize { } common_prefix_length } + +#[cfg(test)] +mod tests { + use super::common_prefix_length; + + // we use XorName utilities just because it's easier to build test data with them + use xor_name::XorName; + + #[test] + fn test_common_prefix_length() { + let mut rng = rand::thread_rng(); + let mut lhs = XorName::random(&mut rng); + assert_eq!(common_prefix_length(&lhs, &lhs), 256); + + let mut rhs = !lhs; + // let's first make sure lhs != rhs in every bit + assert_eq!(common_prefix_length(&lhs, &rhs), 0); + + for i in 0..=255 { + lhs = lhs.with_bit(i, true); + rhs = rhs.with_bit(i, true); + assert_eq!( + i as usize + 1, + common_prefix_length(&lhs, &rhs), + "unexpected result from common_prefix_length fn" + ); + } + } + + #[test] + fn test_net_size_estimate() { + // Build a map with 256 random keys, one for each Kbucket + // with their corresponding K-closest peers to a random CID; + // e.g. in Kbucket #2 get the 20 closest peers to a random CID that shares 2 bits as a prefix. + todo!(); + } +} From e73405679e675877bb97375bbad9ec254506e246 Mon Sep 17 00:00:00 2001 From: bochaco Date: Thu, 11 Apr 2024 15:31:53 -0300 Subject: [PATCH 7/7] draft: adding test for net size estimation function --- sn_networking/src/sybil.rs | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/sn_networking/src/sybil.rs b/sn_networking/src/sybil.rs index 6ec81ffa37..4305830f98 100644 --- a/sn_networking/src/sybil.rs +++ b/sn_networking/src/sybil.rs @@ -19,7 +19,7 @@ use num::{integer::binomial, pow::Pow}; // between model peer ids distribution vs. actual distribution around any point in the address space. const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a proper value -const ITERATIONS_FOR_NET_SIZE_ESTIMATION: usize = 50; +const ITERATIONS_FOR_NET_SIZE_ESTIMATION: usize = 500; // The container maps each random KAD Key to the ordered list // of its K_VALUE closest peers, sorted by increasing distance. This order @@ -87,6 +87,7 @@ fn get_net_size_estimate(random_keys: &RandomKeysAndClosestPeerIds) -> usize { let dist: f64 = d_i - ((2f64.pow(256) * (i + 1) as f64) / (n + 1) as f64); acc + dist.pow(2) }); + println!(">>> EVAL FOR N {n} gives {value} -- smallest so far {smallest_value_found}"); if value < smallest_value_found { smallest_value_found = value; best_n_found = n; @@ -156,7 +157,12 @@ fn common_prefix_length(lhs: &[u8], rhs: &[u8]) -> usize { #[cfg(test)] mod tests { - use super::common_prefix_length; + use crate::sort_peers_by_address; + + use super::{common_prefix_length, get_net_size_estimate, RandomKeysAndClosestPeerIds}; + + use libp2p::{kad::K_VALUE, PeerId}; + use sn_protocol::{storage::ChunkAddress, NetworkAddress}; // we use XorName utilities just because it's easier to build test data with them use xor_name::XorName; @@ -187,6 +193,31 @@ mod tests { // Build a map with 256 random keys, one for each Kbucket // with their corresponding K-closest peers to a random CID; // e.g. in Kbucket #2 get the 20 closest peers to a random CID that shares 2 bits as a prefix. - todo!(); + const NUM_OF_KBUCKETS: usize = 256; + const NUM_OF_PEERS: usize = 200; + let random_peers: Vec = (0..NUM_OF_PEERS).map(|_| PeerId::random()).collect(); + let mut random_keys = RandomKeysAndClosestPeerIds::default(); + + let mut rng = rand::thread_rng(); + for _i in 0..NUM_OF_KBUCKETS { + let xorname = XorName::random(&mut rng); + let address = NetworkAddress::ChunkAddress(ChunkAddress::new(xorname)); + let sorted_peers: Vec = + sort_peers_by_address(&random_peers, &address, K_VALUE.get()) + .unwrap() + .iter() + .map(|p| (**p)) + .collect(); + random_keys.push((address.as_kbucket_key(), sorted_peers)); + } + + assert_eq!( + random_keys.iter().filter(|(_, c)| c.len() >= 20).count(), + NUM_OF_KBUCKETS + ); + + let estimate = get_net_size_estimate(&random_keys); + println!(">>> NET SIZE ESTIMATE: {estimate}"); + assert_eq!(estimate, NUM_OF_PEERS); } }