From e6da38d5780e9b050cf4b48a1e3193a446df3a1b Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 4 Mar 2026 15:07:58 +0100 Subject: [PATCH 01/13] Add stake payable, combining add_stake + transfer. --- pallets/subtensor/src/benchmarks.rs | 38 +++++ pallets/subtensor/src/macros/dispatches.rs | 20 +++ pallets/subtensor/src/macros/events.rs | 9 ++ pallets/subtensor/src/staking/add_stake.rs | 21 +++ pallets/subtensor/src/staking/stake_utils.rs | 24 +++ pallets/subtensor/src/tests/staking.rs | 148 +++++++++++++++++++ 6 files changed, 260 insertions(+) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 846e80f4ff..6aa54ab4b5 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -193,6 +193,44 @@ mod pallet_benchmarks { ); } + #[benchmark] + fn add_stake_payable() { + let netuid = NetUid::from(1); + let tempo: u16 = 1; + + Subtensor::::init_new_network(netuid, tempo); + SubtokenEnabled::::insert(netuid, true); + Subtensor::::set_burn(netuid, benchmark_registration_burn()); + Subtensor::::set_network_registration_allowed(netuid, true); + Subtensor::::set_max_allowed_uids(netuid, 4096); + + let seed: u32 = 1; + let coldkey: T::AccountId = account("Test", 0, seed); + let app_coldkey: T::AccountId = account("cold", 0, seed); + let hotkey: T::AccountId = account("Alice", 0, seed); + let total_stake = TaoCurrency::from(1_000_000_000); + let amount = TaoCurrency::from(60_000_000); + let amount_fees = TaoCurrency::from(1000); + + seed_swap_reserves::(netuid); + Subtensor::::add_balance_to_coldkey_account(&coldkey, total_stake.into()); + assert_ok!(Subtensor::::do_burned_registration( + RawOrigin::Signed(coldkey.clone()).into(), + netuid, + hotkey.clone() + )); + + #[extrinsic_call] + _( + RawOrigin::Signed(coldkey.clone()), + hotkey.clone(), + netuid, + amount, + app_coldkey, + amount_fees, + ); + } + #[benchmark] fn serve_axon() { let netuid = NetUid::from(1); diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 4605b312c2..cec8268bba 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -2531,5 +2531,25 @@ mod dispatches { Self::deposit_event(Event::AutoParentDelegationEnabledSet { hotkey, enabled }); Ok(()) } + + /// --- The extrinsic is a combination of add_stake and fees token transfer + #[pallet::call_index(133)] + #[pallet::weight(( + Weight::from_parts(273_000_000, 2_500) + .saturating_add(T::DbWeight::get().reads(26_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)), + DispatchClass::Normal, + Pays::Yes + ))] + pub fn add_stake_payable( + origin: OriginFor, + hotkey: T::AccountId, + netuid: NetUid, + amount_staked: TaoCurrency, + coldkey_fees_tank: T::AccountId, + amount_fees: TaoCurrency + ) -> DispatchResult { + Self::do_add_stake_payable(origin, hotkey, netuid, amount_staked, coldkey_fees_tank, amount_fees).map(|_| ()) + } } } diff --git a/pallets/subtensor/src/macros/events.rs b/pallets/subtensor/src/macros/events.rs index fe1eecb2fc..7997f640ad 100644 --- a/pallets/subtensor/src/macros/events.rs +++ b/pallets/subtensor/src/macros/events.rs @@ -294,6 +294,15 @@ mod events { TaoBalance, ), + /// Fees for the stake has been transferred from actor cold key to the app coldkey. + /// Parameters: + /// (origin_coldkey, destination_coldkey, amount) + FeesTransferred( + T::AccountId, + T::AccountId, + TaoCurrency, + ), + /// Stake has been swapped from one subnet to another for the same coldkey-hotkey pair. /// /// Parameters: diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index b88e75cd31..1d6d21ee35 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -71,6 +71,27 @@ impl Pallet { ) } + pub fn do_add_stake_payable( + origin: T::RuntimeOrigin, + hotkey: T::AccountId, + netuid: NetUid, + stake_to_be_added: TaoCurrency, + coldkey_fees_tank: T::AccountId, + amount_fees: TaoCurrency + ) -> Result { + let coldkey = ensure_signed(origin.clone())?; + + ensure!( + Self::can_remove_balance_from_coldkey_account(&coldkey, stake_to_be_added.saturating_add(amount_fees).into()), + Error::::NotEnoughBalanceToStake + ); + + frame_support::storage::with_storage_layer(|| { + Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; + Self::do_add_stake(origin, hotkey, netuid, stake_to_be_added) + }) + } + /// ---- The implementation for the extrinsic add_stake_limit: Adds stake to a hotkey /// account on a subnet with price limit. /// diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index ba2c7164d5..727c0fc06b 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1,4 +1,7 @@ use super::*; +use frame_support::{ + traits::{fungible::*, tokens::Preservation}, +}; use safe_math::*; use share_pool::{SafeFloat, SharePool, SharePoolDataOperations}; use sp_std::{collections::btree_map::BTreeMap, ops::Neg}; @@ -1034,6 +1037,27 @@ impl Pallet { Ok(tao_equivalent) } + pub fn do_transfer_fees( + from: &::AccountId, + to: ::AccountId, + amount: TaoCurrency, + ) -> Result<(), Error> { + ::Currency::transfer( + &from, + &to, + amount.into(), + Preservation::Expendable, + ).map_err(|_| Error::::BalanceWithdrawalError)?; + + Self::deposit_event(Event::FeesTransferred( + from.clone(), + to.clone(), + amount, + )); + + Ok(()) + } + pub fn get_alpha_share_pool( hotkey: ::AccountId, netuid: NetUid, diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 0fe951a29b..4a444e00f1 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5298,6 +5298,154 @@ fn test_default_min_stake_sufficiency() { }); } +/// This test verifies if the stake + pay fees is working +/// +/// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_is_ok --exact --show-output +#[test] +fn test_add_stake_payable_is_ok() { + new_test_ext(1).execute_with(|| { + let subnet_owner_hotkey = U256::from(1); + let subnet_owner_coldkey = U256::from(2); + let actor_coldkey = U256::from(4); + let app_coldkey = U256::from(5); + let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; + let amount_stake = min_tao_stake; + let amount_fees = 100_000; + let owner_balance_before = amount_stake * 10; + let actor_balance_before = amount_stake * 100; + let app_owner_balance_before = ExistentialDeposit::get(); + + // add network + let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); + SubtensorModule::add_balance_to_coldkey_account(&subnet_owner_coldkey, owner_balance_before); + SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); + SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); + + // Stake with paying fees + assert_ok!(SubtensorModule::add_stake_payable( + RuntimeOrigin::signed(actor_coldkey), + subnet_owner_hotkey, + netuid, + amount_stake.into(), + app_coldkey, + amount_fees.into() + )); + + let app_owner_balance_after = Balances::free_balance(app_coldkey); + let actor_balance_after = Balances::free_balance(actor_coldkey); + + assert_eq!(app_owner_balance_before + amount_fees, app_owner_balance_after, "app owner balance after should include fees"); + assert_eq!(actor_balance_before - amount_fees - amount_stake, actor_balance_after, "actor balance after be decreased by stake + fees"); + + let events = System::events(); + + assert!( + events.iter().any(|e| matches!( + &e.event, + RuntimeEvent::SubtensorModule(Event::FeesTransferred(from, to, amount)) + if from == &actor_coldkey + && to == &app_coldkey + && *amount == amount_fees.into() + )), + "FeesTransferred event should be emitted" + ); + + assert!( + events.iter().any(|e| matches!( + &e.event, + RuntimeEvent::SubtensorModule(Event::StakeAdded(coldkey, hotkey, ..)) + if coldkey == &actor_coldkey + && hotkey == &subnet_owner_hotkey + )), + "StakeAdded event should be emitted" + ); + }); +} + +/// This test verifies if the stake + pay fees is working +/// +/// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_actor_insufficient_balance --exact --show-output +#[test] +fn test_add_stake_payable_actor_insufficient_balance() { + new_test_ext(1).execute_with(|| { + let subnet_owner_hotkey = U256::from(1); + let subnet_owner_coldkey = U256::from(2); + let actor_coldkey = U256::from(4); + let app_coldkey = U256::from(5); + let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; + let amount_stake = min_tao_stake; + let amount_fees = 100_000; + let owner_balance_before = amount_stake * 10; + let actor_balance_before = amount_stake; // The actor doesn't have funds for fees + let app_owner_balance_before = ExistentialDeposit::get(); + + // add network + let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); + SubtensorModule::add_balance_to_coldkey_account(&subnet_owner_coldkey, owner_balance_before); + SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); + SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); + + // Should fail because of insufficient balance to pay for fees + assert_err!( + SubtensorModule::add_stake_payable( + RuntimeOrigin::signed(actor_coldkey), + subnet_owner_hotkey, + netuid, + amount_stake.into(), + app_coldkey, + amount_fees.into() + ), + Error::::NotEnoughBalanceToStake + ); + }); +} + +/// This test verifies that fees are rolled back if staking fails (atomicity) +/// +/// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_atomicity --exact --show-output +#[test] +fn test_add_stake_payable_atomicity() { + new_test_ext(1).execute_with(|| { + let subnet_owner_hotkey = U256::from(1); + let actor_coldkey = U256::from(4); + let app_coldkey = U256::from(5); + let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; + let amount_stake = min_tao_stake; + let amount_fees = 100_000; + let actor_balance_before = amount_stake * 100; + let app_owner_balance_before = ExistentialDeposit::get(); + + let invalid_netuid = NetUid::from(99); + + SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); + SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); + + // add_stake should fail because of invalid netuid + assert_err!( + SubtensorModule::add_stake_payable( + RuntimeOrigin::signed(actor_coldkey), + subnet_owner_hotkey, + invalid_netuid, + amount_stake.into(), + app_coldkey, + amount_fees.into() + ), + Error::::SubnetNotExists + ); + + assert_eq!( + Balances::free_balance(app_coldkey), + app_owner_balance_before, + "fees should be rolled back if staking fails" + ); + assert_eq!( + Balances::free_balance(actor_coldkey), + actor_balance_before, + "actor balance should be unchanged if staking fails" + ); + }); +} + #[test] fn test_stake_rate_limits() { new_test_ext(0).execute_with(|| { From 37bdeeb929dfa874f888be348cfcc127b48972f5 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 16:34:40 +0200 Subject: [PATCH 02/13] - Added add_stake_payable --- pallets/subtensor/src/benchmarks.rs | 6 +-- pallets/subtensor/src/macros/dispatches.rs | 6 +-- pallets/subtensor/src/macros/events.rs | 2 +- pallets/subtensor/src/staking/add_stake.rs | 14 +++--- pallets/subtensor/src/staking/stake_utils.rs | 2 +- pallets/subtensor/src/tests/staking.rs | 46 -------------------- 6 files changed, 14 insertions(+), 62 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 6aa54ab4b5..2765062cc8 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -208,9 +208,9 @@ mod pallet_benchmarks { let coldkey: T::AccountId = account("Test", 0, seed); let app_coldkey: T::AccountId = account("cold", 0, seed); let hotkey: T::AccountId = account("Alice", 0, seed); - let total_stake = TaoCurrency::from(1_000_000_000); - let amount = TaoCurrency::from(60_000_000); - let amount_fees = TaoCurrency::from(1000); + let total_stake = TaoBalance::from(1_000_000_000); + let amount = TaoBalance::from(60_000_000); + let amount_fees = TaoBalance::from(1000); seed_swap_reserves::(netuid); Subtensor::::add_balance_to_coldkey_account(&coldkey, total_stake.into()); diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index cec8268bba..7a62a84687 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -2533,7 +2533,7 @@ mod dispatches { } /// --- The extrinsic is a combination of add_stake and fees token transfer - #[pallet::call_index(133)] + #[pallet::call_index(136)] #[pallet::weight(( Weight::from_parts(273_000_000, 2_500) .saturating_add(T::DbWeight::get().reads(26_u64)) @@ -2545,9 +2545,9 @@ mod dispatches { origin: OriginFor, hotkey: T::AccountId, netuid: NetUid, - amount_staked: TaoCurrency, + amount_staked: TaoBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoCurrency + amount_fees: TaoBalance ) -> DispatchResult { Self::do_add_stake_payable(origin, hotkey, netuid, amount_staked, coldkey_fees_tank, amount_fees).map(|_| ()) } diff --git a/pallets/subtensor/src/macros/events.rs b/pallets/subtensor/src/macros/events.rs index 7997f640ad..5191efdcc6 100644 --- a/pallets/subtensor/src/macros/events.rs +++ b/pallets/subtensor/src/macros/events.rs @@ -300,7 +300,7 @@ mod events { FeesTransferred( T::AccountId, T::AccountId, - TaoCurrency, + TaoBalance, ), /// Stake has been swapped from one subnet to another for the same coldkey-hotkey pair. diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index 1d6d21ee35..deab0c3f19 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -72,13 +72,13 @@ impl Pallet { } pub fn do_add_stake_payable( - origin: T::RuntimeOrigin, + origin: OriginFor, hotkey: T::AccountId, netuid: NetUid, - stake_to_be_added: TaoCurrency, + stake_to_be_added: TaoBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoCurrency - ) -> Result { + amount_fees: TaoBalance + ) -> Result { let coldkey = ensure_signed(origin.clone())?; ensure!( @@ -86,10 +86,8 @@ impl Pallet { Error::::NotEnoughBalanceToStake ); - frame_support::storage::with_storage_layer(|| { - Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; - Self::do_add_stake(origin, hotkey, netuid, stake_to_be_added) - }) + Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; + Self::do_add_stake(origin, hotkey, netuid, stake_to_be_added) } /// ---- The implementation for the extrinsic add_stake_limit: Adds stake to a hotkey diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 727c0fc06b..550460e6a5 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1040,7 +1040,7 @@ impl Pallet { pub fn do_transfer_fees( from: &::AccountId, to: ::AccountId, - amount: TaoCurrency, + amount: TaoBalance, ) -> Result<(), Error> { ::Currency::transfer( &from, diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 4a444e00f1..cd983849d5 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5400,52 +5400,6 @@ fn test_add_stake_payable_actor_insufficient_balance() { }); } -/// This test verifies that fees are rolled back if staking fails (atomicity) -/// -/// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_atomicity --exact --show-output -#[test] -fn test_add_stake_payable_atomicity() { - new_test_ext(1).execute_with(|| { - let subnet_owner_hotkey = U256::from(1); - let actor_coldkey = U256::from(4); - let app_coldkey = U256::from(5); - let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; - let amount_stake = min_tao_stake; - let amount_fees = 100_000; - let actor_balance_before = amount_stake * 100; - let app_owner_balance_before = ExistentialDeposit::get(); - - let invalid_netuid = NetUid::from(99); - - SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); - SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); - - // add_stake should fail because of invalid netuid - assert_err!( - SubtensorModule::add_stake_payable( - RuntimeOrigin::signed(actor_coldkey), - subnet_owner_hotkey, - invalid_netuid, - amount_stake.into(), - app_coldkey, - amount_fees.into() - ), - Error::::SubnetNotExists - ); - - assert_eq!( - Balances::free_balance(app_coldkey), - app_owner_balance_before, - "fees should be rolled back if staking fails" - ); - assert_eq!( - Balances::free_balance(actor_coldkey), - actor_balance_before, - "actor balance should be unchanged if staking fails" - ); - }); -} - #[test] fn test_stake_rate_limits() { new_test_ext(0).execute_with(|| { From fd8c08a51ad1cf1a025273fd3a8817b5a2b85775 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Fri, 6 Mar 2026 15:10:20 +0100 Subject: [PATCH 03/13] - Added `remove_stake_payable` --- pallets/subtensor/src/benchmarks.rs | 61 +++++++++++++++++++ pallets/subtensor/src/macros/dispatches.rs | 24 ++++++++ pallets/subtensor/src/staking/add_stake.rs | 5 +- pallets/subtensor/src/staking/remove_stake.rs | 16 +++++ pallets/subtensor/src/staking/stake_utils.rs | 20 ++---- pallets/subtensor/src/tests/staking.rs | 36 +++++++---- 6 files changed, 135 insertions(+), 27 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 2765062cc8..7192a0577b 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -1077,6 +1077,67 @@ mod pallet_benchmarks { ); } + #[benchmark] + fn remove_stake_payable() { + let netuid = NetUid::from(1); + let tempo: u16 = 1; + let seed: u32 = 1; + + // Set our total stake to 1000 TAO + Subtensor::::increase_total_stake(1_000_000_000_000.into()); + + Subtensor::::init_new_network(netuid, tempo); + Subtensor::::set_network_registration_allowed(netuid, true); + SubtokenEnabled::::insert(netuid, true); + + Subtensor::::set_max_allowed_uids(netuid, 4096); + assert_eq!(Subtensor::::get_max_allowed_uids(netuid), 4096); + + let coldkey: T::AccountId = account("Test", 0, seed); + let hotkey: T::AccountId = account("Alice", 0, seed); + Subtensor::::set_burn(netuid, benchmark_registration_burn()); + + let app_coldkey: T::AccountId = account("cold", 0, seed); + let amount_fees = TaoCurrency::from(1000); + let tao_reserve = TaoCurrency::from(150_000_000_000); + let alpha_in = AlphaCurrency::from(100_000_000_000); + set_reserves::(netuid, tao_reserve, alpha_in); + + let wallet_bal = 1000_000_000_000u64.into(); + Subtensor::::add_balance_to_coldkey_account(&coldkey.clone(), wallet_bal); + + assert_ok!(Subtensor::::do_burned_registration( + RawOrigin::Signed(coldkey.clone()).into(), + netuid, + hotkey.clone() + )); + + let u64_staked_amt = 1000_000_000_000u64; + Subtensor::::add_balance_to_coldkey_account(&coldkey.clone(), u64_staked_amt); + + assert_ok!(Subtensor::::add_stake( + RawOrigin::Signed(coldkey.clone()).into(), + hotkey.clone(), + netuid, + u64_staked_amt.into() + )); + + let amount_unstaked = AlphaCurrency::from(30_000_000_000); + + // Remove stake limit for benchmark + StakingOperationRateLimiter::::remove((hotkey.clone(), coldkey.clone(), netuid)); + + #[extrinsic_call] + _( + RawOrigin::Signed(coldkey.clone()), + hotkey.clone(), + netuid, + amount_unstaked, + app_coldkey, + amount_fees, + ); + } + #[benchmark] fn swap_stake_limit() { let coldkey: T::AccountId = whitelisted_caller::>(); diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 7a62a84687..681901ba63 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -746,6 +746,30 @@ mod dispatches { Self::do_remove_stake(origin, hotkey, netuid, amount_unstaked) } + /// --- The extrinsic is a combination of remove_stake and fees token transfer + #[pallet::call_index(137)] + #[pallet::weight((Weight::from_parts(252_000_000, 2289) + .saturating_add(T::DbWeight::get().reads(30)) + .saturating_add(T::DbWeight::get().writes(15)), DispatchClass::Normal, Pays::Yes))] + pub fn remove_stake_payable( + origin: OriginFor, + hotkey: T::AccountId, + netuid: NetUid, + amount_unstaked: AlphaCurrency, + coldkey_fees_tank: T::AccountId, + amount_fees: TaoCurrency, + ) -> DispatchResult { + Self::do_remove_stake_payable( + origin, + hotkey, + netuid, + amount_unstaked, + coldkey_fees_tank, + amount_fees, + ) + .map(|_| ()) + } + /// Serves or updates axon /prometheus information for the neuron associated with the caller. If the caller is /// already registered the metadata is updated. If the caller is not registered this call throws NotRegistered. /// diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index deab0c3f19..bb0210119b 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -82,7 +82,10 @@ impl Pallet { let coldkey = ensure_signed(origin.clone())?; ensure!( - Self::can_remove_balance_from_coldkey_account(&coldkey, stake_to_be_added.saturating_add(amount_fees).into()), + Self::can_remove_balance_from_coldkey_account( + &coldkey, + stake_to_be_added.saturating_add(amount_fees).into() + ), Error::::NotEnoughBalanceToStake ); diff --git a/pallets/subtensor/src/staking/remove_stake.rs b/pallets/subtensor/src/staking/remove_stake.rs index e7fad11001..544573aa7c 100644 --- a/pallets/subtensor/src/staking/remove_stake.rs +++ b/pallets/subtensor/src/staking/remove_stake.rs @@ -612,4 +612,20 @@ impl Pallet { Ok(()) } + + pub fn do_remove_stake_payable( + origin: T::RuntimeOrigin, + hotkey: T::AccountId, + netuid: NetUid, + amount_unstaked: AlphaCurrency, + coldkey_fees_tank: T::AccountId, + amount_fees: TaoCurrency, + ) -> dispatch::DispatchResult { + let coldkey = ensure_signed(origin.clone())?; + + frame_support::storage::with_storage_layer(|| { + Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; + Self::do_remove_stake(origin, hotkey, netuid, amount_unstaked) + }) + } } diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 550460e6a5..cde699b49a 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1,7 +1,5 @@ use super::*; -use frame_support::{ - traits::{fungible::*, tokens::Preservation}, -}; +use frame_support::traits::{fungible::*, tokens::Preservation}; use safe_math::*; use share_pool::{SafeFloat, SharePool, SharePoolDataOperations}; use sp_std::{collections::btree_map::BTreeMap, ops::Neg}; @@ -1042,18 +1040,10 @@ impl Pallet { to: ::AccountId, amount: TaoBalance, ) -> Result<(), Error> { - ::Currency::transfer( - &from, - &to, - amount.into(), - Preservation::Expendable, - ).map_err(|_| Error::::BalanceWithdrawalError)?; - - Self::deposit_event(Event::FeesTransferred( - from.clone(), - to.clone(), - amount, - )); + ::Currency::transfer(&from, &to, amount.into(), Preservation::Expendable) + .map_err(|_| Error::::BalanceWithdrawalError)?; + + Self::deposit_event(Event::FeesTransferred(from.clone(), to.clone(), amount)); Ok(()) } diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index cd983849d5..14037148be 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5317,7 +5317,10 @@ fn test_add_stake_payable_is_ok() { // add network let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - SubtensorModule::add_balance_to_coldkey_account(&subnet_owner_coldkey, owner_balance_before); + SubtensorModule::add_balance_to_coldkey_account( + &subnet_owner_coldkey, + owner_balance_before, + ); SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); @@ -5334,8 +5337,16 @@ fn test_add_stake_payable_is_ok() { let app_owner_balance_after = Balances::free_balance(app_coldkey); let actor_balance_after = Balances::free_balance(actor_coldkey); - assert_eq!(app_owner_balance_before + amount_fees, app_owner_balance_after, "app owner balance after should include fees"); - assert_eq!(actor_balance_before - amount_fees - amount_stake, actor_balance_after, "actor balance after be decreased by stake + fees"); + assert_eq!( + app_owner_balance_before + amount_fees, + app_owner_balance_after, + "app owner balance after should include fees" + ); + assert_eq!( + actor_balance_before - amount_fees - amount_stake, + actor_balance_after, + "actor balance after be decreased by stake + fees" + ); let events = System::events(); @@ -5381,20 +5392,23 @@ fn test_add_stake_payable_actor_insufficient_balance() { // add network let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - SubtensorModule::add_balance_to_coldkey_account(&subnet_owner_coldkey, owner_balance_before); + SubtensorModule::add_balance_to_coldkey_account( + &subnet_owner_coldkey, + owner_balance_before, + ); SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); // Should fail because of insufficient balance to pay for fees assert_err!( SubtensorModule::add_stake_payable( - RuntimeOrigin::signed(actor_coldkey), - subnet_owner_hotkey, - netuid, - amount_stake.into(), - app_coldkey, - amount_fees.into() - ), + RuntimeOrigin::signed(actor_coldkey), + subnet_owner_hotkey, + netuid, + amount_stake.into(), + app_coldkey, + amount_fees.into() + ), Error::::NotEnoughBalanceToStake ); }); From b810db8aac0f2f96666f11f336a8d1658a897526 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 16:40:27 +0200 Subject: [PATCH 04/13] - Added remove_stake_payable --- pallets/subtensor/src/macros/dispatches.rs | 4 ++-- pallets/subtensor/src/staking/remove_stake.rs | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 681901ba63..bc342d343a 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -755,9 +755,9 @@ mod dispatches { origin: OriginFor, hotkey: T::AccountId, netuid: NetUid, - amount_unstaked: AlphaCurrency, + amount_unstaked: AlphaBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoCurrency, + amount_fees: TaoBalance, ) -> DispatchResult { Self::do_remove_stake_payable( origin, diff --git a/pallets/subtensor/src/staking/remove_stake.rs b/pallets/subtensor/src/staking/remove_stake.rs index 544573aa7c..d4a800f3b7 100644 --- a/pallets/subtensor/src/staking/remove_stake.rs +++ b/pallets/subtensor/src/staking/remove_stake.rs @@ -614,18 +614,16 @@ impl Pallet { } pub fn do_remove_stake_payable( - origin: T::RuntimeOrigin, + origin: OriginFor, hotkey: T::AccountId, netuid: NetUid, - amount_unstaked: AlphaCurrency, + amount_unstaked: AlphaBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoCurrency, + amount_fees: TaoBalance, ) -> dispatch::DispatchResult { let coldkey = ensure_signed(origin.clone())?; - frame_support::storage::with_storage_layer(|| { - Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; - Self::do_remove_stake(origin, hotkey, netuid, amount_unstaked) - }) + Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; + Self::do_remove_stake(origin, hotkey, netuid, amount_unstaked) } } From 4df66c554586426877f1fddea7b1c65fbd5defde Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 16:42:48 +0200 Subject: [PATCH 05/13] - fmt --- pallets/subtensor/src/macros/dispatches.rs | 12 ++++++++++-- pallets/subtensor/src/macros/events.rs | 6 +----- pallets/subtensor/src/staking/add_stake.rs | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index bc342d343a..0fed5fd0f0 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -2571,9 +2571,17 @@ mod dispatches { netuid: NetUid, amount_staked: TaoBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoBalance + amount_fees: TaoBalance, ) -> DispatchResult { - Self::do_add_stake_payable(origin, hotkey, netuid, amount_staked, coldkey_fees_tank, amount_fees).map(|_| ()) + Self::do_add_stake_payable( + origin, + hotkey, + netuid, + amount_staked, + coldkey_fees_tank, + amount_fees, + ) + .map(|_| ()) } } } diff --git a/pallets/subtensor/src/macros/events.rs b/pallets/subtensor/src/macros/events.rs index 5191efdcc6..1c558399e7 100644 --- a/pallets/subtensor/src/macros/events.rs +++ b/pallets/subtensor/src/macros/events.rs @@ -297,11 +297,7 @@ mod events { /// Fees for the stake has been transferred from actor cold key to the app coldkey. /// Parameters: /// (origin_coldkey, destination_coldkey, amount) - FeesTransferred( - T::AccountId, - T::AccountId, - TaoBalance, - ), + FeesTransferred(T::AccountId, T::AccountId, TaoBalance), /// Stake has been swapped from one subnet to another for the same coldkey-hotkey pair. /// diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index bb0210119b..0f859534b2 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -77,7 +77,7 @@ impl Pallet { netuid: NetUid, stake_to_be_added: TaoBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoBalance + amount_fees: TaoBalance, ) -> Result { let coldkey = ensure_signed(origin.clone())?; From 56753caa960e549ddee7b12563d91b8ea701ac5d Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 17:01:12 +0200 Subject: [PATCH 06/13] - clippy --- pallets/subtensor/src/staking/stake_utils.rs | 2 +- pallets/subtensor/src/tests/staking.rs | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index cde699b49a..0ad553ada4 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1040,7 +1040,7 @@ impl Pallet { to: ::AccountId, amount: TaoBalance, ) -> Result<(), Error> { - ::Currency::transfer(&from, &to, amount.into(), Preservation::Expendable) + ::Currency::transfer(from, &to, amount.into(), Preservation::Expendable) .map_err(|_| Error::::BalanceWithdrawalError)?; Self::deposit_event(Event::FeesTransferred(from.clone(), to.clone(), amount)); diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 14037148be..521b7f744e 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5309,20 +5309,20 @@ fn test_add_stake_payable_is_ok() { let actor_coldkey = U256::from(4); let app_coldkey = U256::from(5); let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; - let amount_stake = min_tao_stake; + let amount_stake = TaoBalance::from(min_tao_stake); let amount_fees = 100_000; - let owner_balance_before = amount_stake * 10; - let actor_balance_before = amount_stake * 100; + let owner_balance_before = amount_stake * 10.into(); + let actor_balance_before = amount_stake * 100.into(); let app_owner_balance_before = ExistentialDeposit::get(); // add network let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - SubtensorModule::add_balance_to_coldkey_account( + add_balance_to_coldkey_account( &subnet_owner_coldkey, owner_balance_before, ); - SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); - SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); + add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); + add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); // Stake with paying fees assert_ok!(SubtensorModule::add_stake_payable( @@ -5338,12 +5338,12 @@ fn test_add_stake_payable_is_ok() { let actor_balance_after = Balances::free_balance(actor_coldkey); assert_eq!( - app_owner_balance_before + amount_fees, + app_owner_balance_before + amount_fees.into(), app_owner_balance_after, "app owner balance after should include fees" ); assert_eq!( - actor_balance_before - amount_fees - amount_stake, + actor_balance_before - amount_fees.into() - amount_stake.into(), actor_balance_after, "actor balance after be decreased by stake + fees" ); @@ -5384,20 +5384,20 @@ fn test_add_stake_payable_actor_insufficient_balance() { let actor_coldkey = U256::from(4); let app_coldkey = U256::from(5); let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; - let amount_stake = min_tao_stake; + let amount_stake = TaoBalance::from(min_tao_stake); let amount_fees = 100_000; - let owner_balance_before = amount_stake * 10; + let owner_balance_before = amount_stake * 10.into(); let actor_balance_before = amount_stake; // The actor doesn't have funds for fees let app_owner_balance_before = ExistentialDeposit::get(); // add network let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - SubtensorModule::add_balance_to_coldkey_account( + add_balance_to_coldkey_account( &subnet_owner_coldkey, owner_balance_before, ); - SubtensorModule::add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); - SubtensorModule::add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); + add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); + add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); // Should fail because of insufficient balance to pay for fees assert_err!( From 5c0f18f472f7629ebcee1076c926891a7c6636ca Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 17:01:29 +0200 Subject: [PATCH 07/13] - fmt --- pallets/subtensor/src/tests/staking.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 521b7f744e..75d164daaf 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5317,10 +5317,7 @@ fn test_add_stake_payable_is_ok() { // add network let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - add_balance_to_coldkey_account( - &subnet_owner_coldkey, - owner_balance_before, - ); + add_balance_to_coldkey_account(&subnet_owner_coldkey, owner_balance_before); add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); @@ -5392,10 +5389,7 @@ fn test_add_stake_payable_actor_insufficient_balance() { // add network let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - add_balance_to_coldkey_account( - &subnet_owner_coldkey, - owner_balance_before, - ); + add_balance_to_coldkey_account(&subnet_owner_coldkey, owner_balance_before); add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); From 50d6c51926cab8f99b976958786d6493c9d6b267 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 17:57:18 +0200 Subject: [PATCH 08/13] - Added benchmark weights --- pallets/subtensor/src/benchmarks.rs | 22 +- pallets/subtensor/src/macros/dispatches.rs | 12 +- pallets/subtensor/src/staking/stake_utils.rs | 7 +- pallets/subtensor/src/tests/staking.rs | 46 ++++ pallets/subtensor/src/weights.rs | 246 +++++++++++++++++++ 5 files changed, 307 insertions(+), 26 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 7192a0577b..0a71a21585 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -213,8 +213,8 @@ mod pallet_benchmarks { let amount_fees = TaoBalance::from(1000); seed_swap_reserves::(netuid); - Subtensor::::add_balance_to_coldkey_account(&coldkey, total_stake.into()); - assert_ok!(Subtensor::::do_burned_registration( + add_balance_to_coldkey_account::(&coldkey, total_stake.into()); + assert_ok!(Subtensor::::burned_register( RawOrigin::Signed(coldkey.clone()).into(), netuid, hotkey.clone() @@ -1084,7 +1084,7 @@ mod pallet_benchmarks { let seed: u32 = 1; // Set our total stake to 1000 TAO - Subtensor::::increase_total_stake(1_000_000_000_000.into()); + Subtensor::::increase_total_stake(1_000_000_000_000_u64.into()); Subtensor::::init_new_network(netuid, tempo); Subtensor::::set_network_registration_allowed(netuid, true); @@ -1098,22 +1098,22 @@ mod pallet_benchmarks { Subtensor::::set_burn(netuid, benchmark_registration_burn()); let app_coldkey: T::AccountId = account("cold", 0, seed); - let amount_fees = TaoCurrency::from(1000); - let tao_reserve = TaoCurrency::from(150_000_000_000); - let alpha_in = AlphaCurrency::from(100_000_000_000); + let amount_fees = TaoBalance::from(1000); + let tao_reserve = TaoBalance::from(150_000_000_000_u64); + let alpha_in = AlphaBalance::from(100_000_000_000_u64); set_reserves::(netuid, tao_reserve, alpha_in); let wallet_bal = 1000_000_000_000u64.into(); - Subtensor::::add_balance_to_coldkey_account(&coldkey.clone(), wallet_bal); + add_balance_to_coldkey_account::(&coldkey.clone(), wallet_bal); - assert_ok!(Subtensor::::do_burned_registration( + assert_ok!(Subtensor::::burned_register( RawOrigin::Signed(coldkey.clone()).into(), netuid, hotkey.clone() )); - let u64_staked_amt = 1000_000_000_000u64; - Subtensor::::add_balance_to_coldkey_account(&coldkey.clone(), u64_staked_amt); + let u64_staked_amt = TaoBalance::from(1000_000_000_000u64); + add_balance_to_coldkey_account::(&coldkey.clone(), u64_staked_amt); assert_ok!(Subtensor::::add_stake( RawOrigin::Signed(coldkey.clone()).into(), @@ -1122,7 +1122,7 @@ mod pallet_benchmarks { u64_staked_amt.into() )); - let amount_unstaked = AlphaCurrency::from(30_000_000_000); + let amount_unstaked = AlphaBalance::from(30_000_000_000_u64); // Remove stake limit for benchmark StakingOperationRateLimiter::::remove((hotkey.clone(), coldkey.clone(), netuid)); diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 0fed5fd0f0..f3ab422055 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -748,9 +748,7 @@ mod dispatches { /// --- The extrinsic is a combination of remove_stake and fees token transfer #[pallet::call_index(137)] - #[pallet::weight((Weight::from_parts(252_000_000, 2289) - .saturating_add(T::DbWeight::get().reads(30)) - .saturating_add(T::DbWeight::get().writes(15)), DispatchClass::Normal, Pays::Yes))] + #[pallet::weight(::WeightInfo::remove_stake_payable())] pub fn remove_stake_payable( origin: OriginFor, hotkey: T::AccountId, @@ -2558,13 +2556,7 @@ mod dispatches { /// --- The extrinsic is a combination of add_stake and fees token transfer #[pallet::call_index(136)] - #[pallet::weight(( - Weight::from_parts(273_000_000, 2_500) - .saturating_add(T::DbWeight::get().reads(26_u64)) - .saturating_add(T::DbWeight::get().writes(17_u64)), - DispatchClass::Normal, - Pays::Yes - ))] + #[pallet::weight(::WeightInfo::add_stake_payable())] pub fn add_stake_payable( origin: OriginFor, hotkey: T::AccountId, diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 0ad553ada4..b5f4bf6822 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1,5 +1,4 @@ use super::*; -use frame_support::traits::{fungible::*, tokens::Preservation}; use safe_math::*; use share_pool::{SafeFloat, SharePool, SharePoolDataOperations}; use sp_std::{collections::btree_map::BTreeMap, ops::Neg}; @@ -1039,10 +1038,8 @@ impl Pallet { from: &::AccountId, to: ::AccountId, amount: TaoBalance, - ) -> Result<(), Error> { - ::Currency::transfer(from, &to, amount.into(), Preservation::Expendable) - .map_err(|_| Error::::BalanceWithdrawalError)?; - + ) -> Result<(), DispatchError> { + Self::transfer_tao(from, &to, amount)?; Self::deposit_event(Event::FeesTransferred(from.clone(), to.clone(), amount)); Ok(()) diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 75d164daaf..0174d3e51a 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5370,6 +5370,52 @@ fn test_add_stake_payable_is_ok() { }); } +/// This test verifies that fees are rolled back if staking fails (atomicity) +/// +/// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_atomicity --exact --show-output +#[test] +fn test_add_stake_payable_atomicity() { + new_test_ext(1).execute_with(|| { + let subnet_owner_hotkey = U256::from(1); + let actor_coldkey = U256::from(4); + let app_coldkey = U256::from(5); + let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; + let amount_stake = TaoBalance::from(min_tao_stake); + let amount_fees = 100_000; + let actor_balance_before = amount_stake * 100.into(); + let app_owner_balance_before = ExistentialDeposit::get(); + + let invalid_netuid = NetUid::from(99); + + add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); + add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); + + // add_stake should fail because of invalid netuid + assert_err!( + SubtensorModule::add_stake_payable( + RuntimeOrigin::signed(actor_coldkey), + subnet_owner_hotkey, + invalid_netuid, + amount_stake.into(), + app_coldkey, + amount_fees.into() + ), + Error::::SubnetNotExists + ); + + assert_eq!( + Balances::free_balance(app_coldkey), + app_owner_balance_before, + "fees should be rolled back if staking fails" + ); + assert_eq!( + Balances::free_balance(actor_coldkey), + actor_balance_before, + "actor balance should be unchanged if staking fails" + ); + }); +} + /// This test verifies if the stake + pay fees is working /// /// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_actor_insufficient_balance --exact --show-output diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 163f51881f..f90834bbc5 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -90,6 +90,8 @@ pub trait WeightInfo { fn set_auto_parent_delegation_enabled() -> Weight; fn add_stake_burn() -> Weight; fn set_pending_childkey_cooldown() -> Weight; + fn add_stake_payable() -> Weight; + fn remove_stake_payable() -> Weight; } /// Weights for `pallet_subtensor` using the Substrate node and recommended hardware. @@ -2247,6 +2249,128 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(2_956_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2280` + // Estimated: `11306` + // Minimum execution time: 277_000_000 picoseconds. + Weight::from_parts(278_000_000, 11306) + .saturating_add(T::DbWeight::get().reads(29_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) + } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 264_000_000 picoseconds. + Weight::from_parts(279_000_000, 10703) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) + } } // For backwards compatibility and tests. @@ -4403,4 +4527,126 @@ impl WeightInfo for () { Weight::from_parts(2_956_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2280` + // Estimated: `11306` + // Minimum execution time: 277_000_000 picoseconds. + Weight::from_parts(278_000_000, 11306) + .saturating_add(RocksDbWeight::get().reads(29_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) + } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 264_000_000 picoseconds. + Weight::from_parts(279_000_000, 10703) + .saturating_add(RocksDbWeight::get().reads(33_u64)) + .saturating_add(RocksDbWeight::get().writes(15_u64)) + } } From 291b7fd1d6ffdafea00a9a456a30bc3e3d574ab2 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 29 Apr 2026 18:09:29 +0200 Subject: [PATCH 09/13] clippy --- pallets/subtensor/src/benchmarks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 0a71a21585..6fff059864 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -1103,7 +1103,7 @@ mod pallet_benchmarks { let alpha_in = AlphaBalance::from(100_000_000_000_u64); set_reserves::(netuid, tao_reserve, alpha_in); - let wallet_bal = 1000_000_000_000u64.into(); + let wallet_bal = 1_000_000_000_000u64.into(); add_balance_to_coldkey_account::(&coldkey.clone(), wallet_bal); assert_ok!(Subtensor::::burned_register( @@ -1112,7 +1112,7 @@ mod pallet_benchmarks { hotkey.clone() )); - let u64_staked_amt = TaoBalance::from(1000_000_000_000u64); + let u64_staked_amt = TaoBalance::from(1_000_000_000_000u64); add_balance_to_coldkey_account::(&coldkey.clone(), u64_staked_amt); assert_ok!(Subtensor::::add_stake( From 11ab0134673df8732e29bd28743e7f9ef1faa5e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 29 Apr 2026 21:06:36 +0000 Subject: [PATCH 10/13] auto-update benchmark weights --- pallets/proxy/src/weights.rs | 222 +++--- pallets/subtensor/src/weights.rs | 1160 +++++++++++++++--------------- pallets/utility/src/weights.rs | 86 +-- 3 files changed, 724 insertions(+), 744 deletions(-) diff --git a/pallets/proxy/src/weights.rs b/pallets/proxy/src/weights.rs index 47a25c45f5..b88611783c 100644 --- a/pallets/proxy/src/weights.rs +++ b/pallets/proxy/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_subtensor_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-04-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-04-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 7763 64-Core Processor` +//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 9V74 80-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.08ToYZtPAe +// --output=/tmp/tmp.0G0ZV9fFkj // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -66,10 +66,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `637 + p * (37 ±0)` // Estimated: `4254 + p * (37 ±0)` - // Minimum execution time: 26_560_000 picoseconds. - Weight::from_parts(27_869_569, 4254) - // Standard Error: 3_626 - .saturating_add(Weight::from_parts(70_793, 0).saturating_mul(p.into())) + // Minimum execution time: 23_415_000 picoseconds. + Weight::from_parts(24_396_443, 4254) + // Standard Error: 2_683 + .saturating_add(Weight::from_parts(55_373, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) @@ -92,12 +92,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `894 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615 + a * (68 ±0) + p * (37 ±0)` - // Minimum execution time: 51_907_000 picoseconds. - Weight::from_parts(52_690_790, 8615) - // Standard Error: 2_165 - .saturating_add(Weight::from_parts(218_079, 0).saturating_mul(a.into())) - // Standard Error: 8_673 - .saturating_add(Weight::from_parts(46_409, 0).saturating_mul(p.into())) + // Minimum execution time: 47_881_000 picoseconds. + Weight::from_parts(49_366_990, 8615) + // Standard Error: 1_565 + .saturating_add(Weight::from_parts(230_574, 0).saturating_mul(a.into())) + // Standard Error: 6_269 + .saturating_add(Weight::from_parts(27_261, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 68).saturating_mul(a.into())) @@ -113,12 +113,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 25_337_000 picoseconds. - Weight::from_parts(25_516_899, 8615) - // Standard Error: 1_227 - .saturating_add(Weight::from_parts(192_126, 0).saturating_mul(a.into())) - // Standard Error: 4_914 - .saturating_add(Weight::from_parts(27_993, 0).saturating_mul(p.into())) + // Minimum execution time: 23_064_000 picoseconds. + Weight::from_parts(24_125_390, 8615) + // Standard Error: 962 + .saturating_add(Weight::from_parts(196_080, 0).saturating_mul(a.into())) + // Standard Error: 3_856 + .saturating_add(Weight::from_parts(14_238, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -132,12 +132,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 25_608_000 picoseconds. - Weight::from_parts(25_592_264, 8615) - // Standard Error: 1_278 - .saturating_add(Weight::from_parts(194_773, 0).saturating_mul(a.into())) - // Standard Error: 5_118 - .saturating_add(Weight::from_parts(27_733, 0).saturating_mul(p.into())) + // Minimum execution time: 23_374_000 picoseconds. + Weight::from_parts(23_689_785, 8615) + // Standard Error: 968 + .saturating_add(Weight::from_parts(197_461, 0).saturating_mul(a.into())) + // Standard Error: 3_878 + .saturating_add(Weight::from_parts(32_792, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -153,12 +153,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `308 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615` - // Minimum execution time: 32_841_000 picoseconds. - Weight::from_parts(33_193_276, 8615) - // Standard Error: 1_207 - .saturating_add(Weight::from_parts(192_805, 0).saturating_mul(a.into())) - // Standard Error: 4_837 - .saturating_add(Weight::from_parts(51_762, 0).saturating_mul(p.into())) + // Minimum execution time: 30_405_000 picoseconds. + Weight::from_parts(30_277_880, 8615) + // Standard Error: 2_599 + .saturating_add(Weight::from_parts(207_729, 0).saturating_mul(a.into())) + // Standard Error: 10_411 + .saturating_add(Weight::from_parts(96_256, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -169,10 +169,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_095_000 picoseconds. - Weight::from_parts(25_053_001, 4254) - // Standard Error: 2_305 - .saturating_add(Weight::from_parts(75_973, 0).saturating_mul(p.into())) + // Minimum execution time: 22_523_000 picoseconds. + Weight::from_parts(23_371_310, 4254) + // Standard Error: 1_992 + .saturating_add(Weight::from_parts(63_709, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -185,10 +185,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 25_798_000 picoseconds. - Weight::from_parts(27_240_177, 4254) - // Standard Error: 2_932 - .saturating_add(Weight::from_parts(72_608, 0).saturating_mul(p.into())) + // Minimum execution time: 24_246_000 picoseconds. + Weight::from_parts(25_375_397, 4254) + // Standard Error: 2_146 + .saturating_add(Weight::from_parts(58_952, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -199,10 +199,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 26_068_000 picoseconds. - Weight::from_parts(27_127_469, 4254) - // Standard Error: 2_928 - .saturating_add(Weight::from_parts(48_389, 0).saturating_mul(p.into())) + // Minimum execution time: 24_045_000 picoseconds. + Weight::from_parts(24_827_505, 4254) + // Standard Error: 2_954 + .saturating_add(Weight::from_parts(52_391, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -213,10 +213,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4254` - // Minimum execution time: 26_259_000 picoseconds. - Weight::from_parts(27_221_067, 4254) - // Standard Error: 3_076 - .saturating_add(Weight::from_parts(39_552, 0).saturating_mul(p.into())) + // Minimum execution time: 23_935_000 picoseconds. + Weight::from_parts(25_122_785, 4254) + // Standard Error: 2_221 + .saturating_add(Weight::from_parts(9_639, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -227,10 +227,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `156 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 25_227_000 picoseconds. - Weight::from_parts(26_491_429, 4254) - // Standard Error: 2_471 - .saturating_add(Weight::from_parts(38_289, 0).saturating_mul(p.into())) + // Minimum execution time: 22_904_000 picoseconds. + Weight::from_parts(23_916_027, 4254) + // Standard Error: 2_042 + .saturating_add(Weight::from_parts(46_310, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -244,8 +244,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `412` // Estimated: `8615` - // Minimum execution time: 45_114_000 picoseconds. - Weight::from_parts(45_896_000, 8615) + // Minimum execution time: 42_433_000 picoseconds. + Weight::from_parts(43_454_000, 8615) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -258,10 +258,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 13_736_000 picoseconds. - Weight::from_parts(14_464_226, 4254) - // Standard Error: 1_660 - .saturating_add(Weight::from_parts(40_246, 0).saturating_mul(p.into())) + // Minimum execution time: 11_667_000 picoseconds. + Weight::from_parts(12_401_419, 4254) + // Standard Error: 1_648 + .saturating_add(Weight::from_parts(40_079, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -282,10 +282,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `637 + p * (37 ±0)` // Estimated: `4254 + p * (37 ±0)` - // Minimum execution time: 26_560_000 picoseconds. - Weight::from_parts(27_869_569, 4254) - // Standard Error: 3_626 - .saturating_add(Weight::from_parts(70_793, 0).saturating_mul(p.into())) + // Minimum execution time: 23_415_000 picoseconds. + Weight::from_parts(24_396_443, 4254) + // Standard Error: 2_683 + .saturating_add(Weight::from_parts(55_373, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) @@ -308,12 +308,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `894 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615 + a * (68 ±0) + p * (37 ±0)` - // Minimum execution time: 51_907_000 picoseconds. - Weight::from_parts(52_690_790, 8615) - // Standard Error: 2_165 - .saturating_add(Weight::from_parts(218_079, 0).saturating_mul(a.into())) - // Standard Error: 8_673 - .saturating_add(Weight::from_parts(46_409, 0).saturating_mul(p.into())) + // Minimum execution time: 47_881_000 picoseconds. + Weight::from_parts(49_366_990, 8615) + // Standard Error: 1_565 + .saturating_add(Weight::from_parts(230_574, 0).saturating_mul(a.into())) + // Standard Error: 6_269 + .saturating_add(Weight::from_parts(27_261, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 68).saturating_mul(a.into())) @@ -329,12 +329,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 25_337_000 picoseconds. - Weight::from_parts(25_516_899, 8615) - // Standard Error: 1_227 - .saturating_add(Weight::from_parts(192_126, 0).saturating_mul(a.into())) - // Standard Error: 4_914 - .saturating_add(Weight::from_parts(27_993, 0).saturating_mul(p.into())) + // Minimum execution time: 23_064_000 picoseconds. + Weight::from_parts(24_125_390, 8615) + // Standard Error: 962 + .saturating_add(Weight::from_parts(196_080, 0).saturating_mul(a.into())) + // Standard Error: 3_856 + .saturating_add(Weight::from_parts(14_238, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -348,12 +348,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 25_608_000 picoseconds. - Weight::from_parts(25_592_264, 8615) - // Standard Error: 1_278 - .saturating_add(Weight::from_parts(194_773, 0).saturating_mul(a.into())) - // Standard Error: 5_118 - .saturating_add(Weight::from_parts(27_733, 0).saturating_mul(p.into())) + // Minimum execution time: 23_374_000 picoseconds. + Weight::from_parts(23_689_785, 8615) + // Standard Error: 968 + .saturating_add(Weight::from_parts(197_461, 0).saturating_mul(a.into())) + // Standard Error: 3_878 + .saturating_add(Weight::from_parts(32_792, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -369,12 +369,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `308 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615` - // Minimum execution time: 32_841_000 picoseconds. - Weight::from_parts(33_193_276, 8615) - // Standard Error: 1_207 - .saturating_add(Weight::from_parts(192_805, 0).saturating_mul(a.into())) - // Standard Error: 4_837 - .saturating_add(Weight::from_parts(51_762, 0).saturating_mul(p.into())) + // Minimum execution time: 30_405_000 picoseconds. + Weight::from_parts(30_277_880, 8615) + // Standard Error: 2_599 + .saturating_add(Weight::from_parts(207_729, 0).saturating_mul(a.into())) + // Standard Error: 10_411 + .saturating_add(Weight::from_parts(96_256, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -385,10 +385,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_095_000 picoseconds. - Weight::from_parts(25_053_001, 4254) - // Standard Error: 2_305 - .saturating_add(Weight::from_parts(75_973, 0).saturating_mul(p.into())) + // Minimum execution time: 22_523_000 picoseconds. + Weight::from_parts(23_371_310, 4254) + // Standard Error: 1_992 + .saturating_add(Weight::from_parts(63_709, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -401,10 +401,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 25_798_000 picoseconds. - Weight::from_parts(27_240_177, 4254) - // Standard Error: 2_932 - .saturating_add(Weight::from_parts(72_608, 0).saturating_mul(p.into())) + // Minimum execution time: 24_246_000 picoseconds. + Weight::from_parts(25_375_397, 4254) + // Standard Error: 2_146 + .saturating_add(Weight::from_parts(58_952, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -415,10 +415,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 26_068_000 picoseconds. - Weight::from_parts(27_127_469, 4254) - // Standard Error: 2_928 - .saturating_add(Weight::from_parts(48_389, 0).saturating_mul(p.into())) + // Minimum execution time: 24_045_000 picoseconds. + Weight::from_parts(24_827_505, 4254) + // Standard Error: 2_954 + .saturating_add(Weight::from_parts(52_391, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -429,10 +429,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4254` - // Minimum execution time: 26_259_000 picoseconds. - Weight::from_parts(27_221_067, 4254) - // Standard Error: 3_076 - .saturating_add(Weight::from_parts(39_552, 0).saturating_mul(p.into())) + // Minimum execution time: 23_935_000 picoseconds. + Weight::from_parts(25_122_785, 4254) + // Standard Error: 2_221 + .saturating_add(Weight::from_parts(9_639, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -443,10 +443,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `156 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 25_227_000 picoseconds. - Weight::from_parts(26_491_429, 4254) - // Standard Error: 2_471 - .saturating_add(Weight::from_parts(38_289, 0).saturating_mul(p.into())) + // Minimum execution time: 22_904_000 picoseconds. + Weight::from_parts(23_916_027, 4254) + // Standard Error: 2_042 + .saturating_add(Weight::from_parts(46_310, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -460,8 +460,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `412` // Estimated: `8615` - // Minimum execution time: 45_114_000 picoseconds. - Weight::from_parts(45_896_000, 8615) + // Minimum execution time: 42_433_000 picoseconds. + Weight::from_parts(43_454_000, 8615) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -474,10 +474,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 13_736_000 picoseconds. - Weight::from_parts(14_464_226, 4254) - // Standard Error: 1_660 - .saturating_add(Weight::from_parts(40_246, 0).saturating_mul(p.into())) + // Minimum execution time: 11_667_000 picoseconds. + Weight::from_parts(12_401_419, 4254) + // Standard Error: 1_648 + .saturating_add(Weight::from_parts(40_079, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index f90834bbc5..295f3816c7 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_subtensor` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-04-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-04-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 7763 64-Core Processor` +//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 9V74 80-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.VTK2WpuoML +// --output=/tmp/tmp.A0xpn9qfAo // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -39,6 +39,7 @@ pub trait WeightInfo { fn register() -> Weight; fn set_weights() -> Weight; fn add_stake() -> Weight; + fn add_stake_payable() -> Weight; fn serve_axon() -> Weight; fn serve_prometheus() -> Weight; fn burned_register() -> Weight; @@ -62,6 +63,7 @@ pub trait WeightInfo { fn move_stake() -> Weight; fn remove_stake() -> Weight; fn remove_stake_limit() -> Weight; + fn remove_stake_payable() -> Weight; fn swap_stake_limit() -> Weight; fn transfer_stake() -> Weight; fn swap_stake() -> Weight; @@ -90,8 +92,6 @@ pub trait WeightInfo { fn set_auto_parent_delegation_enabled() -> Weight; fn add_stake_burn() -> Weight; fn set_pending_childkey_cooldown() -> Weight; - fn add_stake_payable() -> Weight; - fn remove_stake_payable() -> Weight; } /// Weights for `pallet_subtensor` using the Substrate node and recommended hardware. @@ -105,7 +105,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:1 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -191,10 +191,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) fn register() -> Weight { // Proof Size summary in bytes: - // Measured: `1629` + // Measured: `1706` // Estimated: `13600` - // Minimum execution time: 348_900_000 picoseconds. - Weight::from_parts(371_883_000, 13600) + // Minimum execution time: 375_602_000 picoseconds. + Weight::from_parts(381_430_000, 13600) .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(39_u64)) } @@ -236,15 +236,15 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `188782` // Estimated: `10327372` - // Minimum execution time: 15_197_206_000 picoseconds. - Weight::from_parts(15_388_724_000, 10327372) + // Minimum execution time: 16_229_229_000 picoseconds. + Weight::from_parts(16_508_008_000, 10327372) .saturating_add(T::DbWeight::get().reads(4112_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) @@ -263,7 +263,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -287,8 +287,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) @@ -297,13 +295,74 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2307` - // Estimated: `8556` - // Minimum execution time: 332_138_000 picoseconds. - Weight::from_parts(340_254_000, 8556) + // Measured: `2280` + // Estimated: `8727` + // Minimum execution time: 397_094_000 picoseconds. + Weight::from_parts(406_768_000, 8727) .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2280` + // Estimated: `11306` + // Minimum execution time: 450_873_000 picoseconds. + Weight::from_parts(465_204_000, 11306) + .saturating_add(T::DbWeight::get().reads(29_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) + } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Axons` (r:1 w:1) @@ -314,8 +373,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `791` // Estimated: `6731` - // Minimum execution time: 34_624_000 picoseconds. - Weight::from_parts(35_666_000, 6731) + // Minimum execution time: 32_828_000 picoseconds. + Weight::from_parts(34_180_000, 6731) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -329,8 +388,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `764` // Estimated: `6704` - // Minimum execution time: 30_797_000 picoseconds. - Weight::from_parts(31_860_000, 6704) + // Minimum execution time: 28_552_000 picoseconds. + Weight::from_parts(30_224_000, 6704) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -342,7 +401,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:1 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -430,8 +489,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1639` // Estimated: `13600` - // Minimum execution time: 341_517_000 picoseconds. - Weight::from_parts(343_359_000, 13600) + // Minimum execution time: 363_224_000 picoseconds. + Weight::from_parts(367_761_000, 13600) .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(39_u64)) } @@ -483,8 +542,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1415` // Estimated: `4880` - // Minimum execution time: 102_561_000 picoseconds. - Weight::from_parts(104_435_000, 4880) + // Minimum execution time: 102_711_000 picoseconds. + Weight::from_parts(105_125_000, 4880) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -510,7 +569,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::BlockEmission` (r:1 w:0) /// Proof: `SubtensorModule::BlockEmission` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:1) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -564,8 +623,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:0 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:0 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetLocked` (r:0 w:1) /// Proof: `SubtensorModule::SubnetLocked` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworkRegisteredAt` (r:0 w:1) @@ -604,8 +661,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1459` // Estimated: `9874` - // Minimum execution time: 253_543_000 picoseconds. - Weight::from_parts(259_162_000, 9874) + // Minimum execution time: 271_029_000 picoseconds. + Weight::from_parts(276_366_000, 9874) .saturating_add(T::DbWeight::get().reads(42_u64)) .saturating_add(T::DbWeight::get().writes(47_u64)) } @@ -633,8 +690,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1061` // Estimated: `4526` - // Minimum execution time: 61_785_000 picoseconds. - Weight::from_parts(62_667_000, 4526) + // Minimum execution time: 59_787_000 picoseconds. + Weight::from_parts(60_920_000, 4526) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -678,8 +735,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1579` // Estimated: `7519` - // Minimum execution time: 109_063_000 picoseconds. - Weight::from_parts(110_616_000, 7519) + // Minimum execution time: 108_549_000 picoseconds. + Weight::from_parts(110_473_000, 7519) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -689,8 +746,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_340_000 picoseconds. - Weight::from_parts(5_541_000, 0) + // Minimum execution time: 4_317_000 picoseconds. + Weight::from_parts(4_627_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -707,8 +764,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `938` // Estimated: `4403` - // Minimum execution time: 47_128_000 picoseconds. - Weight::from_parts(47_769_000, 4403) + // Minimum execution time: 45_857_000 picoseconds. + Weight::from_parts(46_929_000, 4403) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -724,8 +781,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(43_812_000, 4159) + // Minimum execution time: 43_834_000 picoseconds. + Weight::from_parts(44_736_000, 4159) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -761,10 +818,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey_announced() -> Weight { // Proof Size summary in bytes: - // Measured: `1815` - // Estimated: `12705` - // Minimum execution time: 254_054_000 picoseconds. - Weight::from_parts(256_498_000, 12705) + // Measured: `1816` + // Estimated: `12706` + // Minimum execution time: 265_971_000 picoseconds. + Weight::from_parts(273_061_000, 12706) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -804,10 +861,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey() -> Weight { // Proof Size summary in bytes: - // Measured: `1908` - // Estimated: `12798` - // Minimum execution time: 276_024_000 picoseconds. - Weight::from_parts(279_571_000, 12798) + // Measured: `1909` + // Estimated: `12799` + // Minimum execution time: 292_830_000 picoseconds. + Weight::from_parts(299_901_000, 12799) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(19_u64)) } @@ -819,8 +876,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 22_051_000 picoseconds. - Weight::from_parts(22_531_000, 4130) + // Minimum execution time: 20_320_000 picoseconds. + Weight::from_parts(21_121_000, 4130) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -832,8 +889,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 18_605_000 picoseconds. - Weight::from_parts(19_015_000, 4078) + // Minimum execution time: 16_935_000 picoseconds. + Weight::from_parts(17_336_000, 4078) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -845,8 +902,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_426_000 picoseconds. - Weight::from_parts(8_766_000, 0) + // Minimum execution time: 6_810_000 picoseconds. + Weight::from_parts(7_281_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -889,8 +946,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2084` // Estimated: `8024` - // Minimum execution time: 411_286_000 picoseconds. - Weight::from_parts(430_662_000, 8024) + // Minimum execution time: 426_377_000 picoseconds. + Weight::from_parts(431_825_000, 8024) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -916,8 +973,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 126_435_000 picoseconds. - Weight::from_parts(128_039_000, 4889) + // Minimum execution time: 129_991_000 picoseconds. + Weight::from_parts(132_615_000, 4889) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -943,8 +1000,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 124_402_000 picoseconds. - Weight::from_parts(126_175_000, 4889) + // Minimum execution time: 129_170_000 picoseconds. + Weight::from_parts(131_122_000, 4889) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -964,8 +1021,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1079` // Estimated: `4544` - // Minimum execution time: 38_992_000 picoseconds. - Weight::from_parts(39_714_000, 4544) + // Minimum execution time: 37_776_000 picoseconds. + Weight::from_parts(38_446_000, 4544) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -991,7 +1048,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1015,8 +1072,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) @@ -1025,10 +1080,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2307` - // Estimated: `8556` - // Minimum execution time: 367_735_000 picoseconds. - Weight::from_parts(372_424_000, 8556) + // Measured: `2280` + // Estimated: `8727` + // Minimum execution time: 437_133_000 picoseconds. + Weight::from_parts(450_452_000, 8727) .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -1064,8 +1119,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2002` // Estimated: `7942` - // Minimum execution time: 215_561_000 picoseconds. - Weight::from_parts(218_267_000, 7942) + // Minimum execution time: 219_353_000 picoseconds. + Weight::from_parts(223_148_000, 7942) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -1113,20 +1168,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `10626` - // Minimum execution time: 347_237_000 picoseconds. - Weight::from_parts(367_354_000, 10626) + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 387_420_000 picoseconds. + Weight::from_parts(393_729_000, 10703) .saturating_add(T::DbWeight::get().reads(32_u64)) .saturating_add(T::DbWeight::get().writes(14_u64)) } @@ -1172,23 +1227,84 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `10626` - // Minimum execution time: 387_646_000 picoseconds. - Weight::from_parts(403_169_000, 10626) + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 423_373_000 picoseconds. + Weight::from_parts(439_316_000, 10703) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(14_u64)) } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 436_172_000 picoseconds. + Weight::from_parts(452_705_000, 10703) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) + } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -1233,20 +1349,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:2 w:2) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2494` - // Estimated: `8556` - // Minimum execution time: 461_377_000 picoseconds. - Weight::from_parts(477_951_000, 8556) + // Measured: `2609` + // Estimated: `8727` + // Minimum execution time: 580_083_000 picoseconds. + Weight::from_parts(598_340_000, 8727) .saturating_add(T::DbWeight::get().reads(42_u64)) .saturating_add(T::DbWeight::get().writes(23_u64)) } @@ -1284,8 +1400,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1829` // Estimated: `7769` - // Minimum execution time: 209_670_000 picoseconds. - Weight::from_parts(212_276_000, 7769) + // Minimum execution time: 219_313_000 picoseconds. + Weight::from_parts(222_897_000, 7769) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -1333,20 +1449,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:2 w:2) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2421` - // Estimated: `8556` - // Minimum execution time: 402_808_000 picoseconds. - Weight::from_parts(420_035_000, 8556) + // Measured: `2471` + // Estimated: `8727` + // Minimum execution time: 514_967_000 picoseconds. + Weight::from_parts(528_156_000, 8727) .saturating_add(T::DbWeight::get().reads(42_u64)) .saturating_add(T::DbWeight::get().writes(23_u64)) } @@ -1376,8 +1492,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1084` // Estimated: `4549` - // Minimum execution time: 125_634_000 picoseconds. - Weight::from_parts(128_289_000, 4549) + // Minimum execution time: 126_987_000 picoseconds. + Weight::from_parts(129_110_000, 4549) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1417,8 +1533,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1416` // Estimated: `7356` - // Minimum execution time: 100_718_000 picoseconds. - Weight::from_parts(101_739_000, 7356) + // Minimum execution time: 99_827_000 picoseconds. + Weight::from_parts(102_140_000, 7356) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1434,8 +1550,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `793` // Estimated: `4258` - // Minimum execution time: 28_653_000 picoseconds. - Weight::from_parts(29_064_000, 4258) + // Minimum execution time: 25_898_000 picoseconds. + Weight::from_parts(26_719_000, 4258) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1453,8 +1569,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `886` // Estimated: `4351` - // Minimum execution time: 35_276_000 picoseconds. - Weight::from_parts(36_067_000, 4351) + // Minimum execution time: 32_668_000 picoseconds. + Weight::from_parts(33_610_000, 4351) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1500,6 +1616,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::ActivityCutoff` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RegistrationsThisInterval` (r:1 w:1) /// Proof: `SubtensorModule::RegistrationsThisInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) @@ -1532,8 +1650,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:0 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:0 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetLocked` (r:0 w:1) /// Proof: `SubtensorModule::SubnetLocked` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworkRegisteredAt` (r:0 w:1) @@ -1572,8 +1688,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1343` // Estimated: `9758` - // Minimum execution time: 247_121_000 picoseconds. - Weight::from_parts(250_386_000, 9758) + // Minimum execution time: 265_811_000 picoseconds. + Weight::from_parts(276_166_000, 9758) .saturating_add(T::DbWeight::get().reads(41_u64)) .saturating_add(T::DbWeight::get().writes(46_u64)) } @@ -1587,8 +1703,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `762` // Estimated: `6702` - // Minimum execution time: 33_723_000 picoseconds. - Weight::from_parts(34_675_000, 6702) + // Minimum execution time: 32_307_000 picoseconds. + Weight::from_parts(33_339_000, 6702) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1602,8 +1718,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `842` // Estimated: `6782` - // Minimum execution time: 30_918_000 picoseconds. - Weight::from_parts(31_589_000, 6782) + // Minimum execution time: 29_233_000 picoseconds. + Weight::from_parts(30_365_000, 6782) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1615,8 +1731,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `595` // Estimated: `4060` - // Minimum execution time: 17_742_000 picoseconds. - Weight::from_parts(18_184_000, 4060) + // Minimum execution time: 15_703_000 picoseconds. + Weight::from_parts(16_144_000, 4060) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1688,8 +1804,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `3026` // Estimated: `28766` - // Minimum execution time: 1_148_871_000 picoseconds. - Weight::from_parts(1_162_857_000, 28766) + // Minimum execution time: 1_159_976_000 picoseconds. + Weight::from_parts(1_169_038_000, 28766) .saturating_add(T::DbWeight::get().reads(161_u64)) .saturating_add(T::DbWeight::get().writes(95_u64)) } @@ -1703,8 +1819,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `745` // Estimated: `4210` - // Minimum execution time: 23_784_000 picoseconds. - Weight::from_parts(24_406_000, 4210) + // Minimum execution time: 22_413_000 picoseconds. + Weight::from_parts(23_114_000, 4210) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1718,8 +1834,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `740` // Estimated: `9155` - // Minimum execution time: 26_539_000 picoseconds. - Weight::from_parts(27_602_000, 9155) + // Minimum execution time: 25_107_000 picoseconds. + Weight::from_parts(26_098_000, 9155) .saturating_add(T::DbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -1766,12 +1882,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:2 w:2) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:4 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) @@ -1784,10 +1900,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unstake_all_alpha() -> Weight { // Proof Size summary in bytes: - // Measured: `2372` - // Estimated: `10787` - // Minimum execution time: 414_015_000 picoseconds. - Weight::from_parts(427_445_000, 10787) + // Measured: `2539` + // Estimated: `11306` + // Minimum execution time: 525_723_000 picoseconds. + Weight::from_parts(531_051_000, 11306) .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(26_u64)) } @@ -1833,20 +1949,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `10626` - // Minimum execution time: 412_223_000 picoseconds. - Weight::from_parts(430_190_000, 10626) + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 452_896_000 picoseconds. + Weight::from_parts(460_567_000, 10703) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(14_u64)) } @@ -1856,7 +1972,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NextSubnetLeaseId` (r:1 w:1) /// Proof: `SubtensorModule::NextSubnetLeaseId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:502 w:502) + /// Storage: `System::Account` (r:503 w:503) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1938,8 +2054,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Burn` (r:0 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:0 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetUidToLeaseId` (r:0 w:1) /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetLocked` (r:0 w:1) @@ -1985,10 +2099,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1762 + k * (44 ±0)` // Estimated: `10183 + k * (2579 ±0)` - // Minimum execution time: 460_608_000 picoseconds. - Weight::from_parts(288_591_956, 10183) - // Standard Error: 49_874 - .saturating_add(Weight::from_parts(46_601_875, 0).saturating_mul(k.into())) + // Minimum execution time: 479_905_000 picoseconds. + Weight::from_parts(300_814_552, 10183) + // Standard Error: 23_469 + .saturating_add(Weight::from_parts(47_676_615, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(51_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(52_u64)) @@ -2018,10 +2132,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1447 + k * (53 ±0)` // Estimated: `6148 + k * (2514 ±0)` - // Minimum execution time: 91_881_000 picoseconds. - Weight::from_parts(76_151_337, 6148) - // Standard Error: 6_935 - .saturating_add(Weight::from_parts(1_611_715, 0).saturating_mul(k.into())) + // Minimum execution time: 89_622_000 picoseconds. + Weight::from_parts(75_737_842, 6148) + // Standard Error: 6_598 + .saturating_add(Weight::from_parts(1_667_290, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(7_u64)) @@ -2036,8 +2150,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `649` // Estimated: `9064` - // Minimum execution time: 28_173_000 picoseconds. - Weight::from_parts(29_054_000, 9064) + // Minimum execution time: 24_696_000 picoseconds. + Weight::from_parts(25_808_000, 9064) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2065,8 +2179,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1060` // Estimated: `4525` - // Minimum execution time: 74_899_000 picoseconds. - Weight::from_parts(76_262_000, 4525) + // Minimum execution time: 73_007_000 picoseconds. + Weight::from_parts(74_530_000, 4525) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2082,8 +2196,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 33_833_000 picoseconds. - Weight::from_parts(34_534_000, 4264) + // Minimum execution time: 31_627_000 picoseconds. + Weight::from_parts(32_849_000, 4264) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2099,8 +2213,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 17_713_000 picoseconds. - Weight::from_parts(18_294_000, 3941) + // Minimum execution time: 16_044_000 picoseconds. + Weight::from_parts(16_424_000, 3941) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2130,8 +2244,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1908` // Estimated: `7848` - // Minimum execution time: 134_892_000 picoseconds. - Weight::from_parts(137_416_000, 7848) + // Minimum execution time: 137_482_000 picoseconds. + Weight::from_parts(139_535_000, 7848) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2141,8 +2255,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_734_000 picoseconds. - Weight::from_parts(2_865_000, 0) + // Minimum execution time: 2_083_000 picoseconds. + Weight::from_parts(2_383_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) @@ -2151,8 +2265,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_290_000 picoseconds. - Weight::from_parts(5_831_000, 0) + // Minimum execution time: 4_347_000 picoseconds. + Weight::from_parts(4_848_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2165,8 +2279,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `852` // Estimated: `4317` - // Minimum execution time: 26_740_000 picoseconds. - Weight::from_parts(27_722_000, 4317) + // Minimum execution time: 24_936_000 picoseconds. + Weight::from_parts(25_427_000, 4317) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2198,7 +2312,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2222,8 +2336,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) @@ -2232,10 +2344,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_burn() -> Weight { // Proof Size summary in bytes: - // Measured: `2365` - // Estimated: `8556` - // Minimum execution time: 534_433_000 picoseconds. - Weight::from_parts(534_433_000, 8556) + // Measured: `2338` + // Estimated: `8727` + // Minimum execution time: 529_859_000 picoseconds. + Weight::from_parts(544_630_000, 8727) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(17_u64)) } @@ -2245,132 +2357,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_745_000 picoseconds. - Weight::from_parts(2_956_000, 0) + // Minimum execution time: 2_123_000 picoseconds. + Weight::from_parts(2_323_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `System::Account` (r:4 w:4) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2280` - // Estimated: `11306` - // Minimum execution time: 277_000_000 picoseconds. - Weight::from_parts(278_000_000, 11306) - .saturating_add(T::DbWeight::get().reads(29_u64)) - .saturating_add(T::DbWeight::get().writes(17_u64)) - } - /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2288` - // Estimated: `10703` - // Minimum execution time: 264_000_000 picoseconds. - Weight::from_parts(279_000_000, 10703) - .saturating_add(T::DbWeight::get().reads(33_u64)) - .saturating_add(T::DbWeight::get().writes(15_u64)) - } } // For backwards compatibility and tests. @@ -2383,7 +2373,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:1 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2469,10 +2459,10 @@ impl WeightInfo for () { /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) fn register() -> Weight { // Proof Size summary in bytes: - // Measured: `1629` + // Measured: `1706` // Estimated: `13600` - // Minimum execution time: 348_900_000 picoseconds. - Weight::from_parts(371_883_000, 13600) + // Minimum execution time: 375_602_000 picoseconds. + Weight::from_parts(381_430_000, 13600) .saturating_add(RocksDbWeight::get().reads(47_u64)) .saturating_add(RocksDbWeight::get().writes(39_u64)) } @@ -2514,15 +2504,15 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `188782` // Estimated: `10327372` - // Minimum execution time: 15_197_206_000 picoseconds. - Weight::from_parts(15_388_724_000, 10327372) + // Minimum execution time: 16_229_229_000 picoseconds. + Weight::from_parts(16_508_008_000, 10327372) .saturating_add(RocksDbWeight::get().reads(4112_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) @@ -2541,7 +2531,7 @@ impl WeightInfo for () { /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2565,8 +2555,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) @@ -2575,13 +2563,74 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2307` - // Estimated: `8556` - // Minimum execution time: 399_660_000 picoseconds. - Weight::from_parts(399_660_000, 8556) + // Measured: `2280` + // Estimated: `8727` + // Minimum execution time: 397_094_000 picoseconds. + Weight::from_parts(406_768_000, 8727) .saturating_add(RocksDbWeight::get().reads(28_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2280` + // Estimated: `11306` + // Minimum execution time: 450_873_000 picoseconds. + Weight::from_parts(465_204_000, 11306) + .saturating_add(RocksDbWeight::get().reads(29_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) + } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Axons` (r:1 w:1) @@ -2592,8 +2641,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `791` // Estimated: `6731` - // Minimum execution time: 34_624_000 picoseconds. - Weight::from_parts(35_666_000, 6731) + // Minimum execution time: 32_828_000 picoseconds. + Weight::from_parts(34_180_000, 6731) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2607,8 +2656,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `764` // Estimated: `6704` - // Minimum execution time: 30_797_000 picoseconds. - Weight::from_parts(31_860_000, 6704) + // Minimum execution time: 28_552_000 picoseconds. + Weight::from_parts(30_224_000, 6704) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2620,7 +2669,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:1 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2708,8 +2757,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1639` // Estimated: `13600` - // Minimum execution time: 385_433_000 picoseconds. - Weight::from_parts(385_433_000, 13600) + // Minimum execution time: 363_224_000 picoseconds. + Weight::from_parts(367_761_000, 13600) .saturating_add(RocksDbWeight::get().reads(47_u64)) .saturating_add(RocksDbWeight::get().writes(39_u64)) } @@ -2761,8 +2810,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1415` // Estimated: `4880` - // Minimum execution time: 102_561_000 picoseconds. - Weight::from_parts(104_435_000, 4880) + // Minimum execution time: 102_711_000 picoseconds. + Weight::from_parts(105_125_000, 4880) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -2788,7 +2837,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::BlockEmission` (r:1 w:0) /// Proof: `SubtensorModule::BlockEmission` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:1) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2842,8 +2891,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:0 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:0 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetLocked` (r:0 w:1) /// Proof: `SubtensorModule::SubnetLocked` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworkRegisteredAt` (r:0 w:1) @@ -2880,12 +2927,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1676` - // Estimated: `10091` - // Minimum execution time: 259_162_000 picoseconds. - Weight::from_parts(259_162_000, 10091) + // Measured: `1459` + // Estimated: `9874` + // Minimum execution time: 271_029_000 picoseconds. + Weight::from_parts(276_366_000, 9874) .saturating_add(RocksDbWeight::get().reads(42_u64)) - .saturating_add(RocksDbWeight::get().writes(46_u64)) + .saturating_add(RocksDbWeight::get().writes(47_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2911,8 +2958,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1061` // Estimated: `4526` - // Minimum execution time: 61_785_000 picoseconds. - Weight::from_parts(62_667_000, 4526) + // Minimum execution time: 59_787_000 picoseconds. + Weight::from_parts(60_920_000, 4526) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2956,8 +3003,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1579` // Estimated: `7519` - // Minimum execution time: 109_063_000 picoseconds. - Weight::from_parts(110_616_000, 7519) + // Minimum execution time: 108_549_000 picoseconds. + Weight::from_parts(110_473_000, 7519) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2967,8 +3014,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_340_000 picoseconds. - Weight::from_parts(5_541_000, 0) + // Minimum execution time: 4_317_000 picoseconds. + Weight::from_parts(4_627_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2985,8 +3032,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `938` // Estimated: `4403` - // Minimum execution time: 47_128_000 picoseconds. - Weight::from_parts(47_769_000, 4403) + // Minimum execution time: 45_857_000 picoseconds. + Weight::from_parts(46_929_000, 4403) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3002,8 +3049,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(43_812_000, 4159) + // Minimum execution time: 43_834_000 picoseconds. + Weight::from_parts(44_736_000, 4159) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3039,10 +3086,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey_announced() -> Weight { // Proof Size summary in bytes: - // Measured: `1815` - // Estimated: `12705` - // Minimum execution time: 254_054_000 picoseconds. - Weight::from_parts(256_498_000, 12705) + // Measured: `1816` + // Estimated: `12706` + // Minimum execution time: 265_971_000 picoseconds. + Weight::from_parts(273_061_000, 12706) .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -3082,10 +3129,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey() -> Weight { // Proof Size summary in bytes: - // Measured: `1908` - // Estimated: `12798` - // Minimum execution time: 276_024_000 picoseconds. - Weight::from_parts(279_571_000, 12798) + // Measured: `1909` + // Estimated: `12799` + // Minimum execution time: 292_830_000 picoseconds. + Weight::from_parts(299_901_000, 12799) .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(19_u64)) } @@ -3097,8 +3144,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 22_051_000 picoseconds. - Weight::from_parts(22_531_000, 4130) + // Minimum execution time: 20_320_000 picoseconds. + Weight::from_parts(21_121_000, 4130) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3110,8 +3157,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 18_605_000 picoseconds. - Weight::from_parts(19_015_000, 4078) + // Minimum execution time: 16_935_000 picoseconds. + Weight::from_parts(17_336_000, 4078) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3123,8 +3170,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_426_000 picoseconds. - Weight::from_parts(8_766_000, 0) + // Minimum execution time: 6_810_000 picoseconds. + Weight::from_parts(7_281_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3167,8 +3214,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2084` // Estimated: `8024` - // Minimum execution time: 411_286_000 picoseconds. - Weight::from_parts(430_662_000, 8024) + // Minimum execution time: 426_377_000 picoseconds. + Weight::from_parts(431_825_000, 8024) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3194,8 +3241,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 126_435_000 picoseconds. - Weight::from_parts(128_039_000, 4889) + // Minimum execution time: 129_991_000 picoseconds. + Weight::from_parts(132_615_000, 4889) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -3221,8 +3268,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 124_402_000 picoseconds. - Weight::from_parts(126_175_000, 4889) + // Minimum execution time: 129_170_000 picoseconds. + Weight::from_parts(131_122_000, 4889) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3242,8 +3289,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1079` // Estimated: `4544` - // Minimum execution time: 38_992_000 picoseconds. - Weight::from_parts(39_714_000, 4544) + // Minimum execution time: 37_776_000 picoseconds. + Weight::from_parts(38_446_000, 4544) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3269,7 +3316,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3293,8 +3340,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) @@ -3303,10 +3348,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2307` - // Estimated: `8556` - // Minimum execution time: 444_193_000 picoseconds. - Weight::from_parts(444_193_000, 8556) + // Measured: `2280` + // Estimated: `8727` + // Minimum execution time: 437_133_000 picoseconds. + Weight::from_parts(450_452_000, 8727) .saturating_add(RocksDbWeight::get().reads(28_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -3342,8 +3387,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2002` // Estimated: `7942` - // Minimum execution time: 215_561_000 picoseconds. - Weight::from_parts(218_267_000, 7942) + // Minimum execution time: 219_353_000 picoseconds. + Weight::from_parts(223_148_000, 7942) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -3391,20 +3436,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `10626` - // Minimum execution time: 347_237_000 picoseconds. - Weight::from_parts(367_354_000, 10626) + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 387_420_000 picoseconds. + Weight::from_parts(393_729_000, 10703) .saturating_add(RocksDbWeight::get().reads(32_u64)) .saturating_add(RocksDbWeight::get().writes(14_u64)) } @@ -3450,23 +3495,84 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `10626` - // Minimum execution time: 387_646_000 picoseconds. - Weight::from_parts(403_169_000, 10626) + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 423_373_000 picoseconds. + Weight::from_parts(439_316_000, 10703) .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(14_u64)) } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 436_172_000 picoseconds. + Weight::from_parts(452_705_000, 10703) + .saturating_add(RocksDbWeight::get().reads(33_u64)) + .saturating_add(RocksDbWeight::get().writes(15_u64)) + } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -3511,20 +3617,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:2 w:2) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2494` - // Estimated: `8556` - // Minimum execution time: 461_377_000 picoseconds. - Weight::from_parts(477_951_000, 8556) + // Measured: `2609` + // Estimated: `8727` + // Minimum execution time: 580_083_000 picoseconds. + Weight::from_parts(598_340_000, 8727) .saturating_add(RocksDbWeight::get().reads(42_u64)) .saturating_add(RocksDbWeight::get().writes(23_u64)) } @@ -3562,8 +3668,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1829` // Estimated: `7769` - // Minimum execution time: 209_670_000 picoseconds. - Weight::from_parts(212_276_000, 7769) + // Minimum execution time: 219_313_000 picoseconds. + Weight::from_parts(222_897_000, 7769) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -3611,20 +3717,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:2 w:2) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2421` - // Estimated: `8556` - // Minimum execution time: 402_808_000 picoseconds. - Weight::from_parts(420_035_000, 8556) + // Measured: `2471` + // Estimated: `8727` + // Minimum execution time: 514_967_000 picoseconds. + Weight::from_parts(528_156_000, 8727) .saturating_add(RocksDbWeight::get().reads(42_u64)) .saturating_add(RocksDbWeight::get().writes(23_u64)) } @@ -3654,8 +3760,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1084` // Estimated: `4549` - // Minimum execution time: 125_634_000 picoseconds. - Weight::from_parts(128_289_000, 4549) + // Minimum execution time: 126_987_000 picoseconds. + Weight::from_parts(129_110_000, 4549) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3695,8 +3801,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1416` // Estimated: `7356` - // Minimum execution time: 100_718_000 picoseconds. - Weight::from_parts(101_739_000, 7356) + // Minimum execution time: 99_827_000 picoseconds. + Weight::from_parts(102_140_000, 7356) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3712,8 +3818,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `793` // Estimated: `4258` - // Minimum execution time: 28_653_000 picoseconds. - Weight::from_parts(29_064_000, 4258) + // Minimum execution time: 25_898_000 picoseconds. + Weight::from_parts(26_719_000, 4258) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3731,8 +3837,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `886` // Estimated: `4351` - // Minimum execution time: 35_276_000 picoseconds. - Weight::from_parts(36_067_000, 4351) + // Minimum execution time: 32_668_000 picoseconds. + Weight::from_parts(33_610_000, 4351) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3778,6 +3884,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::ActivityCutoff` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RegistrationsThisInterval` (r:1 w:1) /// Proof: `SubtensorModule::RegistrationsThisInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) @@ -3810,8 +3918,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:0 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:0 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetLocked` (r:0 w:1) /// Proof: `SubtensorModule::SubnetLocked` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworkRegisteredAt` (r:0 w:1) @@ -3850,8 +3956,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1343` // Estimated: `9758` - // Minimum execution time: 247_121_000 picoseconds. - Weight::from_parts(250_386_000, 9758) + // Minimum execution time: 265_811_000 picoseconds. + Weight::from_parts(276_166_000, 9758) .saturating_add(RocksDbWeight::get().reads(41_u64)) .saturating_add(RocksDbWeight::get().writes(46_u64)) } @@ -3865,8 +3971,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `762` // Estimated: `6702` - // Minimum execution time: 33_723_000 picoseconds. - Weight::from_parts(34_675_000, 6702) + // Minimum execution time: 32_307_000 picoseconds. + Weight::from_parts(33_339_000, 6702) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3880,8 +3986,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `842` // Estimated: `6782` - // Minimum execution time: 30_918_000 picoseconds. - Weight::from_parts(31_589_000, 6782) + // Minimum execution time: 29_233_000 picoseconds. + Weight::from_parts(30_365_000, 6782) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3893,8 +3999,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `595` // Estimated: `4060` - // Minimum execution time: 17_742_000 picoseconds. - Weight::from_parts(18_184_000, 4060) + // Minimum execution time: 15_703_000 picoseconds. + Weight::from_parts(16_144_000, 4060) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3966,8 +4072,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `3026` // Estimated: `28766` - // Minimum execution time: 1_148_985_000 picoseconds. - Weight::from_parts(1_154_584_000, 28766) + // Minimum execution time: 1_159_976_000 picoseconds. + Weight::from_parts(1_169_038_000, 28766) .saturating_add(RocksDbWeight::get().reads(161_u64)) .saturating_add(RocksDbWeight::get().writes(95_u64)) } @@ -3981,8 +4087,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `745` // Estimated: `4210` - // Minimum execution time: 23_784_000 picoseconds. - Weight::from_parts(24_406_000, 4210) + // Minimum execution time: 22_413_000 picoseconds. + Weight::from_parts(23_114_000, 4210) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3996,8 +4102,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `740` // Estimated: `9155` - // Minimum execution time: 26_539_000 picoseconds. - Weight::from_parts(27_602_000, 9155) + // Minimum execution time: 25_107_000 picoseconds. + Weight::from_parts(26_098_000, 9155) .saturating_add(RocksDbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4044,12 +4150,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:2 w:2) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:4 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) @@ -4062,10 +4168,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unstake_all_alpha() -> Weight { // Proof Size summary in bytes: - // Measured: `2372` - // Estimated: `10787` - // Minimum execution time: 414_015_000 picoseconds. - Weight::from_parts(427_445_000, 10787) + // Measured: `2539` + // Estimated: `11306` + // Minimum execution time: 525_723_000 picoseconds. + Weight::from_parts(531_051_000, 11306) .saturating_add(RocksDbWeight::get().reads(47_u64)) .saturating_add(RocksDbWeight::get().writes(26_u64)) } @@ -4111,20 +4217,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2211` - // Estimated: `10626` - // Minimum execution time: 412_223_000 picoseconds. - Weight::from_parts(430_190_000, 10626) + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 452_896_000 picoseconds. + Weight::from_parts(460_567_000, 10703) .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(14_u64)) } @@ -4134,7 +4240,7 @@ impl WeightInfo for () { /// Proof: `Crowdloan::Crowdloans` (`max_values`: None, `max_size`: Some(282), added: 2757, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NextSubnetLeaseId` (r:1 w:1) /// Proof: `SubtensorModule::NextSubnetLeaseId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:502 w:502) + /// Storage: `System::Account` (r:503 w:503) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4216,8 +4322,6 @@ impl WeightInfo for () { /// Proof: `Crowdloan::Contributions` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Burn` (r:0 w:1) /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:0 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetUidToLeaseId` (r:0 w:1) /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetLocked` (r:0 w:1) @@ -4263,10 +4367,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1762 + k * (44 ±0)` // Estimated: `10183 + k * (2579 ±0)` - // Minimum execution time: 460_608_000 picoseconds. - Weight::from_parts(288_591_956, 10183) - // Standard Error: 49_874 - .saturating_add(Weight::from_parts(46_601_875, 0).saturating_mul(k.into())) + // Minimum execution time: 479_905_000 picoseconds. + Weight::from_parts(300_814_552, 10183) + // Standard Error: 23_469 + .saturating_add(Weight::from_parts(47_676_615, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(51_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(52_u64)) @@ -4296,10 +4400,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1447 + k * (53 ±0)` // Estimated: `6148 + k * (2514 ±0)` - // Minimum execution time: 91_881_000 picoseconds. - Weight::from_parts(76_151_337, 6148) - // Standard Error: 6_935 - .saturating_add(Weight::from_parts(1_611_715, 0).saturating_mul(k.into())) + // Minimum execution time: 89_622_000 picoseconds. + Weight::from_parts(75_737_842, 6148) + // Standard Error: 6_598 + .saturating_add(Weight::from_parts(1_667_290, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(7_u64)) @@ -4314,8 +4418,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `649` // Estimated: `9064` - // Minimum execution time: 28_173_000 picoseconds. - Weight::from_parts(29_054_000, 9064) + // Minimum execution time: 24_696_000 picoseconds. + Weight::from_parts(25_808_000, 9064) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4343,8 +4447,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1060` // Estimated: `4525` - // Minimum execution time: 74_899_000 picoseconds. - Weight::from_parts(76_262_000, 4525) + // Minimum execution time: 73_007_000 picoseconds. + Weight::from_parts(74_530_000, 4525) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4360,8 +4464,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 33_833_000 picoseconds. - Weight::from_parts(34_534_000, 4264) + // Minimum execution time: 31_627_000 picoseconds. + Weight::from_parts(32_849_000, 4264) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4377,8 +4481,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 17_713_000 picoseconds. - Weight::from_parts(18_294_000, 3941) + // Minimum execution time: 16_044_000 picoseconds. + Weight::from_parts(16_424_000, 3941) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4408,8 +4512,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1908` // Estimated: `7848` - // Minimum execution time: 134_892_000 picoseconds. - Weight::from_parts(137_416_000, 7848) + // Minimum execution time: 137_482_000 picoseconds. + Weight::from_parts(139_535_000, 7848) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4419,8 +4523,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_734_000 picoseconds. - Weight::from_parts(2_865_000, 0) + // Minimum execution time: 2_083_000 picoseconds. + Weight::from_parts(2_383_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) @@ -4429,8 +4533,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_290_000 picoseconds. - Weight::from_parts(5_831_000, 0) + // Minimum execution time: 4_347_000 picoseconds. + Weight::from_parts(4_848_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4443,8 +4547,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `852` // Estimated: `4317` - // Minimum execution time: 26_740_000 picoseconds. - Weight::from_parts(27_722_000, 4317) + // Minimum execution time: 24_936_000 picoseconds. + Weight::from_parts(25_427_000, 4317) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4476,7 +4580,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4500,8 +4604,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) @@ -4510,12 +4612,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_burn() -> Weight { // Proof Size summary in bytes: - // Measured: `2365` - // Estimated: `8556` - // Minimum execution time: 458_073_000 picoseconds. - Weight::from_parts(469_234_000, 8556) - .saturating_add(RocksDbWeight::get().reads(30_u64)) - .saturating_add(RocksDbWeight::get().writes(16_u64)) + // Measured: `2338` + // Estimated: `8727` + // Minimum execution time: 529_859_000 picoseconds. + Weight::from_parts(544_630_000, 8727) + .saturating_add(RocksDbWeight::get().reads(31_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -4523,130 +4625,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_745_000 picoseconds. - Weight::from_parts(2_956_000, 0) + // Minimum execution time: 2_123_000 picoseconds. + Weight::from_parts(2_323_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: `System::Account` (r:4 w:4) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2280` - // Estimated: `11306` - // Minimum execution time: 277_000_000 picoseconds. - Weight::from_parts(278_000_000, 11306) - .saturating_add(RocksDbWeight::get().reads(29_u64)) - .saturating_add(RocksDbWeight::get().writes(17_u64)) - } - /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2288` - // Estimated: `10703` - // Minimum execution time: 264_000_000 picoseconds. - Weight::from_parts(279_000_000, 10703) - .saturating_add(RocksDbWeight::get().reads(33_u64)) - .saturating_add(RocksDbWeight::get().writes(15_u64)) - } } diff --git a/pallets/utility/src/weights.rs b/pallets/utility/src/weights.rs index f5234ee528..29f0b86994 100644 --- a/pallets/utility/src/weights.rs +++ b/pallets/utility/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_subtensor_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-04-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-04-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 7763 64-Core Processor` +//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 9V74 80-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.KdzJkvj7lA +// --output=/tmp/tmp.A1NTA2dO5l // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -57,10 +57,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 5_069_000 picoseconds. - Weight::from_parts(17_591_644, 3983) - // Standard Error: 2_161 - .saturating_add(Weight::from_parts(5_615_733, 0).saturating_mul(c.into())) + // Minimum execution time: 3_806_000 picoseconds. + Weight::from_parts(4_026_000, 3983) + // Standard Error: 1_132 + .saturating_add(Weight::from_parts(5_452_464, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -71,8 +71,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 15_228_000 picoseconds. - Weight::from_parts(15_679_000, 3983) + // Minimum execution time: 13_520_000 picoseconds. + Weight::from_parts(14_080_000, 3983) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -84,18 +84,18 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 5_110_000 picoseconds. - Weight::from_parts(17_036_214, 3983) - // Standard Error: 2_084 - .saturating_add(Weight::from_parts(5_820_595, 0).saturating_mul(c.into())) + // Minimum execution time: 3_906_000 picoseconds. + Weight::from_parts(7_805_366, 3983) + // Standard Error: 1_847 + .saturating_add(Weight::from_parts(5_704_818, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_962_000 picoseconds. - Weight::from_parts(7_233_000, 0) + // Minimum execution time: 5_588_000 picoseconds. + Weight::from_parts(5_839_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -106,18 +106,18 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 5_019_000 picoseconds. - Weight::from_parts(16_701_377, 3983) - // Standard Error: 2_713 - .saturating_add(Weight::from_parts(5_639_027, 0).saturating_mul(c.into())) + // Minimum execution time: 3_766_000 picoseconds. + Weight::from_parts(1_446_504, 3983) + // Standard Error: 4_156 + .saturating_add(Weight::from_parts(5_473_776, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn dispatch_as_fallible() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_943_000 picoseconds. - Weight::from_parts(7_243_000, 0) + // Minimum execution time: 5_448_000 picoseconds. + Weight::from_parts(5_838_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -127,8 +127,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 21_730_000 picoseconds. - Weight::from_parts(22_171_000, 3983) + // Minimum execution time: 18_848_000 picoseconds. + Weight::from_parts(19_319_000, 3983) .saturating_add(T::DbWeight::get().reads(2_u64)) } } @@ -144,10 +144,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 5_069_000 picoseconds. - Weight::from_parts(17_591_644, 3983) - // Standard Error: 2_161 - .saturating_add(Weight::from_parts(5_615_733, 0).saturating_mul(c.into())) + // Minimum execution time: 3_806_000 picoseconds. + Weight::from_parts(4_026_000, 3983) + // Standard Error: 1_132 + .saturating_add(Weight::from_parts(5_452_464, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -158,8 +158,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 15_228_000 picoseconds. - Weight::from_parts(15_679_000, 3983) + // Minimum execution time: 13_520_000 picoseconds. + Weight::from_parts(14_080_000, 3983) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -171,18 +171,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 5_110_000 picoseconds. - Weight::from_parts(17_036_214, 3983) - // Standard Error: 2_084 - .saturating_add(Weight::from_parts(5_820_595, 0).saturating_mul(c.into())) + // Minimum execution time: 3_906_000 picoseconds. + Weight::from_parts(7_805_366, 3983) + // Standard Error: 1_847 + .saturating_add(Weight::from_parts(5_704_818, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_962_000 picoseconds. - Weight::from_parts(7_233_000, 0) + // Minimum execution time: 5_588_000 picoseconds. + Weight::from_parts(5_839_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -193,18 +193,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 5_019_000 picoseconds. - Weight::from_parts(16_701_377, 3983) - // Standard Error: 2_713 - .saturating_add(Weight::from_parts(5_639_027, 0).saturating_mul(c.into())) + // Minimum execution time: 3_766_000 picoseconds. + Weight::from_parts(1_446_504, 3983) + // Standard Error: 4_156 + .saturating_add(Weight::from_parts(5_473_776, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn dispatch_as_fallible() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_943_000 picoseconds. - Weight::from_parts(7_243_000, 0) + // Minimum execution time: 5_448_000 picoseconds. + Weight::from_parts(5_838_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -214,8 +214,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 21_730_000 picoseconds. - Weight::from_parts(22_171_000, 3983) + // Minimum execution time: 18_848_000 picoseconds. + Weight::from_parts(19_319_000, 3983) .saturating_add(RocksDbWeight::get().reads(2_u64)) } } From 655e74baf09d5a3fe1a29c17576f6a216e2d034f Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 30 Apr 2026 13:08:57 +0200 Subject: [PATCH 11/13] - Changed fees from absolute amount to percentage --- pallets/subtensor/src/benchmarks.rs | 10 +++--- pallets/subtensor/src/macros/dispatches.rs | 8 ++--- pallets/subtensor/src/staking/add_stake.rs | 17 ++++++---- pallets/subtensor/src/staking/remove_stake.rs | 15 +++++++-- pallets/subtensor/src/tests/staking.rs | 33 ++++++++++--------- 5 files changed, 49 insertions(+), 34 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 6fff059864..55b622c298 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -11,7 +11,7 @@ use frame_system::{RawOrigin, pallet_prelude::BlockNumberFor}; pub use pallet::*; use sp_core::H256; use sp_runtime::{ - BoundedVec, Percent, + BoundedVec, Percent, Permill, traits::{BlakeTwo256, Hash}, }; use sp_std::collections::btree_set::BTreeSet; @@ -210,7 +210,7 @@ mod pallet_benchmarks { let hotkey: T::AccountId = account("Alice", 0, seed); let total_stake = TaoBalance::from(1_000_000_000); let amount = TaoBalance::from(60_000_000); - let amount_fees = TaoBalance::from(1000); + let fee_percentage = Permill::from_percent(1); seed_swap_reserves::(netuid); add_balance_to_coldkey_account::(&coldkey, total_stake.into()); @@ -227,7 +227,7 @@ mod pallet_benchmarks { netuid, amount, app_coldkey, - amount_fees, + fee_percentage, ); } @@ -1098,7 +1098,7 @@ mod pallet_benchmarks { Subtensor::::set_burn(netuid, benchmark_registration_burn()); let app_coldkey: T::AccountId = account("cold", 0, seed); - let amount_fees = TaoBalance::from(1000); + let fee_percentage = Permill::from_percent(1); let tao_reserve = TaoBalance::from(150_000_000_000_u64); let alpha_in = AlphaBalance::from(100_000_000_000_u64); set_reserves::(netuid, tao_reserve, alpha_in); @@ -1134,7 +1134,7 @@ mod pallet_benchmarks { netuid, amount_unstaked, app_coldkey, - amount_fees, + fee_percentage, ); } diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index f3ab422055..9b189ede58 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -755,7 +755,7 @@ mod dispatches { netuid: NetUid, amount_unstaked: AlphaBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoBalance, + fee_percentage: sp_runtime::Permill, ) -> DispatchResult { Self::do_remove_stake_payable( origin, @@ -763,7 +763,7 @@ mod dispatches { netuid, amount_unstaked, coldkey_fees_tank, - amount_fees, + fee_percentage, ) .map(|_| ()) } @@ -2563,7 +2563,7 @@ mod dispatches { netuid: NetUid, amount_staked: TaoBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoBalance, + fee_percentage: sp_runtime::Permill, ) -> DispatchResult { Self::do_add_stake_payable( origin, @@ -2571,7 +2571,7 @@ mod dispatches { netuid, amount_staked, coldkey_fees_tank, - amount_fees, + fee_percentage, ) .map(|_| ()) } diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index 0f859534b2..05d7055423 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -1,3 +1,4 @@ +use sp_runtime::Permill; use subtensor_runtime_common::{NetUid, TaoBalance}; use subtensor_swap_interface::{Order, SwapHandler}; @@ -77,20 +78,22 @@ impl Pallet { netuid: NetUid, stake_to_be_added: TaoBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoBalance, + fee_percentage: Permill, ) -> Result { let coldkey = ensure_signed(origin.clone())?; ensure!( - Self::can_remove_balance_from_coldkey_account( - &coldkey, - stake_to_be_added.saturating_add(amount_fees).into() - ), + Self::can_remove_balance_from_coldkey_account(&coldkey, stake_to_be_added.into()), Error::::NotEnoughBalanceToStake ); - Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; - Self::do_add_stake(origin, hotkey, netuid, stake_to_be_added) + let amount_fees = TaoBalance::from(fee_percentage * stake_to_be_added.to_u64()); + let stake_after_fees = stake_to_be_added.saturating_sub(amount_fees); + + if !amount_fees.is_zero() { + Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; + } + Self::do_add_stake(origin, hotkey, netuid, stake_after_fees) } /// ---- The implementation for the extrinsic add_stake_limit: Adds stake to a hotkey diff --git a/pallets/subtensor/src/staking/remove_stake.rs b/pallets/subtensor/src/staking/remove_stake.rs index d4a800f3b7..79586b4e02 100644 --- a/pallets/subtensor/src/staking/remove_stake.rs +++ b/pallets/subtensor/src/staking/remove_stake.rs @@ -1,4 +1,5 @@ use super::*; +use sp_runtime::Permill; use substrate_fixed::types::U96F32; use subtensor_runtime_common::{AlphaBalance, NetUid, TaoBalance, Token}; use subtensor_swap_interface::{Order, SwapHandler}; @@ -619,11 +620,19 @@ impl Pallet { netuid: NetUid, amount_unstaked: AlphaBalance, coldkey_fees_tank: T::AccountId, - amount_fees: TaoBalance, + fee_percentage: Permill, ) -> dispatch::DispatchResult { let coldkey = ensure_signed(origin.clone())?; - Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; - Self::do_remove_stake(origin, hotkey, netuid, amount_unstaked) + let balance_before = Self::get_coldkey_balance(&coldkey); + Self::do_remove_stake(origin, hotkey, netuid, amount_unstaked)?; + let balance_after = Self::get_coldkey_balance(&coldkey); + let tao_received = balance_after.saturating_sub(balance_before); + + let amount_fees = TaoBalance::from(fee_percentage * tao_received.to_u64()); + if !amount_fees.is_zero() { + Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; + } + Ok(()) } } diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 0174d3e51a..67de5b092c 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -3,7 +3,7 @@ use approx::assert_abs_diff_eq; use frame_support::dispatch::{DispatchClass, GetDispatchInfo, Pays}; -use frame_support::sp_runtime::DispatchError; +use frame_support::sp_runtime::{DispatchError, Permill}; use frame_support::{assert_err, assert_noop, assert_ok, traits::Currency}; use frame_system::RawOrigin; use pallet_subtensor_swap::tick::TickIndex; @@ -5310,7 +5310,8 @@ fn test_add_stake_payable_is_ok() { let app_coldkey = U256::from(5); let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; let amount_stake = TaoBalance::from(min_tao_stake); - let amount_fees = 100_000; + let fee_percentage = Permill::from_percent(10); + let expected_fee = TaoBalance::from(fee_percentage * amount_stake.to_u64()); let owner_balance_before = amount_stake * 10.into(); let actor_balance_before = amount_stake * 100.into(); let app_owner_balance_before = ExistentialDeposit::get(); @@ -5321,28 +5322,28 @@ fn test_add_stake_payable_is_ok() { add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); - // Stake with paying fees + // Stake with paying fees (deducted from stake amount) assert_ok!(SubtensorModule::add_stake_payable( RuntimeOrigin::signed(actor_coldkey), subnet_owner_hotkey, netuid, amount_stake.into(), app_coldkey, - amount_fees.into() + fee_percentage, )); let app_owner_balance_after = Balances::free_balance(app_coldkey); let actor_balance_after = Balances::free_balance(actor_coldkey); assert_eq!( - app_owner_balance_before + amount_fees.into(), + app_owner_balance_before + expected_fee, app_owner_balance_after, "app owner balance after should include fees" ); assert_eq!( - actor_balance_before - amount_fees.into() - amount_stake.into(), + actor_balance_before - amount_stake, actor_balance_after, - "actor balance after be decreased by stake + fees" + "actor balance after be decreased by stake amount (fee deducted from it)" ); let events = System::events(); @@ -5353,7 +5354,7 @@ fn test_add_stake_payable_is_ok() { RuntimeEvent::SubtensorModule(Event::FeesTransferred(from, to, amount)) if from == &actor_coldkey && to == &app_coldkey - && *amount == amount_fees.into() + && *amount == expected_fee )), "FeesTransferred event should be emitted" ); @@ -5381,7 +5382,7 @@ fn test_add_stake_payable_atomicity() { let app_coldkey = U256::from(5); let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; let amount_stake = TaoBalance::from(min_tao_stake); - let amount_fees = 100_000; + let fee_percentage = Permill::from_percent(10); let actor_balance_before = amount_stake * 100.into(); let app_owner_balance_before = ExistentialDeposit::get(); @@ -5398,7 +5399,7 @@ fn test_add_stake_payable_atomicity() { invalid_netuid, amount_stake.into(), app_coldkey, - amount_fees.into() + fee_percentage, ), Error::::SubnetNotExists ); @@ -5416,7 +5417,8 @@ fn test_add_stake_payable_atomicity() { }); } -/// This test verifies if the stake + pay fees is working +/// This test verifies that add_stake_payable fails if the actor doesn't have enough TAO +/// to cover the staked amount (which now includes the fee deducted from it). /// /// cargo test --package pallet-subtensor --lib -- tests::staking::test_add_stake_payable_actor_insufficient_balance --exact --show-output #[test] @@ -5428,9 +5430,10 @@ fn test_add_stake_payable_actor_insufficient_balance() { let app_coldkey = U256::from(5); let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; let amount_stake = TaoBalance::from(min_tao_stake); - let amount_fees = 100_000; + let fee_percentage = Permill::from_percent(10); let owner_balance_before = amount_stake * 10.into(); - let actor_balance_before = amount_stake; // The actor doesn't have funds for fees + // Actor doesn't have enough to cover the requested stake amount. + let actor_balance_before = amount_stake - TaoBalance::from(1u64); let app_owner_balance_before = ExistentialDeposit::get(); // add network @@ -5439,7 +5442,7 @@ fn test_add_stake_payable_actor_insufficient_balance() { add_balance_to_coldkey_account(&actor_coldkey, actor_balance_before); add_balance_to_coldkey_account(&app_coldkey, app_owner_balance_before); - // Should fail because of insufficient balance to pay for fees + // Should fail because of insufficient balance for the stake amount assert_err!( SubtensorModule::add_stake_payable( RuntimeOrigin::signed(actor_coldkey), @@ -5447,7 +5450,7 @@ fn test_add_stake_payable_actor_insufficient_balance() { netuid, amount_stake.into(), app_coldkey, - amount_fees.into() + fee_percentage, ), Error::::NotEnoughBalanceToStake ); From 785e1d9ac0e021a9f95cba2f86a25efa7036a58a Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 30 Apr 2026 13:25:11 +0200 Subject: [PATCH 12/13] clippy --- pallets/subtensor/src/staking/add_stake.rs | 2 +- pallets/subtensor/src/staking/remove_stake.rs | 2 +- pallets/subtensor/src/tests/staking.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index 05d7055423..0323fc6e40 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -87,7 +87,7 @@ impl Pallet { Error::::NotEnoughBalanceToStake ); - let amount_fees = TaoBalance::from(fee_percentage * stake_to_be_added.to_u64()); + let amount_fees = TaoBalance::from(fee_percentage.mul_floor(stake_to_be_added.to_u64())); let stake_after_fees = stake_to_be_added.saturating_sub(amount_fees); if !amount_fees.is_zero() { diff --git a/pallets/subtensor/src/staking/remove_stake.rs b/pallets/subtensor/src/staking/remove_stake.rs index 79586b4e02..376f2e5e65 100644 --- a/pallets/subtensor/src/staking/remove_stake.rs +++ b/pallets/subtensor/src/staking/remove_stake.rs @@ -629,7 +629,7 @@ impl Pallet { let balance_after = Self::get_coldkey_balance(&coldkey); let tao_received = balance_after.saturating_sub(balance_before); - let amount_fees = TaoBalance::from(fee_percentage * tao_received.to_u64()); + let amount_fees = TaoBalance::from(fee_percentage.mul_floor(tao_received.to_u64())); if !amount_fees.is_zero() { Self::do_transfer_fees(&coldkey, coldkey_fees_tank, amount_fees)?; } diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 67de5b092c..6b4220a0ce 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -5311,7 +5311,7 @@ fn test_add_stake_payable_is_ok() { let min_tao_stake = DefaultMinStake::::get().to_u64() * 2; let amount_stake = TaoBalance::from(min_tao_stake); let fee_percentage = Permill::from_percent(10); - let expected_fee = TaoBalance::from(fee_percentage * amount_stake.to_u64()); + let expected_fee = TaoBalance::from(fee_percentage.mul_floor(amount_stake.to_u64())); let owner_balance_before = amount_stake * 10.into(); let actor_balance_before = amount_stake * 100.into(); let app_owner_balance_before = ExistentialDeposit::get(); From 00ec0923c6b7dd1788973205381fe566cc97d6ac Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 30 Apr 2026 13:45:37 +0200 Subject: [PATCH 13/13] - updated weights --- pallets/subtensor/src/weights.rs | 488 +++++++++++++++---------------- 1 file changed, 244 insertions(+), 244 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 295f3816c7..6f628c24ad 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -302,67 +302,67 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } - /// Storage: `System::Account` (r:4 w:4) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2280` - // Estimated: `11306` - // Minimum execution time: 450_873_000 picoseconds. - Weight::from_parts(465_204_000, 11306) - .saturating_add(T::DbWeight::get().reads(29_u64)) - .saturating_add(T::DbWeight::get().writes(17_u64)) - } + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2280` + // Estimated: `11306` + // Minimum execution time: 287_000_000 picoseconds. + Weight::from_parts(293_000_000, 11306) + .saturating_add(T::DbWeight::get().reads(29_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) + } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Axons` (r:1 w:1) @@ -1244,67 +1244,67 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(14_u64)) } - /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2288` - // Estimated: `10703` - // Minimum execution time: 436_172_000 picoseconds. - Weight::from_parts(452_705_000, 10703) - .saturating_add(T::DbWeight::get().reads(33_u64)) - .saturating_add(T::DbWeight::get().writes(15_u64)) - } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 269_000_000 picoseconds. + Weight::from_parts(272_000_000, 10703) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) + } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -2570,67 +2570,67 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(28_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } - /// Storage: `System::Account` (r:4 w:4) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2280` - // Estimated: `11306` - // Minimum execution time: 450_873_000 picoseconds. - Weight::from_parts(465_204_000, 11306) - .saturating_add(RocksDbWeight::get().reads(29_u64)) - .saturating_add(RocksDbWeight::get().writes(17_u64)) - } + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaInProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaInProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2280` + // Estimated: `11306` + // Minimum execution time: 287_000_000 picoseconds. + Weight::from_parts(293_000_000, 11306) + .saturating_add(RocksDbWeight::get().reads(29_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) + } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Axons` (r:1 w:1) @@ -3512,67 +3512,67 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(14_u64)) } - /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:1 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentTick` (r:1 w:1) - /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) - /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) - /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_stake_payable() -> Weight { - // Proof Size summary in bytes: - // Measured: `2288` - // Estimated: `10703` - // Minimum execution time: 436_172_000 picoseconds. - Weight::from_parts(452_705_000, 10703) - .saturating_add(RocksDbWeight::get().reads(33_u64)) - .saturating_add(RocksDbWeight::get().writes(15_u64)) - } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:1 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoProvided` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTaoProvided` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:1) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentTick` (r:1 w:1) + /// Proof: `Swap::CurrentTick` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Swap::TickIndexBitmapWords` (r:3 w:0) + /// Proof: `Swap::TickIndexBitmapWords` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) + /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetTaoFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_payable() -> Weight { + // Proof Size summary in bytes: + // Measured: `2288` + // Estimated: `10703` + // Minimum execution time: 269_000_000 picoseconds. + Weight::from_parts(272_000_000, 10703) + .saturating_add(RocksDbWeight::get().reads(33_u64)) + .saturating_add(RocksDbWeight::get().writes(15_u64)) + } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2)