From a7fc5e8c6bb88c245331e58ba27c7c91159707cd Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 5 May 2024 12:11:19 -0700 Subject: [PATCH 01/39] start commit-reveal WIP --- pallets/subtensor/src/lib.rs | 70 ++++++++++++++++++++++++++++---- pallets/subtensor/src/weights.rs | 52 ++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 7 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 77defd437..e2f003590 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -302,6 +302,16 @@ pub mod pallet { ValueQuery, DefaultAccountTake, >; + // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. + #[pallet::storage] + pub type WeightCommits = StorageDoubleMap< + _, + Twox64Concat, + u16, + Twox64Concat, + T::AccountId, + (T::Hash, u64), + ValueQuery>; // ===================================== // ==== Difficulty / Registrations ===== @@ -1017,6 +1027,10 @@ pub mod pallet { /// Thrown a stake would be below the minimum threshold for nominator validations NomStakeBelowMinimumThreshold, InvalidTake, // --- Thrown when delegate take is being set out of bounds + CommitNotAllowed, + NoCommitFound, + InvalidRevealTempo, + InvalidReveal, } // ================== @@ -1319,18 +1333,44 @@ pub mod pallet { // // * 'MaxWeightExceeded': // - Attempting to set weights with max value exceeding limit. + // #[pallet::call_index(0)] + // #[pallet::weight((Weight::from_parts(10_151_000_000, 0) + // .saturating_add(T::DbWeight::get().reads(4104)) + // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + // pub fn set_weights( + // origin: OriginFor, + // netuid: u16, + // dests: Vec, + // weights: Vec, + // version_key: u64, + // ) -> DispatchResult { + // Self::do_set_weights(origin, netuid, dests, weights, version_key) + // } + #[pallet::call_index(0)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] - pub fn set_weights( - origin: OriginFor, + pub fn commit_weights( + origin: T::RuntimeOrigin, netuid: u16, - dests: Vec, - weights: Vec, + commit_hash: T::Hash, + ) -> DispatchResult { + Self::do_commit_weights(origin, netuid, commit_hash) + } + + #[pallet::call_index(97)] + #[pallet::weight((Weight::from_parts(10_151_000_000, 0) + .saturating_add(T::DbWeight::get().reads(4104)) + .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + pub fn reveal_weights( + origin: T::RuntimeOrigin, + netuid: u16, + uids: Vec, + values: Vec, version_key: u64, ) -> DispatchResult { - Self::do_set_weights(origin, netuid, dests, weights, version_key) + Self::do_reveal_weights(origin, netuid, uids, values, version_key) } // # Args: @@ -2045,7 +2085,19 @@ where _len: usize, ) -> TransactionValidity { match call.is_sub_type() { - Some(Call::set_weights { netuid, .. }) => { + Some(Call::commit_weights { netuid, .. }) => { + if Self::check_weights_min_stake(who) { + let priority: u64 = Self::get_priority_set_weights(who, *netuid); + Ok(ValidTransaction { + priority, + longevity: 1, + ..Default::default() + }) + } else { + Err(InvalidTransaction::Call.into()) + } + } + Some(Call::reveal_weights { netuid, .. }) => { if Self::check_weights_min_stake(who) { let priority: u64 = Self::get_priority_set_weights(who, *netuid); Ok(ValidTransaction { @@ -2119,7 +2171,11 @@ where let transaction_fee = 0; Ok((CallType::RemoveStake, transaction_fee, who.clone())) } - Some(Call::set_weights { .. }) => { + Some(Call::commit_weights { .. }) => { + let transaction_fee = 0; + Ok((CallType::SetWeights, transaction_fee, who.clone())) + } + Some(Call::reveal_weights { .. }) => { let transaction_fee = 0; Ok((CallType::SetWeights, transaction_fee, who.clone())) } diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 1bbb39491..db3be0588 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -1,8 +1,53 @@ use super::*; use crate::math::*; use sp_std::vec; +use sp_runtime::traits::Hash; impl Pallet { + + pub fn do_commit_weights( + origin: T::RuntimeOrigin, + netuid: u16, + commit_hash: T::Hash, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + ensure!(Self::can_commit(netuid, &who), Error::::CommitNotAllowed); + + WeightCommits::::insert( + netuid, + &who, + ( + commit_hash, + Self::get_current_block_as_u64(), + ), + ); + Ok(()) + } + + pub fn do_reveal_weights( + origin: T::RuntimeOrigin, + netuid: u16, + uids: Vec, + values: Vec, + version_key: u64, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { + let (commit_hash, commit_block) = + maybe_commit.take().ok_or(Error::::NoCommitFound)?; + + ensure!( + Self::is_reveal_block(netuid, commit_block), + Error::::InvalidRevealTempo + ); + + let provided_hash = T::Hashing::hash_of(&(who.clone(), netuid, uids.clone(), values.clone(), version_key)); + ensure!(provided_hash == commit_hash, Error::::InvalidReveal); + + Self::do_set_weights(origin, netuid, uids, values, version_key) + }) + } + // ---- The implementation for the extrinsic set_weights. // // # Args: @@ -324,4 +369,11 @@ impl Pallet { // we should expect at most subnetwork_n uids. uids.len() <= subnetwork_n as usize } + + pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { + return true; + } + pub fn is_reveal_block(netuid: u16, commit_block: u64) -> bool { + return true; + } } From e323eb6ac7c011d579bb63d9a06befc35d02a036 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Mon, 6 May 2024 15:31:43 -0700 Subject: [PATCH 02/39] do commit/reveal & add tests --- pallets/subtensor/src/lib.rs | 33 ++-- pallets/subtensor/src/weights.rs | 73 ++++++-- pallets/subtensor/tests/weights.rs | 267 ++++++++++++++++++++++++++++- 3 files changed, 345 insertions(+), 28 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e2f003590..b20101067 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -64,6 +64,7 @@ pub mod pallet { traits::{tokens::fungible, UnfilteredDispatchable}, }; use frame_system::pallet_prelude::*; + use sp_core::H256; use sp_runtime::traits::TrailingZeroInput; use sp_std::vec; use sp_std::vec::Vec; @@ -302,16 +303,6 @@ pub mod pallet { ValueQuery, DefaultAccountTake, >; - // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. - #[pallet::storage] - pub type WeightCommits = StorageDoubleMap< - _, - Twox64Concat, - u16, - Twox64Concat, - T::AccountId, - (T::Hash, u64), - ValueQuery>; // ===================================== // ==== Difficulty / Registrations ===== @@ -792,6 +783,20 @@ pub mod pallet { pub type AdjustmentAlpha = StorageMap<_, Identity, u16, u64, ValueQuery, DefaultAdjustmentAlpha>; + // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. + #[pallet::storage] + pub type WeightCommits = + StorageDoubleMap<_, Twox64Concat, u16, Twox64Concat, T::AccountId, (H256, u64), ValueQuery>; + + #[pallet::type_value] + pub fn DefaultWeightCommitRevealInterval() -> u64 { + 1000 + } + + #[pallet::storage] + pub type WeightCommitRevealInterval = + StorageValue<_, u64, ValueQuery, DefaultWeightCommitRevealInterval>; + // ======================================= // ==== Subnetwork Consensus Storage ==== // ======================================= @@ -1335,8 +1340,8 @@ pub mod pallet { // - Attempting to set weights with max value exceeding limit. // #[pallet::call_index(0)] // #[pallet::weight((Weight::from_parts(10_151_000_000, 0) - // .saturating_add(T::DbWeight::get().reads(4104)) - // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + // .saturating_add(T::DbWeight::get().reads(4104)) + // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] // pub fn set_weights( // origin: OriginFor, // netuid: u16, @@ -1347,14 +1352,14 @@ pub mod pallet { // Self::do_set_weights(origin, netuid, dests, weights, version_key) // } - #[pallet::call_index(0)] + #[pallet::call_index(96)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] pub fn commit_weights( origin: T::RuntimeOrigin, netuid: u16, - commit_hash: T::Hash, + commit_hash: H256, ) -> DispatchResult { Self::do_commit_weights(origin, netuid, commit_hash) } diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index db3be0588..aa15b77d5 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -1,14 +1,15 @@ use super::*; use crate::math::*; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, Hash}; +use sp_runtime::SaturatedConversion; use sp_std::vec; -use sp_runtime::traits::Hash; impl Pallet { - pub fn do_commit_weights( origin: T::RuntimeOrigin, netuid: u16, - commit_hash: T::Hash, + commit_hash: H256, ) -> DispatchResult { let who = ensure_signed(origin)?; ensure!(Self::can_commit(netuid, &who), Error::::CommitNotAllowed); @@ -16,10 +17,7 @@ impl Pallet { WeightCommits::::insert( netuid, &who, - ( - commit_hash, - Self::get_current_block_as_u64(), - ), + (commit_hash, Self::get_current_block_as_u64()), ); Ok(()) } @@ -32,16 +30,27 @@ impl Pallet { version_key: u64, ) -> DispatchResult { let who = ensure_signed(origin.clone())?; + let nonce: u64 = frame_system::Pallet::::account(&who) + .nonce + .saturated_into(); + WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { let (commit_hash, commit_block) = maybe_commit.take().ok_or(Error::::NoCommitFound)?; ensure!( - Self::is_reveal_block(netuid, commit_block), + Self::is_reveal_block_range(commit_block), Error::::InvalidRevealTempo ); - let provided_hash = T::Hashing::hash_of(&(who.clone(), netuid, uids.clone(), values.clone(), version_key)); + let provided_hash: H256 = BlakeTwo256::hash_of(&( + who.clone(), + nonce, + netuid, + uids.clone(), + values.clone(), + version_key, + )); ensure!(provided_hash == commit_hash, Error::::InvalidReveal); Self::do_set_weights(origin, netuid, uids, values, version_key) @@ -371,9 +380,49 @@ impl Pallet { } pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { - return true; + let (hash, commit_block) = WeightCommits::::get(netuid, who); + + //First commit case + if hash == H256::default() || commit_block == 0 { + return true; + } + + let interval: u64 = Self::get_weight_commit_interval(); + let current_block: u64 = Self::get_current_block_as_u64(); + let interval_start: u64 = current_block - (current_block % interval); + let last_commit_interval_start: u64 = commit_block - (commit_block % interval); + + // Allow commit if we're within the interval bounds + if current_block > interval_start + && current_block < interval_start + interval + && interval_start > last_commit_interval_start + { + return true; + } + + false } - pub fn is_reveal_block(netuid: u16, commit_block: u64) -> bool { - return true; + + pub fn is_reveal_block_range(commit_block: u64) -> bool { + let interval: u64 = Self::get_weight_commit_interval(); + let commit_interval_start: u64 = commit_block - (commit_block % interval); // Find the start of the interval in which the commit occurred + let reveal_interval_start: u64 = commit_interval_start + interval; // Start of the next interval after the commit interval + let current_block: u64 = Self::get_current_block_as_u64(); + + // Allow reveal if the current block is within the interval following the commit's interval + if current_block > reveal_interval_start && current_block < reveal_interval_start + interval + { + return true; + } + + false + } + + pub fn get_weight_commit_interval() -> u64 { + WeightCommitRevealInterval::::get() + } + + pub fn set_weight_commit_interval(interval: u64) { + WeightCommitRevealInterval::::set(interval) } } diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index 3d7673982..5941ebbf4 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -5,8 +5,11 @@ use frame_support::{ }; use mock::*; use pallet_subtensor::Error; -use sp_core::U256; -use sp_runtime::DispatchError; +use sp_core::{H256, U256}; +use sp_runtime::{ + traits::{BlakeTwo256, Hash}, + DispatchError, +}; use substrate_fixed::types::I32F32; /*************************** @@ -965,3 +968,263 @@ fn test_check_len_uids_within_allowed_not_within_network_pool() { ); }); } + +#[test] +fn test_commit_reveal_weights_ok() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let uids: Vec = vec![0, 1]; + let weight_values: Vec = vec![10, 10]; + let version_key: u64 = 0; + let hotkey: U256 = U256::from(1); + let nonce: u64 = 0; + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + add_network(netuid, 0, 0); + register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); + register_ok_neuron(netuid, U256::from(1), U256::from(2), 100000); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + SubtensorModule::set_validator_permit_for_uid(netuid, 0, true); + SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); + + SubtensorModule::set_weight_commit_interval(5); + + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + + step_block(5); + + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids, + weight_values, + version_key, + )); + }); +} + +#[test] +fn test_commit_reveal_interval() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let uids: Vec = vec![0, 1]; + let weight_values: Vec = vec![10, 10]; + let version_key: u64 = 0; + let hotkey: U256 = U256::from(1); + let nonce: u64 = 0; + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + add_network(netuid, 0, 0); + register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); + register_ok_neuron(netuid, U256::from(1), U256::from(2), 100000); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + SubtensorModule::set_validator_permit_for_uid(netuid, 0, true); + SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); + + SubtensorModule::set_weight_commit_interval(100); + + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + assert_err!( + SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash), + Error::::CommitNotAllowed + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + step_block(99); + assert_err!( + SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash), + Error::::CommitNotAllowed + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + step_block(1); + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + // After the previous reveal the associated mapping entry was removed. + // Therefore we expect NoCommitFound + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::NoCommitFound + ); + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + step_block(100); + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + // Testing that if you miss the next tempo you cannot reveal it. + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + step_block(205); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + }); +} + +#[test] +fn test_commit_reveal_hash() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let uids: Vec = vec![0, 1]; + let weight_values: Vec = vec![10, 10]; + let version_key: u64 = 0; + let hotkey: U256 = U256::from(1); + let nonce: u64 = 0; + + add_network(netuid, 0, 0); + register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); + register_ok_neuron(netuid, U256::from(1), U256::from(2), 100000); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + SubtensorModule::set_validator_permit_for_uid(netuid, 0, true); + SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); + + SubtensorModule::set_weight_commit_interval(5); + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + + step_block(5); + + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + vec![0, 2], + weight_values.clone(), + version_key + ), + Error::::InvalidReveal + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + 7, + ), + Error::::InvalidReveal + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + vec![10, 9], + version_key, + ), + Error::::InvalidReveal + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + vec![0, 1, 2], + vec![10, 10, 33], + 9, + ), + Error::::InvalidReveal + ); + + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids, + weight_values, + version_key, + )); + }); +} From 172e31a5631d09eac05d911a01aa1b84aba7e30b Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Mon, 6 May 2024 16:04:08 -0700 Subject: [PATCH 03/39] fix --- pallets/subtensor/src/lib.rs | 11 +++++++++-- pallets/subtensor/src/weights.rs | 33 +++++++++++++++----------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index b20101067..f1856da93 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -785,8 +785,15 @@ pub mod pallet { // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. #[pallet::storage] - pub type WeightCommits = - StorageDoubleMap<_, Twox64Concat, u16, Twox64Concat, T::AccountId, (H256, u64), ValueQuery>; + pub type WeightCommits = StorageDoubleMap< + _, + Twox64Concat, + u16, + Twox64Concat, + T::AccountId, + (H256, u64), + OptionQuery, + >; #[pallet::type_value] pub fn DefaultWeightCommitRevealInterval() -> u64 { diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index aa15b77d5..6198b5ed7 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -380,27 +380,24 @@ impl Pallet { } pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { - let (hash, commit_block) = WeightCommits::::get(netuid, who); - - //First commit case - if hash == H256::default() || commit_block == 0 { - return true; - } - - let interval: u64 = Self::get_weight_commit_interval(); - let current_block: u64 = Self::get_current_block_as_u64(); - let interval_start: u64 = current_block - (current_block % interval); - let last_commit_interval_start: u64 = commit_block - (commit_block % interval); + if let Some((_hash, commit_block)) = WeightCommits::::get(netuid, who) { + let interval: u64 = Self::get_weight_commit_interval(); + let current_block: u64 = Self::get_current_block_as_u64(); + let interval_start: u64 = current_block - (current_block % interval); + let last_commit_interval_start: u64 = commit_block - (commit_block % interval); + + // Allow commit if we're within the interval bounds + if current_block > interval_start + && current_block < interval_start + interval + && interval_start > last_commit_interval_start + { + return true; + } - // Allow commit if we're within the interval bounds - if current_block > interval_start - && current_block < interval_start + interval - && interval_start > last_commit_interval_start - { + false + } else { return true; } - - false } pub fn is_reveal_block_range(commit_block: u64) -> bool { From c0449471436ddd30e1ebc7e2cfe73f01708a5375 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Tue, 7 May 2024 10:49:22 -0700 Subject: [PATCH 04/39] fix checks --- pallets/subtensor/src/weights.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 6198b5ed7..9cbc4a6ac 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -387,8 +387,8 @@ impl Pallet { let last_commit_interval_start: u64 = commit_block - (commit_block % interval); // Allow commit if we're within the interval bounds - if current_block > interval_start - && current_block < interval_start + interval + if current_block >= interval_start + && current_block <= interval_start + interval && interval_start > last_commit_interval_start { return true; @@ -407,7 +407,8 @@ impl Pallet { let current_block: u64 = Self::get_current_block_as_u64(); // Allow reveal if the current block is within the interval following the commit's interval - if current_block > reveal_interval_start && current_block < reveal_interval_start + interval + if current_block >= reveal_interval_start + && current_block < reveal_interval_start + interval { return true; } From 81a8aad8e101958e3cd4b8900153482e06e3cfa6 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Tue, 7 May 2024 10:49:42 -0700 Subject: [PATCH 05/39] fix tests --- pallets/subtensor/tests/epoch.rs | 38 ++--- pallets/subtensor/tests/weights.rs | 225 +++++++++++++++-------------- 2 files changed, 132 insertions(+), 131 deletions(-) diff --git a/pallets/subtensor/tests/epoch.rs b/pallets/subtensor/tests/epoch.rs index 0bfd11ba4..6a489740c 100644 --- a/pallets/subtensor/tests/epoch.rs +++ b/pallets/subtensor/tests/epoch.rs @@ -205,7 +205,7 @@ fn init_run_epochs( let sparse_weights = input_weights[*uid as usize].clone(); weights = sparse_weights.iter().map(|(_, w)| *w).collect(); let srvs: Vec = sparse_weights.iter().map(|(s, _)| *s).collect(); - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, srvs, @@ -213,7 +213,7 @@ fn init_run_epochs( 0 )); } else { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, servers.to_vec(), @@ -224,7 +224,7 @@ fn init_run_epochs( } if server_self { for uid in servers { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, vec![*uid], @@ -558,7 +558,7 @@ fn test_1_graph() { SubtensorModule::append_neuron(netuid, &hotkey, 0); assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 1); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], @@ -625,7 +625,7 @@ fn test_10_graph() { assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 10); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block for i in 0..10 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(i)), netuid, vec![i as u16], @@ -1005,7 +1005,7 @@ fn test_bonds() { // === Set weights [val->srv1: 0.1, val->srv2: 0.2, val->srv3: 0.3, val->srv4: 0.4] for uid in 0..(n/2) as u64 { - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); } if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1050,7 +1050,7 @@ fn test_bonds() { // === Set self-weight only on val1 let uid = 0; - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1097,7 +1097,7 @@ fn test_bonds() { // === Set self-weight only on val2 let uid = 1; - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1133,7 +1133,7 @@ fn test_bonds() { // === Set self-weight only on val3 let uid = 2; - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1168,7 +1168,7 @@ fn test_bonds() { assert_eq!(bonds[3][7], 65535); // === Set val3->srv4: 1 - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1316,7 +1316,7 @@ fn test_active_stake() { // === Set weights [val1->srv1: 0.5, val1->srv2: 0.5, val2->srv1: 0.5, val2->srv2: 0.5] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1356,7 +1356,7 @@ fn test_active_stake() { run_to_block(activity_cutoff + 2); // run to block where validator (uid 0, 1) weights become outdated // === Update uid 0 weights - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1416,7 +1416,7 @@ fn test_active_stake() { } // === Update uid 1 weights as well - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(1)), netuid, ((n / 2)..n).collect(), @@ -1525,7 +1525,7 @@ fn test_outdated_weights() { // === Set weights [val1->srv1: 2/3, val1->srv2: 1/3, val2->srv1: 2/3, val2->srv2: 1/3, srv1->srv1: 1, srv2->srv2: 1] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1534,7 +1534,7 @@ fn test_outdated_weights() { )); } for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1604,7 +1604,7 @@ fn test_outdated_weights() { next_block(); // run to next block to outdate weights and bonds set on deregistered uid // === Update weights from only uid=0 - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1728,7 +1728,7 @@ fn test_zero_weights() { // === Self-weights only: set weights [srv->srv: 1] for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1764,7 +1764,7 @@ fn test_zero_weights() { // === Set weights [val->srv: 1/(n/2)] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1818,7 +1818,7 @@ fn test_zero_weights() { // === Set new weights [val->srv: 1/(n/2)] to check that updated weights would produce non-zero incentive for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index 5941ebbf4..d87e34092 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -1,7 +1,7 @@ mod mock; use frame_support::{ assert_err, assert_ok, - dispatch::{DispatchClass, GetDispatchInfo, Pays}, + dispatch::{DispatchClass, DispatchResult, GetDispatchInfo, Pays}, }; use mock::*; use pallet_subtensor::Error; @@ -19,17 +19,41 @@ use substrate_fixed::types::I32F32; // Test the call passes through the subtensor module. #[test] #[cfg(not(tarpaulin))] -fn test_set_weights_dispatch_info_ok() { +fn test_commit_weights_dispatch_info_ok() { new_test_ext(0).execute_with(|| { let dests = vec![1, 1]; let weights = vec![1, 1]; let netuid: u16 = 1; let version_key: u64 = 0; - let call = RuntimeCall::SubtensorModule(SubtensorCall::set_weights { + let hotkey: U256 = U256::from(1); + + let commit_hash: H256 = + BlakeTwo256::hash_of(&(hotkey, 0, netuid, dests, weights, version_key)); + + let call = RuntimeCall::SubtensorModule(SubtensorCall::commit_weights { netuid, - dests, - weights, - version_key, + commit_hash, + }); + let dispatch_info = call.get_dispatch_info(); + + assert_eq!(dispatch_info.class, DispatchClass::Normal); + assert_eq!(dispatch_info.pays_fee, Pays::No); + }); +} + +#[test] +fn test_reveal_weights_dispatch_info_ok() { + new_test_ext(0).execute_with(|| { + let dests = vec![1, 1]; + let weights = vec![1, 1]; + let netuid: u16 = 1; + let version_key: u64 = 0; + + let call = RuntimeCall::SubtensorModule(SubtensorCall::reveal_weights { + netuid: netuid, + uids: dests, + values: weights, + version_key: version_key, }); let dispatch_info = call.get_dispatch_info(); @@ -43,19 +67,13 @@ fn test_set_weights_is_root_error() { new_test_ext(0).execute_with(|| { let root_netuid: u16 = 0; - let dests = vec![0]; + let uids = vec![0]; let weights = vec![1]; let version_key: u64 = 0; let hotkey = U256::from(1); assert_err!( - SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), - root_netuid, - dests.clone(), - weights.clone(), - version_key, - ), + commit_reveal_set_weights(hotkey, root_netuid, uids, weights, version_key), Error::::IsRoot ); }); @@ -78,13 +96,9 @@ fn test_weights_err_no_validator_permit() { let weights_keys: Vec = vec![1, 2]; let weight_values: Vec = vec![1, 2]; - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), - netuid, - weights_keys, - weight_values, - 0, - ); + + let result = + commit_reveal_set_weights(hotkey_account_id, netuid, weights_keys, weight_values, 0); assert_eq!(result, Err(Error::::NoValidatorPermit.into())); let weights_keys: Vec = vec![1, 2]; @@ -93,13 +107,8 @@ fn test_weights_err_no_validator_permit() { SubtensorModule::get_uid_for_net_and_hotkey(netuid, &hotkey_account_id) .expect("Not registered."); SubtensorModule::set_validator_permit_for_uid(netuid, neuron_uid, true); - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), - netuid, - weights_keys, - weight_values, - 0, - ); + let result = + commit_reveal_set_weights(hotkey_account_id, netuid, weights_keys, weight_values, 0); assert_ok!(result); }); } @@ -130,24 +139,18 @@ fn test_set_weights_min_stake_failed() { // Check that it fails at the pallet level. SubtensorModule::set_weights_min_stake(100_000_000_000_000); assert_eq!( - SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), - netuid, - dests.clone(), - weights.clone(), - version_key, - ), + commit_reveal_set_weights(hotkey, netuid, dests.clone(), weights.clone(), version_key), Err(Error::::NotEnoughStakeToSetWeights.into()) ); // Now passes SubtensorModule::increase_stake_on_hotkey_account(&hotkey, 100_000_000_000_000); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid, dests.clone(), weights.clone(), - version_key, - ),); + version_key + )); }); } @@ -166,15 +169,15 @@ fn test_weights_version_key() { let weights_keys: Vec = vec![0]; let weight_values: Vec = vec![1]; - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid0, weights_keys.clone(), weight_values.clone(), 0 )); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid1, weights_keys.clone(), weight_values.clone(), @@ -188,15 +191,15 @@ fn test_weights_version_key() { SubtensorModule::set_weights_version_key(netuid1, key1); // Setting works with version key. - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid0, weights_keys.clone(), weight_values.clone(), key0 )); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid1, weights_keys.clone(), weight_values.clone(), @@ -204,8 +207,8 @@ fn test_weights_version_key() { )); // validator:20313 >= network:12312 (accepted: validator newer) - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid0, weights_keys.clone(), weight_values.clone(), @@ -215,8 +218,8 @@ fn test_weights_version_key() { // Setting fails with incorrect keys. // validator:12312 < network:20313 (rejected: validator not updated) assert_eq!( - SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + commit_reveal_set_weights( + hotkey, netuid1, weights_keys.clone(), weight_values.clone(), @@ -254,7 +257,7 @@ fn test_weights_err_setting_weights_too_fast() { // Note that LastUpdate has default 0 for new uids, but if they have actually set weights on block 0 // then they are allowed to set weights again once more without a wait restriction, to accommodate the default. - let result = SubtensorModule::set_weights( + let result = SubtensorModule::do_set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -265,7 +268,7 @@ fn test_weights_err_setting_weights_too_fast() { run_to_block(1); for i in 1..100 { - let result = SubtensorModule::set_weights( + let result = SubtensorModule::do_set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -297,11 +300,11 @@ fn test_weights_err_weights_vec_not_equal_size() { SubtensorModule::set_validator_permit_for_uid(netuid, neuron_uid, true); let weights_keys: Vec = vec![1, 2, 3, 4, 5, 6]; let weight_values: Vec = vec![1, 2, 3, 4, 5]; // Uneven sizes - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), + let result = commit_reveal_set_weights( + hotkey_account_id, 1, - weights_keys, - weight_values, + weights_keys.clone(), + weight_values.clone(), 0, ); assert_eq!(result, Err(Error::::WeightVecNotEqualSize.into())); @@ -346,11 +349,11 @@ fn test_weights_err_has_duplicate_ids() { let weights_keys: Vec = vec![1, 1, 1]; // Contains duplicates let weight_values: Vec = vec![1, 2, 3]; - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), + let result = commit_reveal_set_weights( + hotkey_account_id, netuid, - weights_keys, - weight_values, + weights_keys.clone(), + weight_values.clone(), 0, ); assert_eq!(result, Err(Error::::DuplicateUids.into())); @@ -425,20 +428,13 @@ fn test_weights_err_max_weight_limit() { // Non self-weight fails. let uids: Vec = vec![1, 2, 3, 4]; let values: Vec = vec![u16::MAX / 4, u16::MAX / 4, u16::MAX / 54, u16::MAX / 4]; - let result = - SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(0)), 1, uids, values, 0); + let result = commit_reveal_set_weights(U256::from(0), 1, uids, values, 0); assert_eq!(result, Err(Error::::MaxWeightExceeded.into())); // Self-weight is a success. let uids: Vec = vec![0]; // Self. let values: Vec = vec![u16::MAX]; // normalizes to u32::MAX - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(0)), - 1, - uids, - values, - 0 - )); + assert_ok!(commit_reveal_set_weights(U256::from(0), 1, uids, values, 0)); }); } @@ -448,7 +444,7 @@ fn test_no_signature() { new_test_ext(0).execute_with(|| { let uids: Vec = vec![]; let values: Vec = vec![]; - let result = SubtensorModule::set_weights(RuntimeOrigin::none(), 1, uids, values, 0); + let result = SubtensorModule::do_set_weights(RuntimeOrigin::none(), 1, uids, values, 0); assert_eq!(result, Err(DispatchError::BadOrigin)); }); } @@ -469,13 +465,7 @@ fn test_set_weights_err_not_active() { let weights_keys: Vec = vec![0]; // Uid 0 is valid. let weight_values: Vec = vec![1]; // This hotkey is NOT registered. - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), - 1, - weights_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(U256::from(1), 1, weights_keys, weight_values, 0); assert_eq!(result, Err(Error::::NotRegistered.into())); }); } @@ -495,13 +485,7 @@ fn test_set_weights_err_invalid_uid() { SubtensorModule::set_validator_permit_for_uid(netuid, neuron_uid, true); let weight_keys: Vec = vec![9999]; // Does not exist let weight_values: Vec = vec![88]; // random value - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(hotkey_account_id, 1, weight_keys, weight_values, 0); assert_eq!(result, Err(Error::::InvalidUid.into())); }); } @@ -527,20 +511,14 @@ fn test_set_weight_not_enough_values() { // Should fail because we are only setting a single value and its not the self weight. let weight_keys: Vec = vec![1]; // not weight. let weight_values: Vec = vec![88]; // random value. - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(account_id), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(account_id, 1, weight_keys, weight_values, 0); assert_eq!(result, Err(Error::::NotSettingEnoughWeights.into())); // Shouldnt fail because we setting a single value but it is the self weight. let weight_keys: Vec = vec![0]; // self weight. let weight_values: Vec = vec![88]; // random value. - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(account_id), + assert_ok!(commit_reveal_set_weights( + account_id, 1, weight_keys, weight_values, @@ -551,8 +529,8 @@ fn test_set_weight_not_enough_values() { let weight_keys: Vec = vec![0, 1]; // self weight. let weight_values: Vec = vec![10, 10]; // random value. SubtensorModule::set_min_allowed_weights(netuid, 1); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(account_id), + assert_ok!(commit_reveal_set_weights( + account_id, 1, weight_keys, weight_values, @@ -581,20 +559,14 @@ fn test_set_weight_too_many_uids() { // Should fail because we are setting more weights than there are neurons. let weight_keys: Vec = vec![0, 1, 2, 3, 4]; // more uids than neurons in subnet. let weight_values: Vec = vec![88, 102, 303, 1212, 11]; // random value. - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(U256::from(1), 1, weight_keys, weight_values, 0); assert_eq!(result, Err(Error::::TooManyUids.into())); // Shouldnt fail because we are setting less weights than there are neurons. let weight_keys: Vec = vec![0, 1]; // Only on neurons that exist. let weight_values: Vec = vec![10, 10]; // random value. - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), + assert_ok!(commit_reveal_set_weights( + U256::from(1), 1, weight_keys, weight_values, @@ -626,13 +598,7 @@ fn test_set_weights_sum_larger_than_u16_max() { // sum of weights is larger than u16 max. assert!(weight_values.iter().map(|x| *x as u64).sum::() > (u16::MAX as u64)); - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(U256::from(1), 1, weight_keys, weight_values, 0); assert_ok!(result); // Get max-upscaled unnormalized weights. @@ -1042,6 +1008,7 @@ fn test_commit_reveal_interval() { SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); SubtensorModule::set_weight_commit_interval(100); + System::set_block_number(0); assert_ok!(SubtensorModule::commit_weights( RuntimeOrigin::signed(hotkey), @@ -1228,3 +1195,37 @@ fn test_commit_reveal_hash() { )); }); } + +fn commit_reveal_set_weights( + hotkey: U256, + netuid: u16, + uids: Vec, + weights: Vec, + version_key: u64, +) -> DispatchResult { + SubtensorModule::set_weight_commit_interval(5); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + 0_u64, + netuid, + uids.clone(), + weights.clone(), + version_key, + )); + + SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash)?; + + step_block(5); + + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids, + weights, + version_key, + )?; + + Ok(()) +} From 001918a57fd7b3014d7eb4a074e1ee4b569c1d5f Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Tue, 7 May 2024 11:14:48 -0700 Subject: [PATCH 06/39] re add errors --- pallets/subtensor/src/errors.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pallets/subtensor/src/errors.rs b/pallets/subtensor/src/errors.rs index 9b703255b..9798fb2f1 100644 --- a/pallets/subtensor/src/errors.rs +++ b/pallets/subtensor/src/errors.rs @@ -132,5 +132,13 @@ mod errors { NomStakeBelowMinimumThreshold, /// delegate take is being set out of bounds InvalidTake, + /// Not allowed to comit weights + CommitNotAllowed, + /// No commit found for provided hotkey+netuid when attempting to reveal weights + NoCommitFound, + /// Not the correct block/range to reveal weights + InvalidRevealTempo, + /// Committed hash does not equal the hashed reveal data + InvalidReveal, } } From 1b22f33c435b81f1a405dd839f9659ee6213fda1 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 08:07:22 -0700 Subject: [PATCH 07/39] revert set_weights removal --- pallets/subtensor/src/lib.rs | 38 ++++++++++++++++++++---------- pallets/subtensor/tests/epoch.rs | 38 +++++++++++++++--------------- pallets/subtensor/tests/weights.rs | 26 +++++++++++++++++--- 3 files changed, 67 insertions(+), 35 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 82d7df7ac..e8add9cf0 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1204,19 +1204,19 @@ pub mod pallet { // // * 'MaxWeightExceeded': // - Attempting to set weights with max value exceeding limit. - // #[pallet::call_index(0)] - // #[pallet::weight((Weight::from_parts(10_151_000_000, 0) - // .saturating_add(T::DbWeight::get().reads(4104)) - // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] - // pub fn set_weights( - // origin: OriginFor, - // netuid: u16, - // dests: Vec, - // weights: Vec, - // version_key: u64, - // ) -> DispatchResult { - // Self::do_set_weights(origin, netuid, dests, weights, version_key) - // } + #[pallet::call_index(0)] + #[pallet::weight((Weight::from_parts(10_151_000_000, 0) + .saturating_add(T::DbWeight::get().reads(4104)) + .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + pub fn set_weights( + origin: OriginFor, + netuid: u16, + dests: Vec, + weights: Vec, + version_key: u64, + ) -> DispatchResult { + Self::do_set_weights(origin, netuid, dests, weights, version_key) + } #[pallet::call_index(96)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) @@ -1980,6 +1980,18 @@ where Err(InvalidTransaction::Call.into()) } } + Some(Call::set_weights { netuid, .. }) => { + if Self::check_weights_min_stake(who) { + let priority: u64 = Self::get_priority_set_weights(who, *netuid); + Ok(ValidTransaction { + priority, + longevity: 1, + ..Default::default() + }) + } else { + Err(InvalidTransaction::Call.into()) + } + } Some(Call::set_root_weights { netuid, .. }) => { if Self::check_weights_min_stake(who) { let priority: u64 = Self::get_priority_set_weights(who, *netuid); diff --git a/pallets/subtensor/tests/epoch.rs b/pallets/subtensor/tests/epoch.rs index 6a489740c..0bfd11ba4 100644 --- a/pallets/subtensor/tests/epoch.rs +++ b/pallets/subtensor/tests/epoch.rs @@ -205,7 +205,7 @@ fn init_run_epochs( let sparse_weights = input_weights[*uid as usize].clone(); weights = sparse_weights.iter().map(|(_, w)| *w).collect(); let srvs: Vec = sparse_weights.iter().map(|(s, _)| *s).collect(); - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, srvs, @@ -213,7 +213,7 @@ fn init_run_epochs( 0 )); } else { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, servers.to_vec(), @@ -224,7 +224,7 @@ fn init_run_epochs( } if server_self { for uid in servers { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, vec![*uid], @@ -558,7 +558,7 @@ fn test_1_graph() { SubtensorModule::append_neuron(netuid, &hotkey, 0); assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 1); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], @@ -625,7 +625,7 @@ fn test_10_graph() { assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 10); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block for i in 0..10 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(i)), netuid, vec![i as u16], @@ -1005,7 +1005,7 @@ fn test_bonds() { // === Set weights [val->srv1: 0.1, val->srv2: 0.2, val->srv3: 0.3, val->srv4: 0.4] for uid in 0..(n/2) as u64 { - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); } if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1050,7 +1050,7 @@ fn test_bonds() { // === Set self-weight only on val1 let uid = 0; - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1097,7 +1097,7 @@ fn test_bonds() { // === Set self-weight only on val2 let uid = 1; - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1133,7 +1133,7 @@ fn test_bonds() { // === Set self-weight only on val3 let uid = 2; - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1168,7 +1168,7 @@ fn test_bonds() { assert_eq!(bonds[3][7], 65535); // === Set val3->srv4: 1 - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1316,7 +1316,7 @@ fn test_active_stake() { // === Set weights [val1->srv1: 0.5, val1->srv2: 0.5, val2->srv1: 0.5, val2->srv2: 0.5] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1356,7 +1356,7 @@ fn test_active_stake() { run_to_block(activity_cutoff + 2); // run to block where validator (uid 0, 1) weights become outdated // === Update uid 0 weights - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1416,7 +1416,7 @@ fn test_active_stake() { } // === Update uid 1 weights as well - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(1)), netuid, ((n / 2)..n).collect(), @@ -1525,7 +1525,7 @@ fn test_outdated_weights() { // === Set weights [val1->srv1: 2/3, val1->srv2: 1/3, val2->srv1: 2/3, val2->srv2: 1/3, srv1->srv1: 1, srv2->srv2: 1] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1534,7 +1534,7 @@ fn test_outdated_weights() { )); } for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1604,7 +1604,7 @@ fn test_outdated_weights() { next_block(); // run to next block to outdate weights and bonds set on deregistered uid // === Update weights from only uid=0 - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1728,7 +1728,7 @@ fn test_zero_weights() { // === Self-weights only: set weights [srv->srv: 1] for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1764,7 +1764,7 @@ fn test_zero_weights() { // === Set weights [val->srv: 1/(n/2)] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1818,7 +1818,7 @@ fn test_zero_weights() { // === Set new weights [val->srv: 1/(n/2)] to check that updated weights would produce non-zero incentive for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index d87e34092..d941d1aa1 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -19,6 +19,26 @@ use substrate_fixed::types::I32F32; // Test the call passes through the subtensor module. #[test] #[cfg(not(tarpaulin))] +fn test_set_weights_dispatch_info_ok() { + new_test_ext(0).execute_with(|| { + let dests = vec![1, 1]; + let weights = vec![1, 1]; + let netuid: u16 = 1; + let version_key: u64 = 0; + let call = RuntimeCall::SubtensorModule(SubtensorCall::set_weights { + netuid, + dests, + weights, + version_key, + }); + let dispatch_info = call.get_dispatch_info(); + + assert_eq!(dispatch_info.class, DispatchClass::Normal); + assert_eq!(dispatch_info.pays_fee, Pays::No); + }); +} + +#[test] fn test_commit_weights_dispatch_info_ok() { new_test_ext(0).execute_with(|| { let dests = vec![1, 1]; @@ -257,7 +277,7 @@ fn test_weights_err_setting_weights_too_fast() { // Note that LastUpdate has default 0 for new uids, but if they have actually set weights on block 0 // then they are allowed to set weights again once more without a wait restriction, to accommodate the default. - let result = SubtensorModule::do_set_weights( + let result = SubtensorModule::set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -268,7 +288,7 @@ fn test_weights_err_setting_weights_too_fast() { run_to_block(1); for i in 1..100 { - let result = SubtensorModule::do_set_weights( + let result = SubtensorModule::set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -444,7 +464,7 @@ fn test_no_signature() { new_test_ext(0).execute_with(|| { let uids: Vec = vec![]; let values: Vec = vec![]; - let result = SubtensorModule::do_set_weights(RuntimeOrigin::none(), 1, uids, values, 0); + let result = SubtensorModule::set_weights(RuntimeOrigin::none(), 1, uids, values, 0); assert_eq!(result, Err(DispatchError::BadOrigin)); }); } From dcd0b0f197c74abfef62e165924094f067668bd3 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 08:11:23 -0700 Subject: [PATCH 08/39] revert set_weights removal --- pallets/subtensor/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e8add9cf0..e71756ace 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -2054,6 +2054,10 @@ where let transaction_fee = 0; Ok((CallType::RemoveStake, transaction_fee, who.clone())) } + Some(Call::set_weights { .. }) => { + let transaction_fee = 0; + Ok((CallType::SetWeights, transaction_fee, who.clone())) + } Some(Call::commit_weights { .. }) => { let transaction_fee = 0; Ok((CallType::SetWeights, transaction_fee, who.clone())) From 2686befa299711b68ff9b281b2134005c2ed4144 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 08:29:50 -0700 Subject: [PATCH 09/39] cargo clippy --- pallets/subtensor/src/lib.rs | 4 ++-- pallets/subtensor/src/weights.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e71756ace..460cb07c1 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1996,12 +1996,12 @@ where if Self::check_weights_min_stake(who) { let priority: u64 = Self::get_priority_set_weights(who, *netuid); Ok(ValidTransaction { - priority: priority, + priority, longevity: 1, ..Default::default() }) } else { - return Err(InvalidTransaction::Call.into()); + Err(InvalidTransaction::Call.into()) } } Some(Call::add_stake { .. }) => Ok(ValidTransaction { diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 9cbc4a6ac..909c40e20 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -387,8 +387,7 @@ impl Pallet { let last_commit_interval_start: u64 = commit_block - (commit_block % interval); // Allow commit if we're within the interval bounds - if current_block >= interval_start - && current_block <= interval_start + interval + if current_block <= interval_start + interval && interval_start > last_commit_interval_start { return true; @@ -396,7 +395,7 @@ impl Pallet { false } else { - return true; + true } } From 9ba4e48107cc31a7ce85711042ad0076cba26884 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 11:57:11 -0700 Subject: [PATCH 10/39] expand test_commit_reveal_interval --- pallets/subtensor/tests/weights.rs | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index d941d1aa1..d86aee33a 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -1126,6 +1126,46 @@ fn test_commit_reveal_interval() { ), Error::::InvalidRevealTempo ); + + // Testing when you commit but do not reveal until later intervals + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + step_block(425); + let commit_hash_2: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key + 1, + )); + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash_2 + )); + step_block(100); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidReveal + ); + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key + 1, + )); + }); } From 024c7441ba28b7ef8d8fa163aea08783225df2ba Mon Sep 17 00:00:00 2001 From: Samuel Dare Date: Wed, 8 May 2024 23:45:03 +0400 Subject: [PATCH 11/39] feat: make faucet feeless --- Cargo.lock | 32 +++++++++++++++++++++--------- pallets/subtensor/src/lib.rs | 7 +++++-- pallets/subtensor/tests/weights.rs | 1 - runtime/Cargo.toml | 5 ++++- runtime/src/lib.rs | 2 ++ 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17e18432c..0658b1a8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4676,6 +4676,7 @@ dependencies = [ "pallet-proxy", "pallet-registry", "pallet-scheduler", + "pallet-skip-feeless-payment", "pallet-subtensor", "pallet-sudo", "pallet-timestamp", @@ -5143,6 +5144,19 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "pallet-skip-feeless-payment" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0#7049c3c98836b3e9253f6aaa69b6bf3d622e3962" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0)", +] + [[package]] name = "pallet-subtensor" version = "4.0.0-dev" @@ -8284,7 +8298,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -8346,7 +8360,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "proc-macro2", "quote", @@ -8366,7 +8380,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "environmental", "parity-scale-codec", @@ -8549,7 +8563,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8581,7 +8595,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "Inflector", "expander", @@ -8670,7 +8684,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10. [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" [[package]] name = "sp-storage" @@ -8687,7 +8701,7 @@ dependencies = [ [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8722,7 +8736,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "parity-scale-codec", "tracing", @@ -8819,7 +8833,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "impl-trait-for-tuples", "log", diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 460cb07c1..7c3719376 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1804,8 +1804,11 @@ pub mod pallet { #[pallet::call_index(60)] #[pallet::weight((Weight::from_parts(91_000_000, 0) - .saturating_add(T::DbWeight::get().reads(27)) - .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] + .saturating_add(T::DbWeight::get().reads(27)) + .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] + #[pallet::feeless_if(|_origin: &OriginFor, _block_number: &u64, _nonce: &u64, _work: &Vec| -> bool { + cfg!(feature = "pow-faucet") + })] pub fn faucet( origin: OriginFor, block_number: u64, diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index d86aee33a..ebb276667 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -1165,7 +1165,6 @@ fn test_commit_reveal_interval() { weight_values.clone(), version_key + 1, )); - }); } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 1ad9d636b..23e9c54e9 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -49,6 +49,8 @@ sp-session = { workspace = true } sp-std = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } +pallet-skip-feeless-payment= { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.10.0", default-features = false } + # Temporary sudo pallet-sudo = { workspace = true } @@ -142,7 +144,8 @@ std = [ "sp-tracing/std", "log/std", "sp-storage/std", - "sp-genesis-builder/std" + "sp-genesis-builder/std", + "pallet-skip-feeless-payment/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2522b0ad7..b70cd00bb 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,6 +64,7 @@ use pallet_transaction_payment::{CurrencyAdapter, Multiplier}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; +use pallet_skip_feeless_payment::SkipCheckIfFeeless; // Subtensor module pub use pallet_subtensor; @@ -1182,6 +1183,7 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, pallet_subtensor::SubtensorSignedExtension, pallet_commitments::CommitmentsSignedExtension, + SkipCheckIfFeeless, ); type Migrations = ( From 2b8d13e72de49a841ad931af5977206376697f30 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 08:17:47 -0700 Subject: [PATCH 12/39] revert make faucet feeless --- Cargo.lock | 14 -------------- pallets/subtensor/src/lib.rs | 5 +---- runtime/Cargo.toml | 3 --- runtime/src/lib.rs | 2 -- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0658b1a8e..16c6665a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4676,7 +4676,6 @@ dependencies = [ "pallet-proxy", "pallet-registry", "pallet-scheduler", - "pallet-skip-feeless-payment", "pallet-subtensor", "pallet-sudo", "pallet-timestamp", @@ -5144,19 +5143,6 @@ dependencies = [ "sp-trie", ] -[[package]] -name = "pallet-skip-feeless-payment" -version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0#7049c3c98836b3e9253f6aaa69b6bf3d622e3962" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0)", -] - [[package]] name = "pallet-subtensor" version = "4.0.0-dev" diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 7c3719376..37846fb83 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1805,10 +1805,7 @@ pub mod pallet { #[pallet::call_index(60)] #[pallet::weight((Weight::from_parts(91_000_000, 0) .saturating_add(T::DbWeight::get().reads(27)) - .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] - #[pallet::feeless_if(|_origin: &OriginFor, _block_number: &u64, _nonce: &u64, _work: &Vec| -> bool { - cfg!(feature = "pow-faucet") - })] + .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] pub fn faucet( origin: OriginFor, block_number: u64, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 23e9c54e9..2bf4c0ec5 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -49,8 +49,6 @@ sp-session = { workspace = true } sp-std = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } -pallet-skip-feeless-payment= { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.10.0", default-features = false } - # Temporary sudo pallet-sudo = { workspace = true } @@ -145,7 +143,6 @@ std = [ "log/std", "sp-storage/std", "sp-genesis-builder/std", - "pallet-skip-feeless-payment/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b70cd00bb..2522b0ad7 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,7 +64,6 @@ use pallet_transaction_payment::{CurrencyAdapter, Multiplier}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; -use pallet_skip_feeless_payment::SkipCheckIfFeeless; // Subtensor module pub use pallet_subtensor; @@ -1183,7 +1182,6 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, pallet_subtensor::SubtensorSignedExtension, pallet_commitments::CommitmentsSignedExtension, - SkipCheckIfFeeless, ); type Migrations = ( From 60e8fd0a0c622cefd61164729511ab7757c504a0 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 08:41:04 -0700 Subject: [PATCH 13/39] remove nonce from hash --- pallets/subtensor/src/weights.rs | 6 ------ pallets/subtensor/tests/weights.rs | 19 +++---------------- runtime/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 909c40e20..9fb84603e 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2,7 +2,6 @@ use super::*; use crate::math::*; use sp_core::H256; use sp_runtime::traits::{BlakeTwo256, Hash}; -use sp_runtime::SaturatedConversion; use sp_std::vec; impl Pallet { @@ -30,10 +29,6 @@ impl Pallet { version_key: u64, ) -> DispatchResult { let who = ensure_signed(origin.clone())?; - let nonce: u64 = frame_system::Pallet::::account(&who) - .nonce - .saturated_into(); - WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { let (commit_hash, commit_block) = maybe_commit.take().ok_or(Error::::NoCommitFound)?; @@ -45,7 +40,6 @@ impl Pallet { let provided_hash: H256 = BlakeTwo256::hash_of(&( who.clone(), - nonce, netuid, uids.clone(), values.clone(), diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index ebb276667..fe647152b 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -48,7 +48,7 @@ fn test_commit_weights_dispatch_info_ok() { let hotkey: U256 = U256::from(1); let commit_hash: H256 = - BlakeTwo256::hash_of(&(hotkey, 0, netuid, dests, weights, version_key)); + BlakeTwo256::hash_of(&(hotkey, netuid, dests, weights, version_key)); let call = RuntimeCall::SubtensorModule(SubtensorCall::commit_weights { netuid, @@ -963,11 +963,9 @@ fn test_commit_reveal_weights_ok() { let weight_values: Vec = vec![10, 10]; let version_key: u64 = 0; let hotkey: U256 = U256::from(1); - let nonce: u64 = 0; let commit_hash: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1009,11 +1007,9 @@ fn test_commit_reveal_interval() { let weight_values: Vec = vec![10, 10]; let version_key: u64 = 0; let hotkey: U256 = U256::from(1); - let nonce: u64 = 0; let commit_hash: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1136,7 +1132,6 @@ fn test_commit_reveal_interval() { step_block(425); let commit_hash_2: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1176,7 +1171,6 @@ fn test_commit_reveal_hash() { let weight_values: Vec = vec![10, 10]; let version_key: u64 = 0; let hotkey: U256 = U256::from(1); - let nonce: u64 = 0; add_network(netuid, 0, 0); register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); @@ -1189,7 +1183,6 @@ fn test_commit_reveal_hash() { let commit_hash: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1265,14 +1258,8 @@ fn commit_reveal_set_weights( SubtensorModule::set_weight_commit_interval(5); SubtensorModule::set_weights_set_rate_limit(netuid, 5); - let commit_hash: H256 = BlakeTwo256::hash_of(&( - hotkey, - 0_u64, - netuid, - uids.clone(), - weights.clone(), - version_key, - )); + let commit_hash: H256 = + BlakeTwo256::hash_of(&(hotkey, netuid, uids.clone(), weights.clone(), version_key)); SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash)?; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 2bf4c0ec5..1ad9d636b 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -142,7 +142,7 @@ std = [ "sp-tracing/std", "log/std", "sp-storage/std", - "sp-genesis-builder/std", + "sp-genesis-builder/std" ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", From 2a2ba23180d566eeaba3cfbee8a121142e7f7393 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 10:09:18 -0700 Subject: [PATCH 14/39] cargo clippy --- pallets/subtensor/tests/weights.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index fe647152b..6403043b2 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -70,10 +70,10 @@ fn test_reveal_weights_dispatch_info_ok() { let version_key: u64 = 0; let call = RuntimeCall::SubtensorModule(SubtensorCall::reveal_weights { - netuid: netuid, + netuid, uids: dests, values: weights, - version_key: version_key, + version_key }); let dispatch_info = call.get_dispatch_info(); From 7d70267dd5b011a57358f6a6db77e0aeb73202b1 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 10:12:51 -0700 Subject: [PATCH 15/39] cargo fmt --- pallets/subtensor/tests/weights.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index 6403043b2..5badaafad 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -73,7 +73,7 @@ fn test_reveal_weights_dispatch_info_ok() { netuid, uids: dests, values: weights, - version_key + version_key, }); let dispatch_info = call.get_dispatch_info(); From 0ae2d5ece5e782a23ecbb8a94aa68bbaf694df8e Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 5 May 2024 12:11:19 -0700 Subject: [PATCH 16/39] start commit-reveal WIP --- pallets/subtensor/src/lib.rs | 66 ++++++++++++++++++++++++++++---- pallets/subtensor/src/weights.rs | 52 +++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 7 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 3df94368a..e1d3f9a8c 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -306,6 +306,16 @@ pub mod pallet { ValueQuery, DefaultAccountTake, >; + // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. + #[pallet::storage] + pub type WeightCommits = StorageDoubleMap< + _, + Twox64Concat, + u16, + Twox64Concat, + T::AccountId, + (T::Hash, u64), + ValueQuery>; // ===================================== // ==== Difficulty / Registrations ===== @@ -1182,18 +1192,44 @@ pub mod pallet { // // * 'MaxWeightExceeded': // - Attempting to set weights with max value exceeding limit. + // #[pallet::call_index(0)] + // #[pallet::weight((Weight::from_parts(10_151_000_000, 0) + // .saturating_add(T::DbWeight::get().reads(4104)) + // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + // pub fn set_weights( + // origin: OriginFor, + // netuid: u16, + // dests: Vec, + // weights: Vec, + // version_key: u64, + // ) -> DispatchResult { + // Self::do_set_weights(origin, netuid, dests, weights, version_key) + // } + #[pallet::call_index(0)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] - pub fn set_weights( - origin: OriginFor, + pub fn commit_weights( + origin: T::RuntimeOrigin, netuid: u16, - dests: Vec, - weights: Vec, + commit_hash: T::Hash, + ) -> DispatchResult { + Self::do_commit_weights(origin, netuid, commit_hash) + } + + #[pallet::call_index(97)] + #[pallet::weight((Weight::from_parts(10_151_000_000, 0) + .saturating_add(T::DbWeight::get().reads(4104)) + .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + pub fn reveal_weights( + origin: T::RuntimeOrigin, + netuid: u16, + uids: Vec, + values: Vec, version_key: u64, ) -> DispatchResult { - Self::do_set_weights(origin, netuid, dests, weights, version_key) + Self::do_reveal_weights(origin, netuid, uids, values, version_key) } // # Args: @@ -1908,7 +1944,19 @@ where _len: usize, ) -> TransactionValidity { match call.is_sub_type() { - Some(Call::set_weights { netuid, .. }) => { + Some(Call::commit_weights { netuid, .. }) => { + if Self::check_weights_min_stake(who) { + let priority: u64 = Self::get_priority_set_weights(who, *netuid); + Ok(ValidTransaction { + priority, + longevity: 1, + ..Default::default() + }) + } else { + Err(InvalidTransaction::Call.into()) + } + } + Some(Call::reveal_weights { netuid, .. }) => { if Self::check_weights_min_stake(who) { let priority: u64 = Self::get_priority_set_weights(who, *netuid); Ok(ValidTransaction { @@ -1982,7 +2030,11 @@ where let transaction_fee = 0; Ok((CallType::RemoveStake, transaction_fee, who.clone())) } - Some(Call::set_weights { .. }) => { + Some(Call::commit_weights { .. }) => { + let transaction_fee = 0; + Ok((CallType::SetWeights, transaction_fee, who.clone())) + } + Some(Call::reveal_weights { .. }) => { let transaction_fee = 0; Ok((CallType::SetWeights, transaction_fee, who.clone())) } diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 1bbb39491..db3be0588 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -1,8 +1,53 @@ use super::*; use crate::math::*; use sp_std::vec; +use sp_runtime::traits::Hash; impl Pallet { + + pub fn do_commit_weights( + origin: T::RuntimeOrigin, + netuid: u16, + commit_hash: T::Hash, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + ensure!(Self::can_commit(netuid, &who), Error::::CommitNotAllowed); + + WeightCommits::::insert( + netuid, + &who, + ( + commit_hash, + Self::get_current_block_as_u64(), + ), + ); + Ok(()) + } + + pub fn do_reveal_weights( + origin: T::RuntimeOrigin, + netuid: u16, + uids: Vec, + values: Vec, + version_key: u64, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { + let (commit_hash, commit_block) = + maybe_commit.take().ok_or(Error::::NoCommitFound)?; + + ensure!( + Self::is_reveal_block(netuid, commit_block), + Error::::InvalidRevealTempo + ); + + let provided_hash = T::Hashing::hash_of(&(who.clone(), netuid, uids.clone(), values.clone(), version_key)); + ensure!(provided_hash == commit_hash, Error::::InvalidReveal); + + Self::do_set_weights(origin, netuid, uids, values, version_key) + }) + } + // ---- The implementation for the extrinsic set_weights. // // # Args: @@ -324,4 +369,11 @@ impl Pallet { // we should expect at most subnetwork_n uids. uids.len() <= subnetwork_n as usize } + + pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { + return true; + } + pub fn is_reveal_block(netuid: u16, commit_block: u64) -> bool { + return true; + } } From 9bf95fbfc650b8df7fd1c126ce68279a1a564a3b Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Mon, 6 May 2024 15:31:43 -0700 Subject: [PATCH 17/39] do commit/reveal & add tests --- pallets/subtensor/src/lib.rs | 33 ++-- pallets/subtensor/src/weights.rs | 73 ++++++-- pallets/subtensor/tests/weights.rs | 267 ++++++++++++++++++++++++++++- 3 files changed, 345 insertions(+), 28 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e1d3f9a8c..e498a9ec1 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -68,6 +68,7 @@ pub mod pallet { traits::{tokens::fungible, UnfilteredDispatchable}, }; use frame_system::pallet_prelude::*; + use sp_core::H256; use sp_runtime::traits::TrailingZeroInput; use sp_std::vec; use sp_std::vec::Vec; @@ -306,16 +307,6 @@ pub mod pallet { ValueQuery, DefaultAccountTake, >; - // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. - #[pallet::storage] - pub type WeightCommits = StorageDoubleMap< - _, - Twox64Concat, - u16, - Twox64Concat, - T::AccountId, - (T::Hash, u64), - ValueQuery>; // ===================================== // ==== Difficulty / Registrations ===== @@ -796,6 +787,20 @@ pub mod pallet { pub type AdjustmentAlpha = StorageMap<_, Identity, u16, u64, ValueQuery, DefaultAdjustmentAlpha>; + // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. + #[pallet::storage] + pub type WeightCommits = + StorageDoubleMap<_, Twox64Concat, u16, Twox64Concat, T::AccountId, (H256, u64), ValueQuery>; + + #[pallet::type_value] + pub fn DefaultWeightCommitRevealInterval() -> u64 { + 1000 + } + + #[pallet::storage] + pub type WeightCommitRevealInterval = + StorageValue<_, u64, ValueQuery, DefaultWeightCommitRevealInterval>; + // ======================================= // ==== Subnetwork Consensus Storage ==== // ======================================= @@ -1194,8 +1199,8 @@ pub mod pallet { // - Attempting to set weights with max value exceeding limit. // #[pallet::call_index(0)] // #[pallet::weight((Weight::from_parts(10_151_000_000, 0) - // .saturating_add(T::DbWeight::get().reads(4104)) - // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + // .saturating_add(T::DbWeight::get().reads(4104)) + // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] // pub fn set_weights( // origin: OriginFor, // netuid: u16, @@ -1206,14 +1211,14 @@ pub mod pallet { // Self::do_set_weights(origin, netuid, dests, weights, version_key) // } - #[pallet::call_index(0)] + #[pallet::call_index(96)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] pub fn commit_weights( origin: T::RuntimeOrigin, netuid: u16, - commit_hash: T::Hash, + commit_hash: H256, ) -> DispatchResult { Self::do_commit_weights(origin, netuid, commit_hash) } diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index db3be0588..aa15b77d5 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -1,14 +1,15 @@ use super::*; use crate::math::*; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, Hash}; +use sp_runtime::SaturatedConversion; use sp_std::vec; -use sp_runtime::traits::Hash; impl Pallet { - pub fn do_commit_weights( origin: T::RuntimeOrigin, netuid: u16, - commit_hash: T::Hash, + commit_hash: H256, ) -> DispatchResult { let who = ensure_signed(origin)?; ensure!(Self::can_commit(netuid, &who), Error::::CommitNotAllowed); @@ -16,10 +17,7 @@ impl Pallet { WeightCommits::::insert( netuid, &who, - ( - commit_hash, - Self::get_current_block_as_u64(), - ), + (commit_hash, Self::get_current_block_as_u64()), ); Ok(()) } @@ -32,16 +30,27 @@ impl Pallet { version_key: u64, ) -> DispatchResult { let who = ensure_signed(origin.clone())?; + let nonce: u64 = frame_system::Pallet::::account(&who) + .nonce + .saturated_into(); + WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { let (commit_hash, commit_block) = maybe_commit.take().ok_or(Error::::NoCommitFound)?; ensure!( - Self::is_reveal_block(netuid, commit_block), + Self::is_reveal_block_range(commit_block), Error::::InvalidRevealTempo ); - let provided_hash = T::Hashing::hash_of(&(who.clone(), netuid, uids.clone(), values.clone(), version_key)); + let provided_hash: H256 = BlakeTwo256::hash_of(&( + who.clone(), + nonce, + netuid, + uids.clone(), + values.clone(), + version_key, + )); ensure!(provided_hash == commit_hash, Error::::InvalidReveal); Self::do_set_weights(origin, netuid, uids, values, version_key) @@ -371,9 +380,49 @@ impl Pallet { } pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { - return true; + let (hash, commit_block) = WeightCommits::::get(netuid, who); + + //First commit case + if hash == H256::default() || commit_block == 0 { + return true; + } + + let interval: u64 = Self::get_weight_commit_interval(); + let current_block: u64 = Self::get_current_block_as_u64(); + let interval_start: u64 = current_block - (current_block % interval); + let last_commit_interval_start: u64 = commit_block - (commit_block % interval); + + // Allow commit if we're within the interval bounds + if current_block > interval_start + && current_block < interval_start + interval + && interval_start > last_commit_interval_start + { + return true; + } + + false } - pub fn is_reveal_block(netuid: u16, commit_block: u64) -> bool { - return true; + + pub fn is_reveal_block_range(commit_block: u64) -> bool { + let interval: u64 = Self::get_weight_commit_interval(); + let commit_interval_start: u64 = commit_block - (commit_block % interval); // Find the start of the interval in which the commit occurred + let reveal_interval_start: u64 = commit_interval_start + interval; // Start of the next interval after the commit interval + let current_block: u64 = Self::get_current_block_as_u64(); + + // Allow reveal if the current block is within the interval following the commit's interval + if current_block > reveal_interval_start && current_block < reveal_interval_start + interval + { + return true; + } + + false + } + + pub fn get_weight_commit_interval() -> u64 { + WeightCommitRevealInterval::::get() + } + + pub fn set_weight_commit_interval(interval: u64) { + WeightCommitRevealInterval::::set(interval) } } diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index 3d7673982..5941ebbf4 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -5,8 +5,11 @@ use frame_support::{ }; use mock::*; use pallet_subtensor::Error; -use sp_core::U256; -use sp_runtime::DispatchError; +use sp_core::{H256, U256}; +use sp_runtime::{ + traits::{BlakeTwo256, Hash}, + DispatchError, +}; use substrate_fixed::types::I32F32; /*************************** @@ -965,3 +968,263 @@ fn test_check_len_uids_within_allowed_not_within_network_pool() { ); }); } + +#[test] +fn test_commit_reveal_weights_ok() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let uids: Vec = vec![0, 1]; + let weight_values: Vec = vec![10, 10]; + let version_key: u64 = 0; + let hotkey: U256 = U256::from(1); + let nonce: u64 = 0; + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + add_network(netuid, 0, 0); + register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); + register_ok_neuron(netuid, U256::from(1), U256::from(2), 100000); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + SubtensorModule::set_validator_permit_for_uid(netuid, 0, true); + SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); + + SubtensorModule::set_weight_commit_interval(5); + + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + + step_block(5); + + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids, + weight_values, + version_key, + )); + }); +} + +#[test] +fn test_commit_reveal_interval() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let uids: Vec = vec![0, 1]; + let weight_values: Vec = vec![10, 10]; + let version_key: u64 = 0; + let hotkey: U256 = U256::from(1); + let nonce: u64 = 0; + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + add_network(netuid, 0, 0); + register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); + register_ok_neuron(netuid, U256::from(1), U256::from(2), 100000); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + SubtensorModule::set_validator_permit_for_uid(netuid, 0, true); + SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); + + SubtensorModule::set_weight_commit_interval(100); + + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + assert_err!( + SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash), + Error::::CommitNotAllowed + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + step_block(99); + assert_err!( + SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash), + Error::::CommitNotAllowed + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + step_block(1); + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + // After the previous reveal the associated mapping entry was removed. + // Therefore we expect NoCommitFound + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::NoCommitFound + ); + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + step_block(100); + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + // Testing that if you miss the next tempo you cannot reveal it. + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + step_block(205); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidRevealTempo + ); + }); +} + +#[test] +fn test_commit_reveal_hash() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let uids: Vec = vec![0, 1]; + let weight_values: Vec = vec![10, 10]; + let version_key: u64 = 0; + let hotkey: U256 = U256::from(1); + let nonce: u64 = 0; + + add_network(netuid, 0, 0); + register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); + register_ok_neuron(netuid, U256::from(1), U256::from(2), 100000); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + SubtensorModule::set_validator_permit_for_uid(netuid, 0, true); + SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); + + SubtensorModule::set_weight_commit_interval(5); + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + + step_block(5); + + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + vec![0, 2], + weight_values.clone(), + version_key + ), + Error::::InvalidReveal + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + 7, + ), + Error::::InvalidReveal + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + vec![10, 9], + version_key, + ), + Error::::InvalidReveal + ); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + vec![0, 1, 2], + vec![10, 10, 33], + 9, + ), + Error::::InvalidReveal + ); + + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids, + weight_values, + version_key, + )); + }); +} From 2d26b093ed34ffb1e2043564696d33489492188c Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Mon, 6 May 2024 16:04:08 -0700 Subject: [PATCH 18/39] fix --- pallets/subtensor/src/lib.rs | 11 +++++++++-- pallets/subtensor/src/weights.rs | 33 +++++++++++++++----------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e498a9ec1..7f614d134 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -789,8 +789,15 @@ pub mod pallet { // --- MAP (netuid, who) --> (hash, weight) | Returns the hash and weight committed by an account for a given netuid. #[pallet::storage] - pub type WeightCommits = - StorageDoubleMap<_, Twox64Concat, u16, Twox64Concat, T::AccountId, (H256, u64), ValueQuery>; + pub type WeightCommits = StorageDoubleMap< + _, + Twox64Concat, + u16, + Twox64Concat, + T::AccountId, + (H256, u64), + OptionQuery, + >; #[pallet::type_value] pub fn DefaultWeightCommitRevealInterval() -> u64 { diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index aa15b77d5..6198b5ed7 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -380,27 +380,24 @@ impl Pallet { } pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { - let (hash, commit_block) = WeightCommits::::get(netuid, who); - - //First commit case - if hash == H256::default() || commit_block == 0 { - return true; - } - - let interval: u64 = Self::get_weight_commit_interval(); - let current_block: u64 = Self::get_current_block_as_u64(); - let interval_start: u64 = current_block - (current_block % interval); - let last_commit_interval_start: u64 = commit_block - (commit_block % interval); + if let Some((_hash, commit_block)) = WeightCommits::::get(netuid, who) { + let interval: u64 = Self::get_weight_commit_interval(); + let current_block: u64 = Self::get_current_block_as_u64(); + let interval_start: u64 = current_block - (current_block % interval); + let last_commit_interval_start: u64 = commit_block - (commit_block % interval); + + // Allow commit if we're within the interval bounds + if current_block > interval_start + && current_block < interval_start + interval + && interval_start > last_commit_interval_start + { + return true; + } - // Allow commit if we're within the interval bounds - if current_block > interval_start - && current_block < interval_start + interval - && interval_start > last_commit_interval_start - { + false + } else { return true; } - - false } pub fn is_reveal_block_range(commit_block: u64) -> bool { From bbc938300df308b4687d8396e8f1c17f79dbcde3 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Tue, 7 May 2024 10:49:22 -0700 Subject: [PATCH 19/39] fix checks --- pallets/subtensor/src/weights.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 6198b5ed7..9cbc4a6ac 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -387,8 +387,8 @@ impl Pallet { let last_commit_interval_start: u64 = commit_block - (commit_block % interval); // Allow commit if we're within the interval bounds - if current_block > interval_start - && current_block < interval_start + interval + if current_block >= interval_start + && current_block <= interval_start + interval && interval_start > last_commit_interval_start { return true; @@ -407,7 +407,8 @@ impl Pallet { let current_block: u64 = Self::get_current_block_as_u64(); // Allow reveal if the current block is within the interval following the commit's interval - if current_block > reveal_interval_start && current_block < reveal_interval_start + interval + if current_block >= reveal_interval_start + && current_block < reveal_interval_start + interval { return true; } From 93b3e6ca8c60dc29798bb22c4978c43e2f34f797 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Tue, 7 May 2024 10:49:42 -0700 Subject: [PATCH 20/39] fix tests --- pallets/subtensor/tests/epoch.rs | 38 ++--- pallets/subtensor/tests/weights.rs | 225 +++++++++++++++-------------- 2 files changed, 132 insertions(+), 131 deletions(-) diff --git a/pallets/subtensor/tests/epoch.rs b/pallets/subtensor/tests/epoch.rs index 0bfd11ba4..6a489740c 100644 --- a/pallets/subtensor/tests/epoch.rs +++ b/pallets/subtensor/tests/epoch.rs @@ -205,7 +205,7 @@ fn init_run_epochs( let sparse_weights = input_weights[*uid as usize].clone(); weights = sparse_weights.iter().map(|(_, w)| *w).collect(); let srvs: Vec = sparse_weights.iter().map(|(s, _)| *s).collect(); - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, srvs, @@ -213,7 +213,7 @@ fn init_run_epochs( 0 )); } else { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, servers.to_vec(), @@ -224,7 +224,7 @@ fn init_run_epochs( } if server_self { for uid in servers { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, vec![*uid], @@ -558,7 +558,7 @@ fn test_1_graph() { SubtensorModule::append_neuron(netuid, &hotkey, 0); assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 1); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], @@ -625,7 +625,7 @@ fn test_10_graph() { assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 10); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block for i in 0..10 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(i)), netuid, vec![i as u16], @@ -1005,7 +1005,7 @@ fn test_bonds() { // === Set weights [val->srv1: 0.1, val->srv2: 0.2, val->srv3: 0.3, val->srv4: 0.4] for uid in 0..(n/2) as u64 { - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); } if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1050,7 +1050,7 @@ fn test_bonds() { // === Set self-weight only on val1 let uid = 0; - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1097,7 +1097,7 @@ fn test_bonds() { // === Set self-weight only on val2 let uid = 1; - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1133,7 +1133,7 @@ fn test_bonds() { // === Set self-weight only on val3 let uid = 2; - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1168,7 +1168,7 @@ fn test_bonds() { assert_eq!(bonds[3][7], 65535); // === Set val3->srv4: 1 - assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1316,7 +1316,7 @@ fn test_active_stake() { // === Set weights [val1->srv1: 0.5, val1->srv2: 0.5, val2->srv1: 0.5, val2->srv2: 0.5] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1356,7 +1356,7 @@ fn test_active_stake() { run_to_block(activity_cutoff + 2); // run to block where validator (uid 0, 1) weights become outdated // === Update uid 0 weights - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1416,7 +1416,7 @@ fn test_active_stake() { } // === Update uid 1 weights as well - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(1)), netuid, ((n / 2)..n).collect(), @@ -1525,7 +1525,7 @@ fn test_outdated_weights() { // === Set weights [val1->srv1: 2/3, val1->srv2: 1/3, val2->srv1: 2/3, val2->srv2: 1/3, srv1->srv1: 1, srv2->srv2: 1] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1534,7 +1534,7 @@ fn test_outdated_weights() { )); } for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1604,7 +1604,7 @@ fn test_outdated_weights() { next_block(); // run to next block to outdate weights and bonds set on deregistered uid // === Update weights from only uid=0 - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1728,7 +1728,7 @@ fn test_zero_weights() { // === Self-weights only: set weights [srv->srv: 1] for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1764,7 +1764,7 @@ fn test_zero_weights() { // === Set weights [val->srv: 1/(n/2)] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1818,7 +1818,7 @@ fn test_zero_weights() { // === Set new weights [val->srv: 1/(n/2)] to check that updated weights would produce non-zero incentive for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::set_weights( + assert_ok!(SubtensorModule::do_set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index 5941ebbf4..d87e34092 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -1,7 +1,7 @@ mod mock; use frame_support::{ assert_err, assert_ok, - dispatch::{DispatchClass, GetDispatchInfo, Pays}, + dispatch::{DispatchClass, DispatchResult, GetDispatchInfo, Pays}, }; use mock::*; use pallet_subtensor::Error; @@ -19,17 +19,41 @@ use substrate_fixed::types::I32F32; // Test the call passes through the subtensor module. #[test] #[cfg(not(tarpaulin))] -fn test_set_weights_dispatch_info_ok() { +fn test_commit_weights_dispatch_info_ok() { new_test_ext(0).execute_with(|| { let dests = vec![1, 1]; let weights = vec![1, 1]; let netuid: u16 = 1; let version_key: u64 = 0; - let call = RuntimeCall::SubtensorModule(SubtensorCall::set_weights { + let hotkey: U256 = U256::from(1); + + let commit_hash: H256 = + BlakeTwo256::hash_of(&(hotkey, 0, netuid, dests, weights, version_key)); + + let call = RuntimeCall::SubtensorModule(SubtensorCall::commit_weights { netuid, - dests, - weights, - version_key, + commit_hash, + }); + let dispatch_info = call.get_dispatch_info(); + + assert_eq!(dispatch_info.class, DispatchClass::Normal); + assert_eq!(dispatch_info.pays_fee, Pays::No); + }); +} + +#[test] +fn test_reveal_weights_dispatch_info_ok() { + new_test_ext(0).execute_with(|| { + let dests = vec![1, 1]; + let weights = vec![1, 1]; + let netuid: u16 = 1; + let version_key: u64 = 0; + + let call = RuntimeCall::SubtensorModule(SubtensorCall::reveal_weights { + netuid: netuid, + uids: dests, + values: weights, + version_key: version_key, }); let dispatch_info = call.get_dispatch_info(); @@ -43,19 +67,13 @@ fn test_set_weights_is_root_error() { new_test_ext(0).execute_with(|| { let root_netuid: u16 = 0; - let dests = vec![0]; + let uids = vec![0]; let weights = vec![1]; let version_key: u64 = 0; let hotkey = U256::from(1); assert_err!( - SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), - root_netuid, - dests.clone(), - weights.clone(), - version_key, - ), + commit_reveal_set_weights(hotkey, root_netuid, uids, weights, version_key), Error::::IsRoot ); }); @@ -78,13 +96,9 @@ fn test_weights_err_no_validator_permit() { let weights_keys: Vec = vec![1, 2]; let weight_values: Vec = vec![1, 2]; - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), - netuid, - weights_keys, - weight_values, - 0, - ); + + let result = + commit_reveal_set_weights(hotkey_account_id, netuid, weights_keys, weight_values, 0); assert_eq!(result, Err(Error::::NoValidatorPermit.into())); let weights_keys: Vec = vec![1, 2]; @@ -93,13 +107,8 @@ fn test_weights_err_no_validator_permit() { SubtensorModule::get_uid_for_net_and_hotkey(netuid, &hotkey_account_id) .expect("Not registered."); SubtensorModule::set_validator_permit_for_uid(netuid, neuron_uid, true); - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), - netuid, - weights_keys, - weight_values, - 0, - ); + let result = + commit_reveal_set_weights(hotkey_account_id, netuid, weights_keys, weight_values, 0); assert_ok!(result); }); } @@ -130,24 +139,18 @@ fn test_set_weights_min_stake_failed() { // Check that it fails at the pallet level. SubtensorModule::set_weights_min_stake(100_000_000_000_000); assert_eq!( - SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), - netuid, - dests.clone(), - weights.clone(), - version_key, - ), + commit_reveal_set_weights(hotkey, netuid, dests.clone(), weights.clone(), version_key), Err(Error::::NotEnoughStakeToSetWeights.into()) ); // Now passes SubtensorModule::increase_stake_on_hotkey_account(&hotkey, 100_000_000_000_000); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid, dests.clone(), weights.clone(), - version_key, - ),); + version_key + )); }); } @@ -166,15 +169,15 @@ fn test_weights_version_key() { let weights_keys: Vec = vec![0]; let weight_values: Vec = vec![1]; - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid0, weights_keys.clone(), weight_values.clone(), 0 )); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid1, weights_keys.clone(), weight_values.clone(), @@ -188,15 +191,15 @@ fn test_weights_version_key() { SubtensorModule::set_weights_version_key(netuid1, key1); // Setting works with version key. - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid0, weights_keys.clone(), weight_values.clone(), key0 )); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid1, weights_keys.clone(), weight_values.clone(), @@ -204,8 +207,8 @@ fn test_weights_version_key() { )); // validator:20313 >= network:12312 (accepted: validator newer) - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + assert_ok!(commit_reveal_set_weights( + hotkey, netuid0, weights_keys.clone(), weight_values.clone(), @@ -215,8 +218,8 @@ fn test_weights_version_key() { // Setting fails with incorrect keys. // validator:12312 < network:20313 (rejected: validator not updated) assert_eq!( - SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey), + commit_reveal_set_weights( + hotkey, netuid1, weights_keys.clone(), weight_values.clone(), @@ -254,7 +257,7 @@ fn test_weights_err_setting_weights_too_fast() { // Note that LastUpdate has default 0 for new uids, but if they have actually set weights on block 0 // then they are allowed to set weights again once more without a wait restriction, to accommodate the default. - let result = SubtensorModule::set_weights( + let result = SubtensorModule::do_set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -265,7 +268,7 @@ fn test_weights_err_setting_weights_too_fast() { run_to_block(1); for i in 1..100 { - let result = SubtensorModule::set_weights( + let result = SubtensorModule::do_set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -297,11 +300,11 @@ fn test_weights_err_weights_vec_not_equal_size() { SubtensorModule::set_validator_permit_for_uid(netuid, neuron_uid, true); let weights_keys: Vec = vec![1, 2, 3, 4, 5, 6]; let weight_values: Vec = vec![1, 2, 3, 4, 5]; // Uneven sizes - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), + let result = commit_reveal_set_weights( + hotkey_account_id, 1, - weights_keys, - weight_values, + weights_keys.clone(), + weight_values.clone(), 0, ); assert_eq!(result, Err(Error::::WeightVecNotEqualSize.into())); @@ -346,11 +349,11 @@ fn test_weights_err_has_duplicate_ids() { let weights_keys: Vec = vec![1, 1, 1]; // Contains duplicates let weight_values: Vec = vec![1, 2, 3]; - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), + let result = commit_reveal_set_weights( + hotkey_account_id, netuid, - weights_keys, - weight_values, + weights_keys.clone(), + weight_values.clone(), 0, ); assert_eq!(result, Err(Error::::DuplicateUids.into())); @@ -425,20 +428,13 @@ fn test_weights_err_max_weight_limit() { // Non self-weight fails. let uids: Vec = vec![1, 2, 3, 4]; let values: Vec = vec![u16::MAX / 4, u16::MAX / 4, u16::MAX / 54, u16::MAX / 4]; - let result = - SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(0)), 1, uids, values, 0); + let result = commit_reveal_set_weights(U256::from(0), 1, uids, values, 0); assert_eq!(result, Err(Error::::MaxWeightExceeded.into())); // Self-weight is a success. let uids: Vec = vec![0]; // Self. let values: Vec = vec![u16::MAX]; // normalizes to u32::MAX - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(0)), - 1, - uids, - values, - 0 - )); + assert_ok!(commit_reveal_set_weights(U256::from(0), 1, uids, values, 0)); }); } @@ -448,7 +444,7 @@ fn test_no_signature() { new_test_ext(0).execute_with(|| { let uids: Vec = vec![]; let values: Vec = vec![]; - let result = SubtensorModule::set_weights(RuntimeOrigin::none(), 1, uids, values, 0); + let result = SubtensorModule::do_set_weights(RuntimeOrigin::none(), 1, uids, values, 0); assert_eq!(result, Err(DispatchError::BadOrigin)); }); } @@ -469,13 +465,7 @@ fn test_set_weights_err_not_active() { let weights_keys: Vec = vec![0]; // Uid 0 is valid. let weight_values: Vec = vec![1]; // This hotkey is NOT registered. - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), - 1, - weights_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(U256::from(1), 1, weights_keys, weight_values, 0); assert_eq!(result, Err(Error::::NotRegistered.into())); }); } @@ -495,13 +485,7 @@ fn test_set_weights_err_invalid_uid() { SubtensorModule::set_validator_permit_for_uid(netuid, neuron_uid, true); let weight_keys: Vec = vec![9999]; // Does not exist let weight_values: Vec = vec![88]; // random value - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(hotkey_account_id), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(hotkey_account_id, 1, weight_keys, weight_values, 0); assert_eq!(result, Err(Error::::InvalidUid.into())); }); } @@ -527,20 +511,14 @@ fn test_set_weight_not_enough_values() { // Should fail because we are only setting a single value and its not the self weight. let weight_keys: Vec = vec![1]; // not weight. let weight_values: Vec = vec![88]; // random value. - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(account_id), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(account_id, 1, weight_keys, weight_values, 0); assert_eq!(result, Err(Error::::NotSettingEnoughWeights.into())); // Shouldnt fail because we setting a single value but it is the self weight. let weight_keys: Vec = vec![0]; // self weight. let weight_values: Vec = vec![88]; // random value. - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(account_id), + assert_ok!(commit_reveal_set_weights( + account_id, 1, weight_keys, weight_values, @@ -551,8 +529,8 @@ fn test_set_weight_not_enough_values() { let weight_keys: Vec = vec![0, 1]; // self weight. let weight_values: Vec = vec![10, 10]; // random value. SubtensorModule::set_min_allowed_weights(netuid, 1); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(account_id), + assert_ok!(commit_reveal_set_weights( + account_id, 1, weight_keys, weight_values, @@ -581,20 +559,14 @@ fn test_set_weight_too_many_uids() { // Should fail because we are setting more weights than there are neurons. let weight_keys: Vec = vec![0, 1, 2, 3, 4]; // more uids than neurons in subnet. let weight_values: Vec = vec![88, 102, 303, 1212, 11]; // random value. - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(U256::from(1), 1, weight_keys, weight_values, 0); assert_eq!(result, Err(Error::::TooManyUids.into())); // Shouldnt fail because we are setting less weights than there are neurons. let weight_keys: Vec = vec![0, 1]; // Only on neurons that exist. let weight_values: Vec = vec![10, 10]; // random value. - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), + assert_ok!(commit_reveal_set_weights( + U256::from(1), 1, weight_keys, weight_values, @@ -626,13 +598,7 @@ fn test_set_weights_sum_larger_than_u16_max() { // sum of weights is larger than u16 max. assert!(weight_values.iter().map(|x| *x as u64).sum::() > (u16::MAX as u64)); - let result = SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(1)), - 1, - weight_keys, - weight_values, - 0, - ); + let result = commit_reveal_set_weights(U256::from(1), 1, weight_keys, weight_values, 0); assert_ok!(result); // Get max-upscaled unnormalized weights. @@ -1042,6 +1008,7 @@ fn test_commit_reveal_interval() { SubtensorModule::set_validator_permit_for_uid(netuid, 1, true); SubtensorModule::set_weight_commit_interval(100); + System::set_block_number(0); assert_ok!(SubtensorModule::commit_weights( RuntimeOrigin::signed(hotkey), @@ -1228,3 +1195,37 @@ fn test_commit_reveal_hash() { )); }); } + +fn commit_reveal_set_weights( + hotkey: U256, + netuid: u16, + uids: Vec, + weights: Vec, + version_key: u64, +) -> DispatchResult { + SubtensorModule::set_weight_commit_interval(5); + SubtensorModule::set_weights_set_rate_limit(netuid, 5); + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey, + 0_u64, + netuid, + uids.clone(), + weights.clone(), + version_key, + )); + + SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash)?; + + step_block(5); + + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids, + weights, + version_key, + )?; + + Ok(()) +} From 45989cb10183fdd2472a72cd10d216e31aa1f52c Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Tue, 7 May 2024 11:14:48 -0700 Subject: [PATCH 21/39] re add errors --- pallets/subtensor/src/errors.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pallets/subtensor/src/errors.rs b/pallets/subtensor/src/errors.rs index 9b703255b..9798fb2f1 100644 --- a/pallets/subtensor/src/errors.rs +++ b/pallets/subtensor/src/errors.rs @@ -132,5 +132,13 @@ mod errors { NomStakeBelowMinimumThreshold, /// delegate take is being set out of bounds InvalidTake, + /// Not allowed to comit weights + CommitNotAllowed, + /// No commit found for provided hotkey+netuid when attempting to reveal weights + NoCommitFound, + /// Not the correct block/range to reveal weights + InvalidRevealTempo, + /// Committed hash does not equal the hashed reveal data + InvalidReveal, } } From 69899f0a134b088c572f0134ce2855452714cbef Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 08:07:22 -0700 Subject: [PATCH 22/39] revert set_weights removal --- pallets/subtensor/src/lib.rs | 38 ++++++++++++++++++++---------- pallets/subtensor/tests/epoch.rs | 38 +++++++++++++++--------------- pallets/subtensor/tests/weights.rs | 26 +++++++++++++++++--- 3 files changed, 67 insertions(+), 35 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 7f614d134..3bd4f66e2 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1204,19 +1204,19 @@ pub mod pallet { // // * 'MaxWeightExceeded': // - Attempting to set weights with max value exceeding limit. - // #[pallet::call_index(0)] - // #[pallet::weight((Weight::from_parts(10_151_000_000, 0) - // .saturating_add(T::DbWeight::get().reads(4104)) - // .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] - // pub fn set_weights( - // origin: OriginFor, - // netuid: u16, - // dests: Vec, - // weights: Vec, - // version_key: u64, - // ) -> DispatchResult { - // Self::do_set_weights(origin, netuid, dests, weights, version_key) - // } + #[pallet::call_index(0)] + #[pallet::weight((Weight::from_parts(10_151_000_000, 0) + .saturating_add(T::DbWeight::get().reads(4104)) + .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + pub fn set_weights( + origin: OriginFor, + netuid: u16, + dests: Vec, + weights: Vec, + version_key: u64, + ) -> DispatchResult { + Self::do_set_weights(origin, netuid, dests, weights, version_key) + } #[pallet::call_index(96)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) @@ -1980,6 +1980,18 @@ where Err(InvalidTransaction::Call.into()) } } + Some(Call::set_weights { netuid, .. }) => { + if Self::check_weights_min_stake(who) { + let priority: u64 = Self::get_priority_set_weights(who, *netuid); + Ok(ValidTransaction { + priority, + longevity: 1, + ..Default::default() + }) + } else { + Err(InvalidTransaction::Call.into()) + } + } Some(Call::set_root_weights { netuid, .. }) => { if Self::check_weights_min_stake(who) { let priority: u64 = Self::get_priority_set_weights(who, *netuid); diff --git a/pallets/subtensor/tests/epoch.rs b/pallets/subtensor/tests/epoch.rs index 6a489740c..0bfd11ba4 100644 --- a/pallets/subtensor/tests/epoch.rs +++ b/pallets/subtensor/tests/epoch.rs @@ -205,7 +205,7 @@ fn init_run_epochs( let sparse_weights = input_weights[*uid as usize].clone(); weights = sparse_weights.iter().map(|(_, w)| *w).collect(); let srvs: Vec = sparse_weights.iter().map(|(s, _)| *s).collect(); - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, srvs, @@ -213,7 +213,7 @@ fn init_run_epochs( 0 )); } else { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, servers.to_vec(), @@ -224,7 +224,7 @@ fn init_run_epochs( } if server_self { for uid in servers { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(*uid as u64)), netuid, vec![*uid], @@ -558,7 +558,7 @@ fn test_1_graph() { SubtensorModule::append_neuron(netuid, &hotkey, 0); assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 1); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], @@ -625,7 +625,7 @@ fn test_10_graph() { assert_eq!(SubtensorModule::get_subnetwork_n(netuid), 10); run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block for i in 0..10 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(i)), netuid, vec![i as u16], @@ -1005,7 +1005,7 @@ fn test_bonds() { // === Set weights [val->srv1: 0.1, val->srv2: 0.2, val->srv3: 0.3, val->srv4: 0.4] for uid in 0..(n/2) as u64 { - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, ((n/2)..n).collect(), vec![ u16::MAX/4, u16::MAX/2, (u16::MAX/4)*3, u16::MAX], 0)); } if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1050,7 +1050,7 @@ fn test_bonds() { // === Set self-weight only on val1 let uid = 0; - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1097,7 +1097,7 @@ fn test_bonds() { // === Set self-weight only on val2 let uid = 1; - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1133,7 +1133,7 @@ fn test_bonds() { // === Set self-weight only on val3 let uid = 2; - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1168,7 +1168,7 @@ fn test_bonds() { assert_eq!(bonds[3][7], 65535); // === Set val3->srv4: 1 - assert_ok!(SubtensorModule::do_set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); + assert_ok!(SubtensorModule::set_weights(RuntimeOrigin::signed(U256::from(2)), netuid, vec![7], vec![u16::MAX], 0)); next_block(); if sparse { SubtensorModule::epoch( netuid, 1_000_000_000 ); } else { SubtensorModule::epoch_dense( netuid, 1_000_000_000 ); } @@ -1316,7 +1316,7 @@ fn test_active_stake() { // === Set weights [val1->srv1: 0.5, val1->srv2: 0.5, val2->srv1: 0.5, val2->srv2: 0.5] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1356,7 +1356,7 @@ fn test_active_stake() { run_to_block(activity_cutoff + 2); // run to block where validator (uid 0, 1) weights become outdated // === Update uid 0 weights - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1416,7 +1416,7 @@ fn test_active_stake() { } // === Update uid 1 weights as well - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(1)), netuid, ((n / 2)..n).collect(), @@ -1525,7 +1525,7 @@ fn test_outdated_weights() { // === Set weights [val1->srv1: 2/3, val1->srv2: 1/3, val2->srv1: 2/3, val2->srv2: 1/3, srv1->srv1: 1, srv2->srv2: 1] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1534,7 +1534,7 @@ fn test_outdated_weights() { )); } for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1604,7 +1604,7 @@ fn test_outdated_weights() { next_block(); // run to next block to outdate weights and bonds set on deregistered uid // === Update weights from only uid=0 - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(0)), netuid, ((n / 2)..n).collect(), @@ -1728,7 +1728,7 @@ fn test_zero_weights() { // === Self-weights only: set weights [srv->srv: 1] for uid in ((n / 2) as u64)..n as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, vec![uid as u16], @@ -1764,7 +1764,7 @@ fn test_zero_weights() { // === Set weights [val->srv: 1/(n/2)] for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), @@ -1818,7 +1818,7 @@ fn test_zero_weights() { // === Set new weights [val->srv: 1/(n/2)] to check that updated weights would produce non-zero incentive for uid in 0..(n / 2) as u64 { - assert_ok!(SubtensorModule::do_set_weights( + assert_ok!(SubtensorModule::set_weights( RuntimeOrigin::signed(U256::from(uid)), netuid, ((n / 2)..n).collect(), diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index d87e34092..d941d1aa1 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -19,6 +19,26 @@ use substrate_fixed::types::I32F32; // Test the call passes through the subtensor module. #[test] #[cfg(not(tarpaulin))] +fn test_set_weights_dispatch_info_ok() { + new_test_ext(0).execute_with(|| { + let dests = vec![1, 1]; + let weights = vec![1, 1]; + let netuid: u16 = 1; + let version_key: u64 = 0; + let call = RuntimeCall::SubtensorModule(SubtensorCall::set_weights { + netuid, + dests, + weights, + version_key, + }); + let dispatch_info = call.get_dispatch_info(); + + assert_eq!(dispatch_info.class, DispatchClass::Normal); + assert_eq!(dispatch_info.pays_fee, Pays::No); + }); +} + +#[test] fn test_commit_weights_dispatch_info_ok() { new_test_ext(0).execute_with(|| { let dests = vec![1, 1]; @@ -257,7 +277,7 @@ fn test_weights_err_setting_weights_too_fast() { // Note that LastUpdate has default 0 for new uids, but if they have actually set weights on block 0 // then they are allowed to set weights again once more without a wait restriction, to accommodate the default. - let result = SubtensorModule::do_set_weights( + let result = SubtensorModule::set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -268,7 +288,7 @@ fn test_weights_err_setting_weights_too_fast() { run_to_block(1); for i in 1..100 { - let result = SubtensorModule::do_set_weights( + let result = SubtensorModule::set_weights( RuntimeOrigin::signed(hotkey_account_id), netuid, weights_keys.clone(), @@ -444,7 +464,7 @@ fn test_no_signature() { new_test_ext(0).execute_with(|| { let uids: Vec = vec![]; let values: Vec = vec![]; - let result = SubtensorModule::do_set_weights(RuntimeOrigin::none(), 1, uids, values, 0); + let result = SubtensorModule::set_weights(RuntimeOrigin::none(), 1, uids, values, 0); assert_eq!(result, Err(DispatchError::BadOrigin)); }); } From 3466bf6d23458630933af04cba0b37660470d4df Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 08:11:23 -0700 Subject: [PATCH 23/39] revert set_weights removal --- pallets/subtensor/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 3bd4f66e2..460cb07c1 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -2054,6 +2054,10 @@ where let transaction_fee = 0; Ok((CallType::RemoveStake, transaction_fee, who.clone())) } + Some(Call::set_weights { .. }) => { + let transaction_fee = 0; + Ok((CallType::SetWeights, transaction_fee, who.clone())) + } Some(Call::commit_weights { .. }) => { let transaction_fee = 0; Ok((CallType::SetWeights, transaction_fee, who.clone())) From 3f5cc3791795fd02468c34228af6d9f921849451 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 08:29:50 -0700 Subject: [PATCH 24/39] cargo clippy --- pallets/subtensor/src/weights.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 9cbc4a6ac..909c40e20 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -387,8 +387,7 @@ impl Pallet { let last_commit_interval_start: u64 = commit_block - (commit_block % interval); // Allow commit if we're within the interval bounds - if current_block >= interval_start - && current_block <= interval_start + interval + if current_block <= interval_start + interval && interval_start > last_commit_interval_start { return true; @@ -396,7 +395,7 @@ impl Pallet { false } else { - return true; + true } } From 677a2413f507ed0d53b8c8b80b1ba95eaf947007 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Wed, 8 May 2024 11:57:11 -0700 Subject: [PATCH 25/39] expand test_commit_reveal_interval --- pallets/subtensor/tests/weights.rs | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index d941d1aa1..d86aee33a 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -1126,6 +1126,46 @@ fn test_commit_reveal_interval() { ), Error::::InvalidRevealTempo ); + + // Testing when you commit but do not reveal until later intervals + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash + )); + step_block(425); + let commit_hash_2: H256 = BlakeTwo256::hash_of(&( + hotkey, + nonce, + netuid, + uids.clone(), + weight_values.clone(), + version_key + 1, + )); + assert_ok!(SubtensorModule::commit_weights( + RuntimeOrigin::signed(hotkey), + netuid, + commit_hash_2 + )); + step_block(100); + assert_err!( + SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + ), + Error::::InvalidReveal + ); + assert_ok!(SubtensorModule::reveal_weights( + RuntimeOrigin::signed(hotkey), + netuid, + uids.clone(), + weight_values.clone(), + version_key + 1, + )); + }); } From c8b5d2e54e44dd438be21ac08080ee2bfe04a536 Mon Sep 17 00:00:00 2001 From: Samuel Dare Date: Wed, 8 May 2024 23:45:03 +0400 Subject: [PATCH 26/39] feat: make faucet feeless --- Cargo.lock | 32 +++++++++++++++++++++--------- pallets/subtensor/src/lib.rs | 7 +++++-- pallets/subtensor/tests/weights.rs | 1 - runtime/Cargo.toml | 5 ++++- runtime/src/lib.rs | 2 ++ 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17e18432c..0658b1a8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4676,6 +4676,7 @@ dependencies = [ "pallet-proxy", "pallet-registry", "pallet-scheduler", + "pallet-skip-feeless-payment", "pallet-subtensor", "pallet-sudo", "pallet-timestamp", @@ -5143,6 +5144,19 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "pallet-skip-feeless-payment" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0#7049c3c98836b3e9253f6aaa69b6bf3d622e3962" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0)", +] + [[package]] name = "pallet-subtensor" version = "4.0.0-dev" @@ -8284,7 +8298,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -8346,7 +8360,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "proc-macro2", "quote", @@ -8366,7 +8380,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "environmental", "parity-scale-codec", @@ -8549,7 +8563,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8581,7 +8595,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "Inflector", "expander", @@ -8670,7 +8684,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10. [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" [[package]] name = "sp-storage" @@ -8687,7 +8701,7 @@ dependencies = [ [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8722,7 +8736,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "parity-scale-codec", "tracing", @@ -8819,7 +8833,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#c973fe86f8c668462186c95655a58fda04508e9a" +source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" dependencies = [ "impl-trait-for-tuples", "log", diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 460cb07c1..7c3719376 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1804,8 +1804,11 @@ pub mod pallet { #[pallet::call_index(60)] #[pallet::weight((Weight::from_parts(91_000_000, 0) - .saturating_add(T::DbWeight::get().reads(27)) - .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] + .saturating_add(T::DbWeight::get().reads(27)) + .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] + #[pallet::feeless_if(|_origin: &OriginFor, _block_number: &u64, _nonce: &u64, _work: &Vec| -> bool { + cfg!(feature = "pow-faucet") + })] pub fn faucet( origin: OriginFor, block_number: u64, diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index d86aee33a..ebb276667 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -1165,7 +1165,6 @@ fn test_commit_reveal_interval() { weight_values.clone(), version_key + 1, )); - }); } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 306fae05d..2b8d108b6 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -49,6 +49,8 @@ sp-session = { workspace = true } sp-std = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } +pallet-skip-feeless-payment= { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.10.0", default-features = false } + # Temporary sudo pallet-sudo = { workspace = true } @@ -142,7 +144,8 @@ std = [ "sp-tracing/std", "log/std", "sp-storage/std", - "sp-genesis-builder/std" + "sp-genesis-builder/std", + "pallet-skip-feeless-payment/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ffbbfb87d..64f3786e2 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,6 +64,7 @@ use pallet_transaction_payment::{CurrencyAdapter, Multiplier}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; +use pallet_skip_feeless_payment::SkipCheckIfFeeless; // Subtensor module pub use pallet_subtensor; @@ -1182,6 +1183,7 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, pallet_subtensor::SubtensorSignedExtension, pallet_commitments::CommitmentsSignedExtension, + SkipCheckIfFeeless, ); type Migrations = ( From 098efb25b26655a5d19d337fdd1e5abce155d53f Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 08:17:47 -0700 Subject: [PATCH 27/39] revert make faucet feeless --- Cargo.lock | 14 -------------- pallets/subtensor/src/lib.rs | 5 +---- runtime/Cargo.toml | 3 --- runtime/src/lib.rs | 2 -- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0658b1a8e..16c6665a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4676,7 +4676,6 @@ dependencies = [ "pallet-proxy", "pallet-registry", "pallet-scheduler", - "pallet-skip-feeless-payment", "pallet-subtensor", "pallet-sudo", "pallet-timestamp", @@ -5144,19 +5143,6 @@ dependencies = [ "sp-trie", ] -[[package]] -name = "pallet-skip-feeless-payment" -version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0#7049c3c98836b3e9253f6aaa69b6bf3d622e3962" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0)", -] - [[package]] name = "pallet-subtensor" version = "4.0.0-dev" diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 7c3719376..37846fb83 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1805,10 +1805,7 @@ pub mod pallet { #[pallet::call_index(60)] #[pallet::weight((Weight::from_parts(91_000_000, 0) .saturating_add(T::DbWeight::get().reads(27)) - .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] - #[pallet::feeless_if(|_origin: &OriginFor, _block_number: &u64, _nonce: &u64, _work: &Vec| -> bool { - cfg!(feature = "pow-faucet") - })] + .saturating_add(T::DbWeight::get().writes(22)), DispatchClass::Normal, Pays::No))] pub fn faucet( origin: OriginFor, block_number: u64, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 2b8d108b6..aaba62b09 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -49,8 +49,6 @@ sp-session = { workspace = true } sp-std = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } -pallet-skip-feeless-payment= { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.10.0", default-features = false } - # Temporary sudo pallet-sudo = { workspace = true } @@ -145,7 +143,6 @@ std = [ "log/std", "sp-storage/std", "sp-genesis-builder/std", - "pallet-skip-feeless-payment/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 64f3786e2..ffbbfb87d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,7 +64,6 @@ use pallet_transaction_payment::{CurrencyAdapter, Multiplier}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; -use pallet_skip_feeless_payment::SkipCheckIfFeeless; // Subtensor module pub use pallet_subtensor; @@ -1183,7 +1182,6 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, pallet_subtensor::SubtensorSignedExtension, pallet_commitments::CommitmentsSignedExtension, - SkipCheckIfFeeless, ); type Migrations = ( From e6daa91ae7a134f969859d0560424dda78b1bf09 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 08:41:04 -0700 Subject: [PATCH 28/39] remove nonce from hash --- pallets/subtensor/src/weights.rs | 6 ------ pallets/subtensor/tests/weights.rs | 19 +++---------------- runtime/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 909c40e20..9fb84603e 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2,7 +2,6 @@ use super::*; use crate::math::*; use sp_core::H256; use sp_runtime::traits::{BlakeTwo256, Hash}; -use sp_runtime::SaturatedConversion; use sp_std::vec; impl Pallet { @@ -30,10 +29,6 @@ impl Pallet { version_key: u64, ) -> DispatchResult { let who = ensure_signed(origin.clone())?; - let nonce: u64 = frame_system::Pallet::::account(&who) - .nonce - .saturated_into(); - WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { let (commit_hash, commit_block) = maybe_commit.take().ok_or(Error::::NoCommitFound)?; @@ -45,7 +40,6 @@ impl Pallet { let provided_hash: H256 = BlakeTwo256::hash_of(&( who.clone(), - nonce, netuid, uids.clone(), values.clone(), diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index ebb276667..fe647152b 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -48,7 +48,7 @@ fn test_commit_weights_dispatch_info_ok() { let hotkey: U256 = U256::from(1); let commit_hash: H256 = - BlakeTwo256::hash_of(&(hotkey, 0, netuid, dests, weights, version_key)); + BlakeTwo256::hash_of(&(hotkey, netuid, dests, weights, version_key)); let call = RuntimeCall::SubtensorModule(SubtensorCall::commit_weights { netuid, @@ -963,11 +963,9 @@ fn test_commit_reveal_weights_ok() { let weight_values: Vec = vec![10, 10]; let version_key: u64 = 0; let hotkey: U256 = U256::from(1); - let nonce: u64 = 0; let commit_hash: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1009,11 +1007,9 @@ fn test_commit_reveal_interval() { let weight_values: Vec = vec![10, 10]; let version_key: u64 = 0; let hotkey: U256 = U256::from(1); - let nonce: u64 = 0; let commit_hash: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1136,7 +1132,6 @@ fn test_commit_reveal_interval() { step_block(425); let commit_hash_2: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1176,7 +1171,6 @@ fn test_commit_reveal_hash() { let weight_values: Vec = vec![10, 10]; let version_key: u64 = 0; let hotkey: U256 = U256::from(1); - let nonce: u64 = 0; add_network(netuid, 0, 0); register_ok_neuron(netuid, U256::from(3), U256::from(4), 300000); @@ -1189,7 +1183,6 @@ fn test_commit_reveal_hash() { let commit_hash: H256 = BlakeTwo256::hash_of(&( hotkey, - nonce, netuid, uids.clone(), weight_values.clone(), @@ -1265,14 +1258,8 @@ fn commit_reveal_set_weights( SubtensorModule::set_weight_commit_interval(5); SubtensorModule::set_weights_set_rate_limit(netuid, 5); - let commit_hash: H256 = BlakeTwo256::hash_of(&( - hotkey, - 0_u64, - netuid, - uids.clone(), - weights.clone(), - version_key, - )); + let commit_hash: H256 = + BlakeTwo256::hash_of(&(hotkey, netuid, uids.clone(), weights.clone(), version_key)); SubtensorModule::commit_weights(RuntimeOrigin::signed(hotkey), netuid, commit_hash)?; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index aaba62b09..306fae05d 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -142,7 +142,7 @@ std = [ "sp-tracing/std", "log/std", "sp-storage/std", - "sp-genesis-builder/std", + "sp-genesis-builder/std" ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", From 7f88478dca327628e02916b0fabfda4705d7bb7b Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Thu, 9 May 2024 10:09:18 -0700 Subject: [PATCH 29/39] cargo clippy --- pallets/subtensor/tests/weights.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index fe647152b..6403043b2 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -70,10 +70,10 @@ fn test_reveal_weights_dispatch_info_ok() { let version_key: u64 = 0; let call = RuntimeCall::SubtensorModule(SubtensorCall::reveal_weights { - netuid: netuid, + netuid, uids: dests, values: weights, - version_key: version_key, + version_key }); let dispatch_info = call.get_dispatch_info(); From a65a43b33784775e983db9e42f6829f9f7a0691a Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Fri, 10 May 2024 07:53:08 -0700 Subject: [PATCH 30/39] cargo fmt --- pallets/subtensor/tests/weights.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/subtensor/tests/weights.rs b/pallets/subtensor/tests/weights.rs index 6403043b2..5badaafad 100644 --- a/pallets/subtensor/tests/weights.rs +++ b/pallets/subtensor/tests/weights.rs @@ -73,7 +73,7 @@ fn test_reveal_weights_dispatch_info_ok() { netuid, uids: dests, values: weights, - version_key + version_key, }); let dispatch_info = call.get_dispatch_info(); From 3fa337e5b22995cf7db75aabd011abe6ac3a4c66 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Fri, 10 May 2024 08:19:33 -0700 Subject: [PATCH 31/39] fix cargo.lock --- Cargo.lock | 1791 ++++++++++++++++++++++++++-------------------------- 1 file changed, 909 insertions(+), 882 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16c6665a9..992c85032 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,16 +18,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.27.3", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli 0.28.1", + "gimli 0.27.1", ] [[package]] @@ -43,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.7", + "generic-array 0.14.6", ] [[package]] @@ -73,11 +64,11 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.8" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -89,7 +80,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -97,9 +88,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -136,47 +127,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -184,9 +176,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "approx" @@ -208,7 +200,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -222,7 +214,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -394,7 +386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -407,7 +399,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -485,7 +477,7 @@ checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -538,9 +530,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asn1-rs" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +checksum = "cf6690c370453db30743b373a60ba498fc0d6d83b11f4abfd87a84a075db5dd4" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -560,7 +552,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "synstructure", ] @@ -572,7 +564,7 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -582,56 +574,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener", "futures-core", ] [[package]] name = "async-io" -version = "2.3.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" dependencies = [ "async-lock", - "cfg-if", + "autocfg", "concurrent-queue", - "futures-io", "futures-lite", + "libc", + "log", "parking", "polling", - "rustix 0.38.32", "slab", - "tracing", - "windows-sys 0.52.0", + "socket2 0.4.7", + "waker-fn", + "windows-sys 0.42.0", ] [[package]] name = "async-lock" -version = "3.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy", - "pin-project-lite 0.2.14", + "event-listener", + "futures-lite", ] [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "asynchronous-codec" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" dependencies = [ "bytes", "futures-sink", @@ -642,22 +634,22 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ - "addr2line 0.21.0", + "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object 0.30.3", "rustc-demangle", ] @@ -704,15 +696,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" [[package]] name = "beef" @@ -744,13 +736,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.17", + "prettyplease 0.2.20", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -822,31 +814,31 @@ checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq", + "constant_time_eq 0.1.5", ] [[package]] name = "blake3" -version = "1.5.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.2.4", ] [[package]] @@ -855,16 +847,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", ] [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", ] [[package]] @@ -905,9 +897,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byte-slice-cast" @@ -923,21 +915,21 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] name = "byteorder" -version = "1.5.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.6.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2-sys" @@ -962,18 +954,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] @@ -986,7 +978,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.16", "serde", "serde_json", "thiserror", @@ -994,12 +986,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.91" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd97381a8cc6493395a5afc4c691c1084b3768db713b73aa215217aa245d153" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1013,9 +1006,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -1068,9 +1061,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1078,7 +1071,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1100,7 +1093,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", ] [[package]] @@ -1116,9 +1109,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", @@ -1157,7 +1150,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -1178,9 +1171,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "comfy-table" @@ -1217,9 +1210,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ "crossbeam-utils", ] @@ -1239,9 +1232,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.6" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const-random" @@ -1258,11 +1251,23 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "constant_time_eq" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" + [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1283,9 +1288,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -1293,9 +1298,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core2" @@ -1345,7 +1350,7 @@ dependencies = [ "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.27.3", + "gimli 0.27.1", "hashbrown 0.13.2", "log", "regalloc2 0.6.1", @@ -1424,37 +1429,55 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ + "autocfg", + "cfg-if", "crossbeam-utils", + "memoffset 0.7.1", + "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] [[package]] name = "crunchy" @@ -1468,7 +1491,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", "rand_core 0.6.4", "subtle 2.4.1", "zeroize", @@ -1480,9 +1503,9 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", "rand_core 0.6.4", - "typenum 1.17.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1501,7 +1524,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", "subtle 2.4.1", ] @@ -1552,14 +1575,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "cxx" -version = "1.0.120" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dc7287237dd438b926a81a1a5605dad33d286870e5eee2db17bf2bcd9e92a" +checksum = "bc831ee6a32dd495436e317595e639a587aa9907bef96fe6e6abc290ab6204e9" dependencies = [ "cc", "cxxbridge-flags", @@ -1569,9 +1592,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.120" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f47c6c8ad7c1a10d3ef0fe3ff6733f4db0d78f08ef0b13121543163ef327058b" +checksum = "94331d54f1b1a8895cd81049f7eaaaef9d05a7dcb4d1fd08bf3ff0806246789d" dependencies = [ "cc", "codespan-reporting", @@ -1579,31 +1602,31 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] name = "cxxbridge-flags" -version = "1.0.120" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "701a1ac7a697e249cdd8dc026d7a7dafbfd0dbcd8bd24ec55889f2bc13dd6287" +checksum = "48dcd35ba14ca9b40d6e4b4b39961f23d835dbb8eed74565ded361d93e1feb8a" [[package]] name = "cxxbridge-macro" -version = "1.0.120" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b404f596046b0bb2d903a9c786b875a126261b52b7c3a64bbb66382c41c771df" +checksum = "81bbeb29798b407ccd82a3324ade1a7286e0d29851475990b612670f6f5124d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] name = "darling" -version = "0.20.8" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" dependencies = [ "darling_core", "darling_macro", @@ -1611,53 +1634,53 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] name = "dashmap" -version = "5.5.3" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.12.3", "lock_api", "once_cell", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.7", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1665,12 +1688,12 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1685,9 +1708,9 @@ dependencies = [ [[package]] name = "der-parser" -version = "8.2.0" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" dependencies = [ "asn1-rs", "displaydoc", @@ -1697,16 +1720,6 @@ dependencies = [ "rusticata-macros", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - [[package]] name = "derivative" version = "2.2.0" @@ -1715,7 +1728,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1726,7 +1739,7 @@ checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1737,7 +1750,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -1750,7 +1763,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1774,7 +1787,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", ] [[package]] @@ -1783,7 +1796,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer 0.10.3", "const-oid", "crypto-common", "subtle 2.4.1", @@ -1833,13 +1846,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] @@ -1879,7 +1892,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.58", + "syn 2.0.61", "termcolor", "toml 0.8.12", "walkdir", @@ -1893,9 +1906,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dtoa" -version = "1.0.9" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313" [[package]] name = "dyn-clonable" @@ -1915,14 +1928,14 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" [[package]] name = "ecdsa" @@ -1980,9 +1993,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "elliptic-curve" @@ -1994,7 +2007,7 @@ dependencies = [ "crypto-bigint", "digest 0.10.7", "ff", - "generic-array 0.14.7", + "generic-array 0.14.6", "group", "pkcs8", "rand_core 0.6.4", @@ -2019,7 +2032,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -2039,14 +2052,14 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "env_logger" -version = "0.10.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ "humantime", "is-terminal", @@ -2069,14 +2082,35 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", ] +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "ethbloom" version = "0.13.0" @@ -2110,27 +2144,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.14", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite 0.2.14", -] - [[package]] name = "exit-future" version = "0.2.0" @@ -2151,7 +2164,7 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -2168,9 +2181,12 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.0.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] [[package]] name = "fdlimit" @@ -2207,9 +2223,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" [[package]] name = "file-per-thread-logger" @@ -2223,14 +2239,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "redox_syscall", + "windows-sys 0.42.0", ] [[package]] @@ -2269,9 +2285,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "libz-sys", @@ -2303,9 +2319,9 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ "percent-encoding", ] @@ -2477,7 +2493,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -2489,7 +2505,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -2499,7 +2515,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10. dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -2634,12 +2650,17 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.3.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ + "fastrand", "futures-core", + "futures-io", + "memchr", + "parking", "pin-project-lite 0.2.14", + "waker-fn", ] [[package]] @@ -2650,7 +2671,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -2660,7 +2681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.9", + "rustls 0.20.8", "webpki", ] @@ -2678,9 +2699,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" @@ -2715,16 +2736,16 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.17.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "generic-array" -version = "0.14.7" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ - "typenum 1.17.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check", "zeroize", ] @@ -2752,9 +2773,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -2777,18 +2798,18 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", "polyval", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" dependencies = [ "fallible-iterator 0.2.0", - "indexmap 1.9.3", + "indexmap 1.9.2", "stable_deref_trait", ] @@ -2841,9 +2862,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", @@ -2851,7 +2872,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.6", + "indexmap 1.9.2", "slab", "tokio", "tokio-util", @@ -2893,7 +2914,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.8", + "ahash 0.7.6", ] [[package]] @@ -2907,9 +2928,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -2921,7 +2942,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2938,9 +2959,18 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "856b5cb0902c2b6d65d5fd97dfa30f9b70c7538e770b98eab5ed52d8db923e01" [[package]] name = "hex" @@ -2962,9 +2992,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.4" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ "hmac 0.12.1", ] @@ -2995,19 +3025,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.7", + "generic-array 0.14.6", "hmac 0.8.1", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "hostname" version = "0.3.1" @@ -3032,9 +3053,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -3043,9 +3064,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" [[package]] name = "httparse" @@ -3055,9 +3076,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "humantime" @@ -3082,7 +3103,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.14", - "socket2 0.5.6", + "socket2 0.4.7", "tokio", "tower-service", "tracing", @@ -3099,7 +3120,7 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs", "tokio", "tokio-rustls", @@ -3107,25 +3128,26 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "winapi", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ - "cc", + "cxx", + "cxx-build", ] [[package]] @@ -3147,9 +3169,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3157,19 +3179,19 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.10.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi", ] [[package]] name = "if-watch" -version = "3.2.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "ba7abdbb86e485125dad06c2691e1e393bf3b08c7b743b43aa162a00fd39062e" dependencies = [ "async-io", "core-foundation", @@ -3219,7 +3241,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -3243,9 +3265,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -3259,7 +3281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -3268,7 +3290,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.6", ] [[package]] @@ -3291,13 +3313,12 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.11" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" dependencies = [ - "hermit-abi", "libc", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] @@ -3308,21 +3329,21 @@ checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" [[package]] name = "ipconfig" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" dependencies = [ - "socket2 0.5.6", + "socket2 0.4.7", "widestring", - "windows-sys 0.48.0", + "winapi", "winreg", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" @@ -3330,11 +3351,17 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.0", "libc", "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" @@ -3346,24 +3373,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -3414,7 +3441,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -3470,9 +3497,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" dependencies = [ "cpufeatures", ] @@ -3530,25 +3557,25 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libloading" -version = "0.8.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "winapi", ] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "libp2p" @@ -3559,7 +3586,7 @@ dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.14", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -3732,7 +3759,7 @@ dependencies = [ "log", "rand", "smallvec", - "socket2 0.4.10", + "socket2 0.4.7", "tokio", "trust-dns-proto", "void", @@ -3809,7 +3836,7 @@ dependencies = [ "parking_lot 0.12.1", "quinn-proto", "rand", - "rustls 0.20.9", + "rustls 0.20.8", "thiserror", "tokio", ] @@ -3859,7 +3886,7 @@ checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ "heck 0.4.1", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -3874,7 +3901,7 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.10", + "socket2 0.4.7", "tokio", ] @@ -3890,7 +3917,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls 0.20.9", + "rustls 0.20.8", "thiserror", "webpki", "x509-parser", @@ -3943,16 +3970,6 @@ dependencies = [ "yamux", ] -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.5.0", - "libc", -] - [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -3984,7 +4001,7 @@ dependencies = [ "rand", "serde", "sha2 0.9.9", - "typenum 1.17.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4018,9 +4035,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" dependencies = [ "cc", "pkg-config", @@ -4029,9 +4046,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.9" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] @@ -4053,9 +4070,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +checksum = "475015a7f8f017edb28d2e69813be23500ad4b32cfe3421c4148efc97324ee52" dependencies = [ "nalgebra", ] @@ -4086,9 +4103,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -4165,7 +4182,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -4179,7 +4196,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -4190,7 +4207,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -4201,7 +4218,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -4216,7 +4233,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] @@ -4225,7 +4242,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] @@ -4236,34 +4253,33 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.8" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" dependencies = [ - "autocfg", "rawpointer", ] [[package]] name = "memchr" -version = "2.7.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.6.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "rustix 0.38.32", + "rustix 0.36.8", ] [[package]] name = "memmap2" -version = "0.5.10" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" dependencies = [ "libc", ] @@ -4277,6 +4293,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.8.0" @@ -4315,9 +4340,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -4360,9 +4385,9 @@ dependencies = [ [[package]] name = "mockall" -version = "0.11.4" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" dependencies = [ "cfg-if", "downcast", @@ -4375,14 +4400,14 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.11.4" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -4442,7 +4467,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "synstructure", ] @@ -4468,9 +4493,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.5" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea4908d4f23254adda3daa60ffef0f1ac7b8c3e9a864cf3cc154b251908a2ef" +checksum = "d68d47bba83f9e2006d117a9a33af1524e655516b8919caac694427a6fb1e511" dependencies = [ "approx", "matrixmultiply", @@ -4479,18 +4504,18 @@ dependencies = [ "num-rational", "num-traits", "simba", - "typenum 1.17.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "nalgebra-macros" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -4570,9 +4595,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.6" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +checksum = "260e21fbb6f3d253a14df90eb0000a6066780a15dd901a7519ce02d77a94985b" dependencies = [ "bytes", "futures", @@ -4745,9 +4770,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ "autocfg", "num-integer", @@ -4756,19 +4781,13 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-format" version = "0.4.4" @@ -4781,10 +4800,11 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ + "autocfg", "num-traits", ] @@ -4801,9 +4821,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -4811,23 +4831,23 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "object" -version = "0.30.4" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "crc32fast", "hashbrown 0.13.2", - "indexmap 1.9.3", + "indexmap 1.9.2", "memchr", ] @@ -4863,9 +4883,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl-probe" @@ -5298,7 +5318,7 @@ dependencies = [ "libc", "log", "lz4", - "memmap2 0.5.10", + "memmap2 0.5.8", "parking_lot 0.12.1", "rand", "siphasher", @@ -5308,9 +5328,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec", "bitvec", @@ -5323,14 +5343,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -5364,7 +5384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 1.0.107", "synstructure", ] @@ -5376,9 +5396,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" @@ -5398,7 +5418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.7", ] [[package]] @@ -5410,22 +5430,22 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-sys 0.45.0", ] [[package]] @@ -5447,9 +5467,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "pbkdf2" @@ -5478,26 +5498,25 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.7.9" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" dependencies = [ - "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.9" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" +checksum = "8bf026e2d0581559db66d837fe5242320f525d85c76283c61f4d51a1238d65ea" dependencies = [ "pest", "pest_generator", @@ -5505,22 +5524,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.9" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" +checksum = "2b27bd18aa01d91c8ed2b61ea23406a676b42d82609c6e2581fba42f0c15f17f" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] name = "pest_meta" -version = "2.7.9" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" +checksum = "9f02b677c1859756359fc9983c2e56a0237f18624a3789528804406b7e915e5d" dependencies = [ "once_cell", "pest", @@ -5529,12 +5548,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 1.9.2", ] [[package]] @@ -5554,7 +5573,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -5587,15 +5606,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "platforms" -version = "3.4.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkavm" @@ -5646,7 +5665,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -5656,7 +5675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -5666,7 +5685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" dependencies = [ "gimli 0.28.1", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "log", "object 0.32.2", "polkavm-common", @@ -5682,17 +5701,16 @@ checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" [[package]] name = "polling" -version = "3.6.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" dependencies = [ + "autocfg", "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite 0.2.14", - "rustix 0.38.32", - "tracing", - "windows-sys 0.52.0", + "libc", + "log", + "wepoll-ffi", + "windows-sys 0.42.0", ] [[package]] @@ -5702,7 +5720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", "universal-hash", ] @@ -5714,7 +5732,7 @@ checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", "universal-hash", ] @@ -5724,12 +5742,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -5752,15 +5764,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" dependencies = [ "predicates-core", "termtree", @@ -5773,7 +5785,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -5783,24 +5795,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "primitive-types" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", @@ -5820,15 +5832,6 @@ dependencies = [ "toml 0.5.11", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.2", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -5847,7 +5850,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "version_check", ] @@ -5870,14 +5873,14 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -5916,17 +5919,17 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "prost" -version = "0.11.9" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698" dependencies = [ "bytes", - "prost-derive 0.11.9", + "prost-derive 0.11.6", ] [[package]] @@ -5936,14 +5939,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" dependencies = [ "bytes", - "prost-derive 0.12.4", + "prost-derive 0.12.5", ] [[package]] name = "prost-build" -version = "0.11.9" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" dependencies = [ "bytes", "heck 0.4.1", @@ -5953,47 +5956,48 @@ dependencies = [ "multimap", "petgraph", "prettyplease 0.1.11", - "prost 0.11.9", + "prost 0.11.6", "prost-types", "regex", - "syn 1.0.109", + "syn 1.0.107", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" dependencies = [ - "prost 0.11.9", + "bytes", + "prost 0.11.6", ] [[package]] @@ -6061,15 +6065,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.6" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" dependencies = [ "bytes", "rand", "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls 0.20.8", "slab", "thiserror", "tinyvec", @@ -6079,9 +6083,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -6128,7 +6132,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", ] [[package]] @@ -6167,9 +6171,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.10.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ "either", "rayon-core", @@ -6177,12 +6181,14 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" dependencies = [ + "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", + "num_cpus", ] [[package]] @@ -6206,44 +6212,35 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.14", - "libredox", + "getrandom 0.2.15", + "redox_syscall", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] @@ -6273,14 +6270,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-syntax", ] [[package]] @@ -6289,31 +6285,23 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.3", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] -name = "regex-syntax" -version = "0.8.3" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] [[package]] name = "resolv-conf" @@ -6374,7 +6362,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -6409,13 +6397,13 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.3.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" dependencies = [ "libc", "rtoolbox", - "windows-sys 0.48.0", + "winapi", ] [[package]] @@ -6435,19 +6423,19 @@ dependencies = [ [[package]] name = "rtoolbox" -version = "0.0.2" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -6476,7 +6464,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.16", ] [[package]] @@ -6490,12 +6478,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.17" +version = "0.36.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags 1.3.2", - "errno", + "errno 0.2.8", "io-lifetimes", "libc", "linux-raw-sys 0.1.4", @@ -6504,12 +6492,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", - "errno", + "errno 0.3.9", "libc", "linux-raw-sys 0.4.13", "windows-sys 0.52.0", @@ -6517,9 +6505,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring 0.16.20", @@ -6529,9 +6517,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -6541,9 +6529,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -6553,11 +6541,11 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.7", + "base64 0.21.0", ] [[package]] @@ -6572,9 +6560,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "rw-stream-sink" @@ -6589,9 +6577,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safe-mix" @@ -6604,9 +6592,9 @@ dependencies = [ [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "794821e4ccb0d9f979512f9c1973480123f9bd62a90d74ab0f9426fcf8f4a529" dependencies = [ "bytemuck", ] @@ -6702,7 +6690,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -6996,7 +6984,7 @@ dependencies = [ "libc", "log", "parking_lot 0.12.1", - "rustix 0.36.17", + "rustix 0.36.8", "sc-allocator", "sc-executor-common", "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0)", @@ -7524,7 +7512,7 @@ dependencies = [ "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10.0)", "thiserror", "tracing", - "tracing-log 0.1.4", + "tracing-log 0.1.3", "tracing-subscriber 0.2.25", ] @@ -7536,7 +7524,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -7599,9 +7587,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if", @@ -7613,23 +7601,23 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.42.0", ] [[package]] @@ -7664,35 +7652,35 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "sct" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "sec1" -version = "0.7.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +checksum = "48518a2b5775ba8ca5b46596aae011caa431e6ce7e4a67ead66d92f08884220e" dependencies = [ "base16ct", "der", - "generic-array 0.14.7", + "generic-array 0.14.6", "pkcs8", "serdect", "subtle 2.4.1", @@ -7728,9 +7716,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -7741,9 +7729,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -7769,9 +7757,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" dependencies = [ "serde", ] @@ -7784,9 +7772,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.199" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -7811,20 +7799,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.199" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -7849,7 +7837,7 @@ dependencies = [ "base64 0.13.1", "chrono", "hex", - "indexmap 1.9.3", + "indexmap 1.9.2", "serde", "serde_json", "serde_with_macros", @@ -7858,14 +7846,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "2.3.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] @@ -7888,7 +7876,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -7901,7 +7889,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -7917,9 +7905,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.8" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ "digest 0.10.7", "keccak", @@ -7927,24 +7915,24 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.7" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] [[package]] name = "shlex" -version = "1.3.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] @@ -7961,9 +7949,9 @@ dependencies = [ [[package]] name = "simba" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +checksum = "50582927ed6f77e4ac020c057f37a268fc6aebc29225050365aacbb9deeeddc4" dependencies = [ "approx", "num-complex", @@ -7986,18 +7974,18 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ "autocfg", ] [[package]] name = "slice-group-by" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" +checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "smallvec" @@ -8007,9 +7995,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snap" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" @@ -8030,9 +8018,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.10" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -8040,9 +8028,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -8098,7 +8086,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -8284,7 +8272,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -8321,7 +8309,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10. dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -8340,17 +8328,17 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10. dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -8366,7 +8354,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "environmental", "parity-scale-codec", @@ -8549,7 +8537,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8575,20 +8563,20 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "Inflector", "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -8670,7 +8658,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.10. [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" [[package]] name = "sp-storage" @@ -8687,7 +8675,7 @@ dependencies = [ [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8722,7 +8710,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "parity-scale-codec", "tracing", @@ -8801,7 +8789,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -8819,7 +8807,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#6fdb522ded3813f43a539964af78d5fc6d9f1e97" +source = "git+https://github.com/paritytech/polkadot-sdk#d37719da022879b4e2ef7947f5c9d2187f666ae7" dependencies = [ "impl-trait-for-tuples", "log", @@ -8873,9 +8861,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.47.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +checksum = "e40c020d72bc0a9c5660bb71e4a6fdef081493583062c474740a7d59f55f0e7b" dependencies = [ "Inflector", "num-format", @@ -8923,7 +8911,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -8963,7 +8951,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -8976,7 +8964,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -9004,7 +8992,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0", + "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=v1.16.0)", ] [[package]] @@ -9096,9 +9084,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.109" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -9107,9 +9095,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", @@ -9124,15 +9112,15 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "unicode-xid", ] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -9157,27 +9145,29 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", "fastrand", - "rustix 0.38.32", - "windows-sys 0.52.0", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", ] [[package]] name = "termcolor" -version = "1.4.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -9188,34 +9178,34 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] [[package]] name = "termtree" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -9226,11 +9216,10 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ - "cfg-if", "once_cell", ] @@ -9245,9 +9234,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.4+5.3.0-patched" +version = "0.5.3+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" +checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8" dependencies = [ "cc", "libc", @@ -9255,14 +9244,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ - "deranged", "itoa", - "num-conv", - "powerfmt", "serde", "time-core", "time-macros", @@ -9270,17 +9256,16 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" dependencies = [ - "num-conv", "time-core", ] @@ -9322,7 +9307,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -9335,7 +9320,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -9344,7 +9329,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] @@ -9362,9 +9347,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -9405,17 +9390,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -9437,7 +9411,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.7", + "winnow 0.6.8", ] [[package]] @@ -9487,10 +9461,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "log", "pin-project-lite 0.2.14", "tracing-attributes", @@ -9499,13 +9474,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", ] [[package]] @@ -9530,12 +9505,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ + "lazy_static", "log", - "once_cell", "tracing-core", ] @@ -9579,7 +9554,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.1.4", + "tracing-log 0.1.3", "tracing-serde", ] @@ -9641,7 +9616,7 @@ dependencies = [ "lazy_static", "rand", "smallvec", - "socket2 0.4.10", + "socket2 0.4.7", "thiserror", "tinyvec", "tokio", @@ -9671,9 +9646,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tt-call" @@ -9693,6 +9668,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + [[package]] name = "typenum" version = "1.16.0" @@ -9702,17 +9683,11 @@ dependencies = [ "scale-info", ] -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uint" @@ -9728,15 +9703,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" @@ -9749,9 +9724,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" @@ -9771,9 +9746,9 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", "bytes", @@ -9795,12 +9770,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 0.3.0", "percent-encoding", ] @@ -9858,6 +9833,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "walkdir" version = "2.5.0" @@ -9870,10 +9851,11 @@ dependencies = [ [[package]] name = "want" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ + "log", "try-lock", ] @@ -9891,9 +9873,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -9901,24 +9883,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -9928,9 +9910,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9938,22 +9920,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasm-instrument" @@ -10025,7 +10007,7 @@ version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ - "indexmap 1.9.3", + "indexmap 1.9.2", "url", ] @@ -10038,10 +10020,10 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap 1.9.3", + "indexmap 1.9.2", "libc", "log", - "object 0.30.4", + "object 0.30.3", "once_cell", "paste", "psm", @@ -10073,12 +10055,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.7", + "base64 0.21.0", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.17", + "rustix 0.36.8", "serde", "sha2 0.10.8", "toml 0.5.11", @@ -10098,9 +10080,9 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.27.3", + "gimli 0.27.1", "log", - "object 0.30.4", + "object 0.30.3", "target-lexicon", "thiserror", "wasmparser", @@ -10117,8 +10099,8 @@ dependencies = [ "anyhow", "cranelift-codegen", "cranelift-native", - "gimli 0.27.3", - "object 0.30.4", + "gimli 0.27.1", + "object 0.30.3", "target-lexicon", "wasmtime-environ", ] @@ -10131,10 +10113,10 @@ checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", + "gimli 0.27.1", + "indexmap 1.9.2", "log", - "object 0.30.4", + "object 0.30.3", "serde", "target-lexicon", "thiserror", @@ -10148,14 +10130,14 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.19.0", + "addr2line", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.27.3", + "gimli 0.27.1", "log", - "object 0.30.4", + "object 0.30.3", "rustc-demangle", "serde", "target-lexicon", @@ -10172,9 +10154,9 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.30.4", + "object 0.30.3", "once_cell", - "rustix 0.36.17", + "rustix 0.36.8", ] [[package]] @@ -10197,15 +10179,15 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap 1.9.3", + "indexmap 1.9.2", "libc", "log", "mach", "memfd", - "memoffset", + "memoffset 0.8.0", "paste", "rand", - "rustix 0.36.17", + "rustix 0.36.8", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -10226,9 +10208,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -10236,12 +10218,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.4" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -10253,23 +10235,31 @@ dependencies = [ "webpki", ] +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "which" -version = "4.4.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", - "home", + "libc", "once_cell", - "rustix 0.38.32", ] [[package]] name = "wide" -version = "0.7.15" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" +checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223" dependencies = [ "bytemuck", "safe_arch", @@ -10277,9 +10267,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.1.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" [[package]] name = "winapi" @@ -10299,9 +10289,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ "winapi", ] @@ -10314,30 +10304,30 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" -dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-core" -version = "0.51.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" dependencies = [ - "windows-targets 0.48.5", + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", ] [[package]] -name = "windows-core" -version = "0.52.0" +name = "windows-sys" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows-targets 0.52.4", + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", ] [[package]] @@ -10346,7 +10336,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.42.1", ] [[package]] @@ -10364,22 +10354,22 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", ] [[package]] @@ -10399,24 +10389,25 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "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", + "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", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_gnullvm" @@ -10426,15 +10417,21 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_aarch64_msvc" @@ -10444,15 +10441,21 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_gnu" @@ -10462,15 +10465,27 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +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 = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_i686_msvc" @@ -10480,15 +10495,21 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnu" @@ -10498,15 +10519,15 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_gnullvm" @@ -10516,15 +10537,21 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "windows_x86_64_msvc" @@ -10534,9 +10561,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -10549,21 +10576,20 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.50.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "winapi", ] [[package]] @@ -10632,31 +10658,31 @@ dependencies = [ [[package]] name = "yasna" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" dependencies = [ "time", ] [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.61", ] [[package]] @@ -10670,13 +10696,14 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.4.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 1.0.107", + "synstructure", ] [[package]] From 3178bfa36a155393c75c2b19ec087e553f51c2cc Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Fri, 10 May 2024 09:30:34 -0700 Subject: [PATCH 32/39] add logs --- pallets/subtensor/src/errors.rs | 2 +- pallets/subtensor/src/weights.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pallets/subtensor/src/errors.rs b/pallets/subtensor/src/errors.rs index 9798fb2f1..57b190b93 100644 --- a/pallets/subtensor/src/errors.rs +++ b/pallets/subtensor/src/errors.rs @@ -132,7 +132,7 @@ mod errors { NomStakeBelowMinimumThreshold, /// delegate take is being set out of bounds InvalidTake, - /// Not allowed to comit weights + /// Not allowed to commit weights CommitNotAllowed, /// No commit found for provided hotkey+netuid when attempting to reveal weights NoCommitFound, diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 9fb84603e..87e6a3d54 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -11,6 +11,9 @@ impl Pallet { commit_hash: H256, ) -> DispatchResult { let who = ensure_signed(origin)?; + + log::info!("do_commit_weights( hotkey:{:?} netuid:{:?})", who, netuid); + ensure!(Self::can_commit(netuid, &who), Error::::CommitNotAllowed); WeightCommits::::insert( @@ -29,6 +32,9 @@ impl Pallet { version_key: u64, ) -> DispatchResult { let who = ensure_signed(origin.clone())?; + + log::info!("do_reveal_weights( hotkey:{:?} netuid:{:?})", who, netuid); + WeightCommits::::try_mutate_exists(netuid, &who, |maybe_commit| -> DispatchResult { let (commit_hash, commit_block) = maybe_commit.take().ok_or(Error::::NoCommitFound)?; From 841db8a0fd58a719a7b439a8ef5e8638d74b399b Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sat, 11 May 2024 18:45:22 -0700 Subject: [PATCH 33/39] add doc comments for commit/reveal --- pallets/subtensor/src/weights.rs | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 87e6a3d54..47fea4975 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -5,6 +5,22 @@ use sp_runtime::traits::{BlakeTwo256, Hash}; use sp_std::vec; impl Pallet { + // ---- The implementation for committing weight hashes. + // + // # Args: + // * 'origin': (RuntimeOrigin): + // - The signature of the committing hotkey. + // + // * 'netuid' (u16): + // - The u16 network identifier. + // + // * 'commit_hash' (H256): + // - The hash representing the committed weights. + // + // # Raises: + // * 'CommitNotAllowed': + // - Attempting to commit when it is not allowed. + // pub fn do_commit_weights( origin: T::RuntimeOrigin, netuid: u16, @@ -24,6 +40,34 @@ impl Pallet { Ok(()) } + // ---- The implementation for revealing committed weights. + // + // # Args: + // * 'origin': (RuntimeOrigin): + // - The signature of the revealing hotkey. + // + // * 'netuid' (u16): + // - The u16 network identifier. + // + // * 'uids' (Vec): + // - The uids for the weights being revealed. + // + // * 'values' (Vec): + // - The values of the weights being revealed. + // + // * 'version_key' (u64): + // - The network version key. + // + // # Raises: + // * 'NoCommitFound': + // - Attempting to reveal weights without an existing commit. + // + // * 'InvalidRevealTempo': + // - Attempting to reveal weights outside the valid tempo. + // + // * 'InvalidReveal': + // - The revealed hash does not match the committed hash. + // pub fn do_reveal_weights( origin: T::RuntimeOrigin, netuid: u16, From 4a3156e57f770cfe01a5d6d2746def038bdaff88 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 12 May 2024 10:09:17 -0700 Subject: [PATCH 34/39] finish doc comments --- pallets/subtensor/src/lib.rs | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 37846fb83..e422dbe9b 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1218,6 +1218,23 @@ pub mod pallet { Self::do_set_weights(origin, netuid, dests, weights, version_key) } + // ---- Used to commit a hash of your wieght values to later be revealed. + // + // # Args: + // * 'origin': (RuntimeOrigin): + // - The signature of the committing hotkey. + // + // * 'netuid' (u16): + // - The u16 network identifier. + // + // * 'commit_hash' (H256): + // - The hash representing the committed weights. + // + // # Raises: + // * 'CommitNotAllowed': + // - Attempting to commit when it is not allowed. + // + // #[pallet::call_index(96)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) @@ -1230,6 +1247,34 @@ pub mod pallet { Self::do_commit_weights(origin, netuid, commit_hash) } + // ---- Used to reveal the weights for a previously commited hash. + // + // # Args: + // * 'origin': (RuntimeOrigin): + // - The signature of the revealing hotkey. + // + // * 'netuid' (u16): + // - The u16 network identifier. + // + // * 'uids' (Vec): + // - The uids for the weights being revealed. + // + // * 'values' (Vec): + // - The values of the weights being revealed. + // + // * 'version_key' (u64): + // - The network version key. + // + // # Raises: + // * 'NoCommitFound': + // - Attempting to reveal weights without an existing commit. + // + // * 'InvalidRevealTempo': + // - Attempting to reveal weights outside the valid tempo. + // + // * 'InvalidReveal': + // - The revealed hash does not match the committed hash. + // #[pallet::call_index(97)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) From c4246dc649b796148242a87409eea6e539d20a4f Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 12 May 2024 10:09:36 -0700 Subject: [PATCH 35/39] prevent division by zero --- pallets/subtensor/src/weights.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 47fea4975..f229b0553 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -426,6 +426,10 @@ impl Pallet { pub fn can_commit(netuid: u16, who: &T::AccountId) -> bool { if let Some((_hash, commit_block)) = WeightCommits::::get(netuid, who) { let interval: u64 = Self::get_weight_commit_interval(); + if interval == 0 { + return true; //prevent division by 0 + } + let current_block: u64 = Self::get_current_block_as_u64(); let interval_start: u64 = current_block - (current_block % interval); let last_commit_interval_start: u64 = commit_block - (commit_block % interval); @@ -445,6 +449,10 @@ impl Pallet { pub fn is_reveal_block_range(commit_block: u64) -> bool { let interval: u64 = Self::get_weight_commit_interval(); + if interval == 0 { + return true; //prevent division by 0 + } + let commit_interval_start: u64 = commit_block - (commit_block % interval); // Find the start of the interval in which the commit occurred let reveal_interval_start: u64 = commit_interval_start + interval; // Start of the next interval after the commit interval let current_block: u64 = Self::get_current_block_as_u64(); From 869eabb3a8da3566edc4530fb4cdc08be3a0732f Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 12 May 2024 10:19:00 -0700 Subject: [PATCH 36/39] add benchmarks for commit/reveal --- pallets/subtensor/src/benchmarks.rs | 89 +++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 1cec11514..bb37334a3 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -8,6 +8,8 @@ use frame_benchmarking::{account, benchmarks, whitelisted_caller}; use frame_support::assert_ok; use frame_system::RawOrigin; pub use pallet::*; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, Hash}; use sp_std::vec; benchmarks! { @@ -333,4 +335,91 @@ benchmarks! { assert_ok!(Subtensor::::add_stake(RawOrigin::Signed(coldkey).into(), old_hotkey.clone(), 1_000_000_000)); } }: _(RawOrigin::Signed(coldkey), old_hotkey, new_hotkey) + + commit_weights { + let tempo: u16 = 1; + let netuid: u16 = 1; + let version_key: u64 = 0; + let uids: Vec = vec![0]; + let weight_values: Vec = vec![10]; + let hotkey: T::AccountId = account("hot", 0, 1); + let coldkey: T::AccountId = account("cold", 0, 2); + let start_nonce = 300000; + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey.clone(), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + + Subtensor::::init_new_network(netuid, tempo); + + let block_number: u64 = Subtensor::::get_current_block_as_u64(); + let (nonce, work): (u64, Vec) = Subtensor::::create_work_for_block_number( + netuid, + block_number, + start_nonce, + &hotkey, + ); + let result = Subtensor::::register( + ::RuntimeOrigin::from(RawOrigin::Signed(hotkey.clone())), + netuid, + block_number, + nonce, + work, + hotkey.clone(), + coldkey, + ); + Subtensor::::set_validator_permit_for_uid(netuid, 0, true); + +}: commit_weights(RawOrigin::Signed(hotkey.clone()), netuid, commit_hash) + +reveal_weights { + let tempo: u16 = 0; + let netuid: u16 = 1; + let version_key: u64 = 0; + let uids: Vec = vec![0]; + let weight_values: Vec = vec![10]; + let hotkey: T::AccountId = account("hot", 0, 1); + let coldkey: T::AccountId = account("cold", 1, 2); + let hotkey2: T::AccountId = account("hot2", 2, 3); + let coldkey2: T::AccountId = account("cold2", 3, 4); + + Subtensor::::init_new_network(netuid, tempo); + Subtensor::::set_network_registration_allowed(netuid, true); + Subtensor::::set_network_pow_registration_allowed(netuid, true); + + let block_number: u64 = Subtensor::::get_current_block_as_u64(); + let (nonce, work): (u64, Vec) = Subtensor::::create_work_for_block_number( + netuid, + block_number, + 3, + &hotkey, + ); + + let _ = Subtensor::::register( + ::RuntimeOrigin::from(RawOrigin::Signed(hotkey.clone())), + netuid, + block_number, + nonce, + work.clone(), + hotkey.clone(), + coldkey.clone(), + ); + + Subtensor::::set_validator_permit_for_uid(netuid, 0, true); + Subtensor::::set_weight_commit_interval(0); + + let commit_hash: H256 = BlakeTwo256::hash_of(&( + hotkey.clone(), + netuid, + uids.clone(), + weight_values.clone(), + version_key, + )); + let _ = Subtensor::::commit_weights(::RuntimeOrigin::from(RawOrigin::Signed(hotkey.clone())), netuid, commit_hash); + + }: reveal_weights(RawOrigin::Signed(hotkey.clone()), netuid, uids, weight_values, version_key) } From da4d9b91c395235f827fb5ebad97cbb05b8b1286 Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 12 May 2024 10:45:47 -0700 Subject: [PATCH 37/39] fix warning --- pallets/subtensor/src/benchmarks.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index bb37334a3..b45eefde5 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -384,8 +384,6 @@ reveal_weights { let weight_values: Vec = vec![10]; let hotkey: T::AccountId = account("hot", 0, 1); let coldkey: T::AccountId = account("cold", 1, 2); - let hotkey2: T::AccountId = account("hot2", 2, 3); - let coldkey2: T::AccountId = account("cold2", 3, 4); Subtensor::::init_new_network(netuid, tempo); Subtensor::::set_network_registration_allowed(netuid, true); From 5e557b2e70c1e6860ce5fd0f8077f0b5e81adeae Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Mon, 13 May 2024 08:09:00 -0700 Subject: [PATCH 38/39] comments -> rust docs --- pallets/subtensor/src/lib.rs | 89 ++++++++++++++++---------------- pallets/subtensor/src/weights.rs | 88 +++++++++++++++---------------- 2 files changed, 88 insertions(+), 89 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e422dbe9b..6019169f3 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1218,23 +1218,22 @@ pub mod pallet { Self::do_set_weights(origin, netuid, dests, weights, version_key) } - // ---- Used to commit a hash of your wieght values to later be revealed. - // - // # Args: - // * 'origin': (RuntimeOrigin): - // - The signature of the committing hotkey. - // - // * 'netuid' (u16): - // - The u16 network identifier. - // - // * 'commit_hash' (H256): - // - The hash representing the committed weights. - // - // # Raises: - // * 'CommitNotAllowed': - // - Attempting to commit when it is not allowed. - // - // + /// ---- Used to commit a hash of your weight values to later be revealed. + /// + /// # Args: + /// * `origin`: (`::RuntimeOrigin`): + /// - The signature of the committing hotkey. + /// + /// * `netuid` (`u16`): + /// - The u16 network identifier. + /// + /// * `commit_hash` (`H256`): + /// - The hash representing the committed weights. + /// + /// # Raises: + /// * `CommitNotAllowed`: + /// - Attempting to commit when it is not allowed. + /// #[pallet::call_index(96)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) @@ -1247,34 +1246,34 @@ pub mod pallet { Self::do_commit_weights(origin, netuid, commit_hash) } - // ---- Used to reveal the weights for a previously commited hash. - // - // # Args: - // * 'origin': (RuntimeOrigin): - // - The signature of the revealing hotkey. - // - // * 'netuid' (u16): - // - The u16 network identifier. - // - // * 'uids' (Vec): - // - The uids for the weights being revealed. - // - // * 'values' (Vec): - // - The values of the weights being revealed. - // - // * 'version_key' (u64): - // - The network version key. - // - // # Raises: - // * 'NoCommitFound': - // - Attempting to reveal weights without an existing commit. - // - // * 'InvalidRevealTempo': - // - Attempting to reveal weights outside the valid tempo. - // - // * 'InvalidReveal': - // - The revealed hash does not match the committed hash. - // + /// ---- Used to reveal the weights for a previously committed hash. + /// + /// # Args: + /// * `origin`: (`::RuntimeOrigin`): + /// - The signature of the revealing hotkey. + /// + /// * `netuid` (`u16`): + /// - The u16 network identifier. + /// + /// * `uids` (`Vec`): + /// - The uids for the weights being revealed. + /// + /// * `values` (`Vec`): + /// - The values of the weights being revealed. + /// + /// * `version_key` (`u64`): + /// - The network version key. + /// + /// # Raises: + /// * `NoCommitFound`: + /// - Attempting to reveal weights without an existing commit. + /// + /// * `InvalidRevealTempo`: + /// - Attempting to reveal weights outside the valid tempo. + /// + /// * `InvalidReveal`: + /// - The revealed hash does not match the committed hash. + /// #[pallet::call_index(97)] #[pallet::weight((Weight::from_parts(10_151_000_000, 0) .saturating_add(T::DbWeight::get().reads(4104)) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index f229b0553..2e3ace77b 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -5,22 +5,22 @@ use sp_runtime::traits::{BlakeTwo256, Hash}; use sp_std::vec; impl Pallet { - // ---- The implementation for committing weight hashes. - // - // # Args: - // * 'origin': (RuntimeOrigin): - // - The signature of the committing hotkey. - // - // * 'netuid' (u16): - // - The u16 network identifier. - // - // * 'commit_hash' (H256): - // - The hash representing the committed weights. - // - // # Raises: - // * 'CommitNotAllowed': - // - Attempting to commit when it is not allowed. - // + /// ---- The implementation for committing weight hashes. + /// + /// # Args: + /// * `origin`: (`::RuntimeOrigin`): + /// - The signature of the committing hotkey. + /// + /// * `netuid` (`u16`): + /// - The u16 network identifier. + /// + /// * `commit_hash` (`H256`): + /// - The hash representing the committed weights. + /// + /// # Raises: + /// * `CommitNotAllowed`: + /// - Attempting to commit when it is not allowed. + /// pub fn do_commit_weights( origin: T::RuntimeOrigin, netuid: u16, @@ -40,34 +40,34 @@ impl Pallet { Ok(()) } - // ---- The implementation for revealing committed weights. - // - // # Args: - // * 'origin': (RuntimeOrigin): - // - The signature of the revealing hotkey. - // - // * 'netuid' (u16): - // - The u16 network identifier. - // - // * 'uids' (Vec): - // - The uids for the weights being revealed. - // - // * 'values' (Vec): - // - The values of the weights being revealed. - // - // * 'version_key' (u64): - // - The network version key. - // - // # Raises: - // * 'NoCommitFound': - // - Attempting to reveal weights without an existing commit. - // - // * 'InvalidRevealTempo': - // - Attempting to reveal weights outside the valid tempo. - // - // * 'InvalidReveal': - // - The revealed hash does not match the committed hash. - // + /// ---- The implementation for revealing committed weights. + /// + /// # Args: + /// * `origin`: (`::RuntimeOrigin`): + /// - The signature of the revealing hotkey. + /// + /// * `netuid` (`u16`): + /// - The u16 network identifier. + /// + /// * `uids` (`Vec`): + /// - The uids for the weights being revealed. + /// + /// * `values` (`Vec`): + /// - The values of the weights being revealed. + /// + /// * `version_key` (`u64`): + /// - The network version key. + /// + /// # Raises: + /// * `NoCommitFound`: + /// - Attempting to reveal weights without an existing commit. + /// + /// * `InvalidRevealTempo`: + /// - Attempting to reveal weights outside the valid tempo. + /// + /// * `InvalidReveal`: + /// - The revealed hash does not match the committed hash. + /// pub fn do_reveal_weights( origin: T::RuntimeOrigin, netuid: u16, From 22a9a66b99a989129098bb22b3ea656e46edf20f Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Mon, 13 May 2024 09:11:19 -0700 Subject: [PATCH 39/39] update weight values --- pallets/subtensor/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 6019169f3..c5be7a8a7 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1235,9 +1235,9 @@ pub mod pallet { /// - Attempting to commit when it is not allowed. /// #[pallet::call_index(96)] - #[pallet::weight((Weight::from_parts(10_151_000_000, 0) - .saturating_add(T::DbWeight::get().reads(4104)) - .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + #[pallet::weight((Weight::from_parts(46_000_000, 0) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Normal, Pays::No))] pub fn commit_weights( origin: T::RuntimeOrigin, netuid: u16, @@ -1275,9 +1275,9 @@ pub mod pallet { /// - The revealed hash does not match the committed hash. /// #[pallet::call_index(97)] - #[pallet::weight((Weight::from_parts(10_151_000_000, 0) - .saturating_add(T::DbWeight::get().reads(4104)) - .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] + #[pallet::weight((Weight::from_parts(103_000_000, 0) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(3)), DispatchClass::Normal, Pays::No))] pub fn reveal_weights( origin: T::RuntimeOrigin, netuid: u16,