From 844e6fede732ffda0ee6c2f7dd961c08f5d1d1c8 Mon Sep 17 00:00:00 2001 From: Landyn Date: Wed, 1 Apr 2026 11:07:56 -0500 Subject: [PATCH 01/15] Burn and Recycle Chain Exts --- chain-extensions/src/lib.rs | 193 ++++++++++++++++- chain-extensions/src/tests.rs | 359 ++++++++++++++++++++++++++++++++ chain-extensions/src/types.rs | 10 + contract-tests/bittensor/lib.rs | 84 ++++++++ docs/wasm-contracts.md | 7 + 5 files changed, 652 insertions(+), 1 deletion(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 14ea23d9c8..0cd1523cac 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -66,7 +66,10 @@ where Env: SubtensorExtensionEnv, <::Lookup as StaticLookup>::Source: From<::AccountId>, { - let func_id: FunctionId = env.func_id().try_into().map_err(|_| { + let raw_func_id = env.func_id(); + log::info!("chain_ext: dispatch called with raw func_id={raw_func_id}"); + let func_id: FunctionId = raw_func_id.try_into().map_err(|_| { + log::error!("chain_ext: invalid func_id={raw_func_id}, not in FunctionId enum"); DispatchError::Other( "Invalid function id - does not correspond to any registered function", ) @@ -523,6 +526,194 @@ where Ok(RetVal::Converging(Output::Success as u32)) } + FunctionId::RecycleAlphaV1 => { + let weight = Weight::from_parts(113_400_000, 0) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(4)); + + env.charge_weight(weight)?; + + let (hotkey, amount, netuid): (T::AccountId, AlphaBalance, NetUid) = + env.read_as()?; + + let caller = env.caller(); + + let alpha_available = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &caller, netuid, + ); + let actual_amount = amount.min(alpha_available); + + let call_result = pallet_subtensor::Pallet::::recycle_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + actual_amount, + netuid, + ); + + match call_result { + Ok(_) => { + env.write_output(&actual_amount.encode()) + .map_err(|_| DispatchError::Other("Failed to write output"))?; + Ok(RetVal::Converging(Output::Success as u32)) + } + Err(e) => { + let error_code = Output::from(e) as u32; + Ok(RetVal::Converging(error_code)) + } + } + } + FunctionId::BurnAlphaV1 => { + let weight = Weight::from_parts(112_200_000, 0) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(3)); + + env.charge_weight(weight)?; + + let (hotkey, amount, netuid): (T::AccountId, AlphaBalance, NetUid) = + env.read_as()?; + + let caller = env.caller(); + + let alpha_available = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &caller, netuid, + ); + let actual_amount = amount.min(alpha_available); + + let call_result = pallet_subtensor::Pallet::::burn_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + actual_amount, + netuid, + ); + + match call_result { + Ok(_) => { + env.write_output(&actual_amount.encode()) + .map_err(|_| DispatchError::Other("Failed to write output"))?; + Ok(RetVal::Converging(Output::Success as u32)) + } + Err(e) => { + let error_code = Output::from(e) as u32; + Ok(RetVal::Converging(error_code)) + } + } + } + FunctionId::AddStakeRecycleV1 => { + log::info!("chain_ext: AddStakeRecycleV1 called"); + + let weight = Weight::from_parts(454_200_000, 0) + .saturating_add(T::DbWeight::get().reads(33)) + .saturating_add(T::DbWeight::get().writes(19)); + + if let Err(e) = env.charge_weight(weight) { + log::error!("chain_ext: AddStakeRecycleV1 charge_weight failed: {e:?}"); + return Err(e); + } + + let input: Result<(T::AccountId, NetUid, TaoBalance), _> = env.read_as(); + let (hotkey, netuid, tao_amount) = match input { + Ok(v) => v, + Err(e) => { + log::error!("chain_ext: AddStakeRecycleV1 read_as failed: {e:?}"); + return Err(e); + } + }; + + let caller = env.caller(); + log::info!( + "chain_ext: AddStakeRecycleV1 caller={caller:?} hotkey={hotkey:?} netuid={netuid:?} tao={tao_amount:?}" + ); + + let alpha = pallet_subtensor::Pallet::::do_add_stake( + RawOrigin::Signed(caller.clone()).into(), + hotkey.clone(), + netuid, + tao_amount, + ); + + match alpha { + Ok(alpha) => { + log::info!( + "chain_ext: AddStakeRecycleV1 do_add_stake ok, alpha={alpha:?}" + ); + let recycle_result = pallet_subtensor::Pallet::::recycle_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + alpha, + netuid, + ); + + match recycle_result { + Ok(_) => { + log::info!("chain_ext: AddStakeRecycleV1 recycle ok"); + env.write_output(&alpha.encode()) + .map_err(|_| DispatchError::Other("Failed to write output"))?; + Ok(RetVal::Converging(Output::Success as u32)) + } + Err(e) => { + log::error!( + "chain_ext: AddStakeRecycleV1 recycle failed: {e:?}" + ); + let error_code = Output::from(e) as u32; + Ok(RetVal::Converging(error_code)) + } + } + } + Err(e) => { + log::error!("chain_ext: AddStakeRecycleV1 do_add_stake failed: {e:?}"); + let error_code = Output::from(e) as u32; + Ok(RetVal::Converging(error_code)) + } + } + } + FunctionId::AddStakeBurnV1 => { + let weight = Weight::from_parts(453_000_000, 0) + .saturating_add(T::DbWeight::get().reads(33)) + .saturating_add(T::DbWeight::get().writes(18)); + + env.charge_weight(weight)?; + + let (hotkey, netuid, tao_amount): (T::AccountId, NetUid, TaoBalance) = + env.read_as()?; + + let caller = env.caller(); + + let alpha = pallet_subtensor::Pallet::::do_add_stake( + RawOrigin::Signed(caller.clone()).into(), + hotkey.clone(), + netuid, + tao_amount, + ); + + match alpha { + Ok(alpha) => { + let burn_result = pallet_subtensor::Pallet::::burn_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + alpha, + netuid, + ); + + match burn_result { + Ok(_) => { + env.write_output(&alpha.encode()) + .map_err(|_| DispatchError::Other("Failed to write output"))?; + Ok(RetVal::Converging(Output::Success as u32)) + } + Err(e) => { + let error_code = Output::from(e) as u32; + Ok(RetVal::Converging(error_code)) + } + } + } + Err(e) => { + let error_code = Output::from(e) as u32; + Ok(RetVal::Converging(error_code)) + } + } + } } } } diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index b8956e8659..284e852f24 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -726,6 +726,365 @@ fn remove_proxy_success_removes_proxy_relationship() { }); } +#[test] +fn recycle_alpha_success_reduces_stake_and_returns_actual_amount() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(9001); + let owner_coldkey = U256::from(9002); + let coldkey = U256::from(9101); + let hotkey = U256::from(9102); + let min_stake = DefaultMinStake::::get(); + let stake_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(stake_amount_raw.saturating_add(1_000_000_000)), + ); + + assert_ok!(pallet_subtensor::Pallet::::add_stake( + RawOrigin::Signed(coldkey).into(), + hotkey, + netuid, + stake_amount_raw.into(), + )); + + let alpha_before = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_before > AlphaBalance::ZERO); + + let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); + + let recycle_amount: AlphaBalance = (alpha_before.to_u64() / 2).into(); + + let expected_weight = Weight::from_parts(113_400_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(4)); + + let mut env = MockEnv::new( + FunctionId::RecycleAlphaV1, + coldkey, + (hotkey, recycle_amount, netuid).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + assert_success(ret); + assert_eq!(env.charged_weight(), Some(expected_weight)); + + let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); + assert_eq!(returned_amount, recycle_amount); + + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_after < alpha_before); + + let alpha_out_after = pallet_subtensor::SubnetAlphaOut::::get(netuid); + assert!(alpha_out_after < alpha_out_before); + }); +} + +#[test] +fn recycle_alpha_on_root_subnet_returns_error() { + mock::new_test_ext(1).execute_with(|| { + let coldkey = U256::from(9201); + let hotkey = U256::from(9202); + + pallet_subtensor::Owner::::insert(hotkey, coldkey); + + let expected_weight = Weight::from_parts(113_400_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(4)); + + let mut env = MockEnv::new( + FunctionId::RecycleAlphaV1, + coldkey, + (hotkey, AlphaBalance::from(1_000u64), NetUid::ROOT).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + match ret { + RetVal::Converging(code) => { + assert_ne!( + code, + Output::Success as u32, + "should not succeed on root subnet" + ) + } + _ => panic!("unexpected return value"), + } + }); +} + +#[test] +fn burn_alpha_success_reduces_stake_and_returns_actual_amount() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(9301); + let owner_coldkey = U256::from(9302); + let coldkey = U256::from(9401); + let hotkey = U256::from(9402); + let min_stake = DefaultMinStake::::get(); + let stake_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(stake_amount_raw.saturating_add(1_000_000_000)), + ); + + assert_ok!(pallet_subtensor::Pallet::::add_stake( + RawOrigin::Signed(coldkey).into(), + hotkey, + netuid, + stake_amount_raw.into(), + )); + + let alpha_before = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_before > AlphaBalance::ZERO); + + let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); + + let burn_amount: AlphaBalance = (alpha_before.to_u64() / 2).into(); + + let expected_weight = Weight::from_parts(112_200_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(3)); + + let mut env = MockEnv::new( + FunctionId::BurnAlphaV1, + coldkey, + (hotkey, burn_amount, netuid).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + assert_success(ret); + assert_eq!(env.charged_weight(), Some(expected_weight)); + + let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); + assert_eq!(returned_amount, burn_amount); + + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_after < alpha_before); + + // Burn should NOT decrease SubnetAlphaOut (unlike recycle) + let alpha_out_after = pallet_subtensor::SubnetAlphaOut::::get(netuid); + assert_eq!(alpha_out_after, alpha_out_before); + }); +} + +#[test] +fn burn_alpha_on_nonexistent_subnet_returns_error() { + mock::new_test_ext(1).execute_with(|| { + let coldkey = U256::from(9501); + let hotkey = U256::from(9502); + + let expected_weight = Weight::from_parts(112_200_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(3)); + + let mut env = MockEnv::new( + FunctionId::BurnAlphaV1, + coldkey, + (hotkey, AlphaBalance::from(1_000u64), NetUid::from(999u16)).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + match ret { + RetVal::Converging(code) => { + assert_eq!( + code, + Output::SubnetNotExists as u32, + "expected subnet not exists error" + ) + } + _ => panic!("unexpected return value"), + } + }); +} + +#[test] +fn add_stake_recycle_success_atomically_stakes_and_recycles() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(9601); + let owner_coldkey = U256::from(9602); + let coldkey = U256::from(9701); + let hotkey = U256::from(9702); + let min_stake = DefaultMinStake::::get(); + let tao_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(tao_amount_raw.saturating_add(1_000_000_000)), + ); + + let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); + + let expected_weight = Weight::from_parts(454_200_000, 0) + .saturating_add(::DbWeight::get().reads(33)) + .saturating_add(::DbWeight::get().writes(19)); + + let mut env = MockEnv::new( + FunctionId::AddStakeRecycleV1, + coldkey, + (hotkey, netuid, TaoBalance::from(tao_amount_raw)).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + assert_success(ret); + assert_eq!(env.charged_weight(), Some(expected_weight)); + + let returned_alpha = AlphaBalance::decode(&mut env.output()).unwrap(); + assert!(returned_alpha > AlphaBalance::ZERO); + + // After atomic add+recycle, the stake should be zero (we recycled everything we added) + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_after.is_zero()); + + // SubnetAlphaOut should not have increased (recycle cancels out the add) + let alpha_out_after = pallet_subtensor::SubnetAlphaOut::::get(netuid); + assert!(alpha_out_after <= alpha_out_before); + }); +} + +#[test] +fn add_stake_burn_success_atomically_stakes_and_burns() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(9801); + let owner_coldkey = U256::from(9802); + let coldkey = U256::from(9901); + let hotkey = U256::from(9902); + let min_stake = DefaultMinStake::::get(); + let tao_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(tao_amount_raw.saturating_add(1_000_000_000)), + ); + + let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); + + let expected_weight = Weight::from_parts(453_000_000, 0) + .saturating_add(::DbWeight::get().reads(33)) + .saturating_add(::DbWeight::get().writes(18)); + + let mut env = MockEnv::new( + FunctionId::AddStakeBurnV1, + coldkey, + (hotkey, netuid, TaoBalance::from(tao_amount_raw)).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + assert_success(ret); + assert_eq!(env.charged_weight(), Some(expected_weight)); + + let returned_alpha = AlphaBalance::decode(&mut env.output()).unwrap(); + assert!(returned_alpha > AlphaBalance::ZERO); + + // After atomic add+burn, the stake should be zero + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_after.is_zero()); + + // SubnetAlphaOut should have increased (burn does NOT reduce AlphaOut) + let alpha_out_after = pallet_subtensor::SubnetAlphaOut::::get(netuid); + assert!(alpha_out_after > alpha_out_before); + }); +} + +#[test] +fn add_stake_recycle_with_insufficient_balance_returns_error() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(10001); + let owner_coldkey = U256::from(10002); + let coldkey = U256::from(10101); + let hotkey = U256::from(10102); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + // Don't fund the coldkey - should fail with balance error + + let expected_weight = Weight::from_parts(454_200_000, 0) + .saturating_add(::DbWeight::get().reads(33)) + .saturating_add(::DbWeight::get().writes(19)); + + let mut env = MockEnv::new( + FunctionId::AddStakeRecycleV1, + coldkey, + (hotkey, netuid, TaoBalance::from(100_000_000_000_u64)).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + match ret { + RetVal::Converging(code) => { + assert_ne!(code, Output::Success as u32, "should not succeed") + } + _ => panic!("unexpected return value"), + } + }); +} + impl MockEnv { fn new(func_id: FunctionId, caller: AccountId, input: Vec) -> Self { Self { diff --git a/chain-extensions/src/types.rs b/chain-extensions/src/types.rs index ee6298ad5b..424b4848d9 100644 --- a/chain-extensions/src/types.rs +++ b/chain-extensions/src/types.rs @@ -21,6 +21,10 @@ pub enum FunctionId { AddProxyV1 = 13, RemoveProxyV1 = 14, GetAlphaPriceV1 = 15, + RecycleAlphaV1 = 16, + BurnAlphaV1 = 17, + AddStakeRecycleV1 = 18, + AddStakeBurnV1 = 19, } #[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, Debug)] @@ -66,6 +70,10 @@ pub enum Output { ProxyNoSelfProxy = 18, /// Proxy relationship not found ProxyNotFound = 19, + /// Cannot burn or recycle on root subnet + CannotBurnOrRecycleOnRootSubnet = 20, + /// Subtoken is disabled for this subnet + SubtokenDisabled = 21, } impl From for Output { @@ -93,6 +101,8 @@ impl From for Output { Some("Duplicate") => Output::ProxyDuplicate, Some("NoSelfProxy") => Output::ProxyNoSelfProxy, Some("NotFound") => Output::ProxyNotFound, + Some("CannotBurnOrRecycleOnRootSubnet") => Output::CannotBurnOrRecycleOnRootSubnet, + Some("SubtokenDisabled") => Output::SubtokenDisabled, _ => Output::RuntimeError, } } diff --git a/contract-tests/bittensor/lib.rs b/contract-tests/bittensor/lib.rs index 8867d017d8..a81066d5e3 100755 --- a/contract-tests/bittensor/lib.rs +++ b/contract-tests/bittensor/lib.rs @@ -22,6 +22,10 @@ pub enum FunctionId { AddProxyV1 = 13, RemoveProxyV1 = 14, GetAlphaPriceV1 = 15, + RecycleAlphaV1 = 16, + BurnAlphaV1 = 17, + AddStakeRecycleV1 = 18, + AddStakeBurnV1 = 19, } #[ink::chain_extension(extension = 0x1000)] @@ -130,6 +134,34 @@ pub trait RuntimeReadWrite { #[ink(function = 15)] fn get_alpha_price(netuid: u16) -> u64; + + #[ink(function = 16)] + fn recycle_alpha( + hotkey: ::AccountId, + amount: u64, + netuid: u16, + ) -> u64; + + #[ink(function = 17)] + fn burn_alpha( + hotkey: ::AccountId, + amount: u64, + netuid: u16, + ) -> u64; + + #[ink(function = 18)] + fn add_stake_recycle( + hotkey: ::AccountId, + netuid: u16, + amount: u64, + ) -> u64; + + #[ink(function = 19)] + fn add_stake_burn( + hotkey: ::AccountId, + netuid: u16, + amount: u64, + ) -> u64; } #[ink::scale_derive(Encode, Decode, TypeInfo)] @@ -412,5 +444,57 @@ mod bittensor { .get_alpha_price(netuid) .map_err(|_e| ReadWriteErrorCode::ReadFailed) } + + #[ink(message)] + pub fn recycle_alpha( + &self, + hotkey: [u8; 32], + amount: u64, + netuid: u16, + ) -> Result { + self.env() + .extension() + .recycle_alpha(hotkey.into(), amount, netuid) + .map_err(|_e| ReadWriteErrorCode::WriteFailed) + } + + #[ink(message)] + pub fn burn_alpha( + &self, + hotkey: [u8; 32], + amount: u64, + netuid: u16, + ) -> Result { + self.env() + .extension() + .burn_alpha(hotkey.into(), amount, netuid) + .map_err(|_e| ReadWriteErrorCode::WriteFailed) + } + + #[ink(message)] + pub fn add_stake_recycle( + &self, + hotkey: [u8; 32], + netuid: u16, + amount: u64, + ) -> Result { + self.env() + .extension() + .add_stake_recycle(hotkey.into(), netuid, amount) + .map_err(|_e| ReadWriteErrorCode::WriteFailed) + } + + #[ink(message)] + pub fn add_stake_burn( + &self, + hotkey: [u8; 32], + netuid: u16, + amount: u64, + ) -> Result { + self.env() + .extension() + .add_stake_burn(hotkey.into(), netuid, amount) + .map_err(|_e| ReadWriteErrorCode::WriteFailed) + } } } diff --git a/docs/wasm-contracts.md b/docs/wasm-contracts.md index d3a6b5637f..5e3f202688 100644 --- a/docs/wasm-contracts.md +++ b/docs/wasm-contracts.md @@ -43,6 +43,11 @@ Subtensor provides a custom chain extension that allows smart contracts to inter | 12 | `set_coldkey_auto_stake_hotkey` | Configure automatic stake destination | `(NetUid, AccountId)` | Error code | | 13 | `add_proxy` | Add a staking proxy for the caller | `(AccountId)` | Error code | | 14 | `remove_proxy` | Remove a staking proxy for the caller | `(AccountId)` | Error code | +| 15 | `get_alpha_price` | Query the current alpha price for a subnet | `(NetUid)` | `u64` (price × 10⁹) | +| 16 | `recycle_alpha` | Recycle alpha stake, reducing SubnetAlphaOut (supply reduction) | `(AccountId, AlphaBalance, NetUid)` | `u64` (actual amount recycled) | +| 17 | `burn_alpha` | Burn alpha stake without reducing SubnetAlphaOut (supply neutral) | `(AccountId, AlphaBalance, NetUid)` | `u64` (actual amount burned) | +| 18 | `add_stake_recycle` | Atomically add stake then recycle the resulting alpha | `(AccountId, NetUid, TaoBalance)` | `u64` (alpha amount recycled) | +| 19 | `add_stake_burn` | Atomically add stake then burn the resulting alpha | `(AccountId, NetUid, TaoBalance)` | `u64` (alpha amount burned) | Example usage in your ink! contract: ```rust @@ -85,6 +90,8 @@ Chain extension functions that modify state return error codes as `u32` values. | 17 | `ProxyDuplicate` | Proxy already exists | | 18 | `ProxyNoSelfProxy` | Cannot add self as proxy | | 19 | `ProxyNotFound` | Proxy relationship not found | +| 20 | `CannotBurnOrRecycleOnRootSubnet` | Cannot burn or recycle on the root subnet | +| 21 | `SubtokenDisabled` | Subtoken is not enabled for the specified subnet | ### Call Filter From 35c36d57d4ec3b7c8918da884b35841711de41a0 Mon Sep 17 00:00:00 2001 From: Landyn Date: Wed, 1 Apr 2026 11:26:42 -0500 Subject: [PATCH 02/15] Remove debug logging from chain extension dispatch Strip development log::info!/log::error! calls from dispatch entry and AddStakeRecycleV1 handler. Normalize AddStakeRecycleV1 to use the same concise ? pattern as all other handlers. --- chain-extensions/src/lib.rs | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 0cd1523cac..c4bb55f4de 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -66,10 +66,7 @@ where Env: SubtensorExtensionEnv, <::Lookup as StaticLookup>::Source: From<::AccountId>, { - let raw_func_id = env.func_id(); - log::info!("chain_ext: dispatch called with raw func_id={raw_func_id}"); - let func_id: FunctionId = raw_func_id.try_into().map_err(|_| { - log::error!("chain_ext: invalid func_id={raw_func_id}, not in FunctionId enum"); + let func_id: FunctionId = env.func_id().try_into().map_err(|_| { DispatchError::Other( "Invalid function id - does not correspond to any registered function", ) @@ -601,30 +598,16 @@ where } } FunctionId::AddStakeRecycleV1 => { - log::info!("chain_ext: AddStakeRecycleV1 called"); - let weight = Weight::from_parts(454_200_000, 0) .saturating_add(T::DbWeight::get().reads(33)) .saturating_add(T::DbWeight::get().writes(19)); - if let Err(e) = env.charge_weight(weight) { - log::error!("chain_ext: AddStakeRecycleV1 charge_weight failed: {e:?}"); - return Err(e); - } + env.charge_weight(weight)?; - let input: Result<(T::AccountId, NetUid, TaoBalance), _> = env.read_as(); - let (hotkey, netuid, tao_amount) = match input { - Ok(v) => v, - Err(e) => { - log::error!("chain_ext: AddStakeRecycleV1 read_as failed: {e:?}"); - return Err(e); - } - }; + let (hotkey, netuid, tao_amount): (T::AccountId, NetUid, TaoBalance) = + env.read_as()?; let caller = env.caller(); - log::info!( - "chain_ext: AddStakeRecycleV1 caller={caller:?} hotkey={hotkey:?} netuid={netuid:?} tao={tao_amount:?}" - ); let alpha = pallet_subtensor::Pallet::::do_add_stake( RawOrigin::Signed(caller.clone()).into(), @@ -635,9 +618,6 @@ where match alpha { Ok(alpha) => { - log::info!( - "chain_ext: AddStakeRecycleV1 do_add_stake ok, alpha={alpha:?}" - ); let recycle_result = pallet_subtensor::Pallet::::recycle_alpha( RawOrigin::Signed(caller).into(), hotkey, @@ -647,22 +627,17 @@ where match recycle_result { Ok(_) => { - log::info!("chain_ext: AddStakeRecycleV1 recycle ok"); env.write_output(&alpha.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; Ok(RetVal::Converging(Output::Success as u32)) } Err(e) => { - log::error!( - "chain_ext: AddStakeRecycleV1 recycle failed: {e:?}" - ); let error_code = Output::from(e) as u32; Ok(RetVal::Converging(error_code)) } } } Err(e) => { - log::error!("chain_ext: AddStakeRecycleV1 do_add_stake failed: {e:?}"); let error_code = Output::from(e) as u32; Ok(RetVal::Converging(error_code)) } From 0ea1a4d01d2e6c2f06c6bf95214c576b2c8fda07 Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 3 Apr 2026 11:12:44 -0500 Subject: [PATCH 03/15] Additional unit tests: Root burn test, Zero amt test, Amount clamping test --- chain-extensions/src/tests.rs | 163 ++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index 284e852f24..c997986503 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1085,6 +1085,169 @@ fn add_stake_recycle_with_insufficient_balance_returns_error() { }); } +#[test] +fn recycle_alpha_clamps_to_available_when_amount_exceeds_stake() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(11001); + let owner_coldkey = U256::from(11002); + let coldkey = U256::from(11101); + let hotkey = U256::from(11102); + let min_stake = DefaultMinStake::::get(); + let stake_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(stake_amount_raw.saturating_add(1_000_000_000)), + ); + + assert_ok!(pallet_subtensor::Pallet::::add_stake( + RawOrigin::Signed(coldkey).into(), + hotkey, + netuid, + stake_amount_raw.into(), + )); + + let alpha_before = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_before > AlphaBalance::ZERO); + + // Request way more than available — should clamp to alpha_before + let huge_amount = AlphaBalance::from(u64::MAX); + + let expected_weight = Weight::from_parts(113_400_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(4)); + + let mut env = MockEnv::new( + FunctionId::RecycleAlphaV1, + coldkey, + (hotkey, huge_amount, netuid).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + assert_success(ret); + + let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); + assert_eq!(returned_amount, alpha_before, "should clamp to available alpha"); + + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_after.is_zero(), "all alpha should be recycled"); + }); +} + +#[test] +fn burn_alpha_on_root_subnet_returns_error() { + mock::new_test_ext(1).execute_with(|| { + let coldkey = U256::from(11201); + let hotkey = U256::from(11202); + + pallet_subtensor::Owner::::insert(hotkey, coldkey); + + let expected_weight = Weight::from_parts(112_200_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(3)); + + let mut env = MockEnv::new( + FunctionId::BurnAlphaV1, + coldkey, + (hotkey, AlphaBalance::from(1_000u64), NetUid::ROOT).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + match ret { + RetVal::Converging(code) => { + assert_ne!( + code, + Output::Success as u32, + "should not succeed on root subnet" + ) + } + _ => panic!("unexpected return value"), + } + }); +} + +#[test] +fn burn_alpha_clamps_to_available_when_amount_exceeds_stake() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(11301); + let owner_coldkey = U256::from(11302); + let coldkey = U256::from(11401); + let hotkey = U256::from(11402); + let min_stake = DefaultMinStake::::get(); + let stake_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + mock::setup_reserves( + netuid, + TaoBalance::from(130_000_000_000_u64), + AlphaBalance::from(110_000_000_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(stake_amount_raw.saturating_add(1_000_000_000)), + ); + + assert_ok!(pallet_subtensor::Pallet::::add_stake( + RawOrigin::Signed(coldkey).into(), + hotkey, + netuid, + stake_amount_raw.into(), + )); + + let alpha_before = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_before > AlphaBalance::ZERO); + + // Request way more than available — should clamp to alpha_before + let huge_amount = AlphaBalance::from(u64::MAX); + + let expected_weight = Weight::from_parts(112_200_000, 0) + .saturating_add(::DbWeight::get().reads(10)) + .saturating_add(::DbWeight::get().writes(3)); + + let mut env = MockEnv::new( + FunctionId::BurnAlphaV1, + coldkey, + (hotkey, huge_amount, netuid).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + assert_success(ret); + + let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); + assert_eq!(returned_amount, alpha_before, "should clamp to available alpha"); + + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + assert!(alpha_after.is_zero(), "all alpha should be burned"); + }); +} + impl MockEnv { fn new(func_id: FunctionId, caller: AccountId, input: Vec) -> Self { Self { From 50dbdff440775e0b26198107969c6bd954a5bccd Mon Sep 17 00:00:00 2001 From: Landyn Date: Mon, 6 Apr 2026 19:40:01 -0500 Subject: [PATCH 04/15] cargo fmt fix --- chain-extensions/src/tests.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index c997986503..fd08232dda 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1140,7 +1140,10 @@ fn recycle_alpha_clamps_to_available_when_amount_exceeds_stake() { assert_success(ret); let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); - assert_eq!(returned_amount, alpha_before, "should clamp to available alpha"); + assert_eq!( + returned_amount, alpha_before, + "should clamp to available alpha" + ); let alpha_after = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -1238,7 +1241,10 @@ fn burn_alpha_clamps_to_available_when_amount_exceeds_stake() { assert_success(ret); let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); - assert_eq!(returned_amount, alpha_before, "should clamp to available alpha"); + assert_eq!( + returned_amount, alpha_before, + "should clamp to available alpha" + ); let alpha_after = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( From 8bcbe494f7542147cbe91861bc49a99bd9a513f4 Mon Sep 17 00:00:00 2001 From: Landyn Date: Tue, 7 Apr 2026 09:26:08 -0500 Subject: [PATCH 05/15] Address review: remove redundant clamping, add atomicity --- chain-extensions/src/lib.rs | 121 +++++++++++++--------------- chain-extensions/src/tests.rs | 146 +++++++++++++++++++++++++++++++++- 2 files changed, 197 insertions(+), 70 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index c4bb55f4de..1df272fc1d 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -9,6 +9,7 @@ pub mod types; use crate::types::{FunctionId, Output}; use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::storage::{TransactionOutcome, transactional}; use frame_support::{DebugNoBound, traits::Get}; use frame_system::RawOrigin; use pallet_contracts::chain_extension::{ @@ -535,22 +536,16 @@ where let caller = env.caller(); - let alpha_available = - pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( - &hotkey, &caller, netuid, - ); - let actual_amount = amount.min(alpha_available); - let call_result = pallet_subtensor::Pallet::::recycle_alpha( RawOrigin::Signed(caller).into(), hotkey, - actual_amount, + amount, netuid, ); match call_result { Ok(_) => { - env.write_output(&actual_amount.encode()) + env.write_output(&amount.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; Ok(RetVal::Converging(Output::Success as u32)) } @@ -572,22 +567,16 @@ where let caller = env.caller(); - let alpha_available = - pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( - &hotkey, &caller, netuid, - ); - let actual_amount = amount.min(alpha_available); - let call_result = pallet_subtensor::Pallet::::burn_alpha( RawOrigin::Signed(caller).into(), hotkey, - actual_amount, + amount, netuid, ); match call_result { Ok(_) => { - env.write_output(&actual_amount.encode()) + env.write_output(&amount.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; Ok(RetVal::Converging(Output::Success as u32)) } @@ -609,33 +598,33 @@ where let caller = env.caller(); - let alpha = pallet_subtensor::Pallet::::do_add_stake( - RawOrigin::Signed(caller.clone()).into(), - hotkey.clone(), - netuid, - tao_amount, - ); + let result = transactional::with_transaction(|| { + let alpha = match pallet_subtensor::Pallet::::do_add_stake( + RawOrigin::Signed(caller.clone()).into(), + hotkey.clone(), + netuid, + tao_amount, + ) { + Ok(a) => a, + Err(e) => return TransactionOutcome::Rollback(Err(e)), + }; + + match pallet_subtensor::Pallet::::recycle_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + alpha, + netuid, + ) { + Ok(_) => TransactionOutcome::Commit(Ok(alpha)), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }); - match alpha { + match result { Ok(alpha) => { - let recycle_result = pallet_subtensor::Pallet::::recycle_alpha( - RawOrigin::Signed(caller).into(), - hotkey, - alpha, - netuid, - ); - - match recycle_result { - Ok(_) => { - env.write_output(&alpha.encode()) - .map_err(|_| DispatchError::Other("Failed to write output"))?; - Ok(RetVal::Converging(Output::Success as u32)) - } - Err(e) => { - let error_code = Output::from(e) as u32; - Ok(RetVal::Converging(error_code)) - } - } + env.write_output(&alpha.encode()) + .map_err(|_| DispatchError::Other("Failed to write output"))?; + Ok(RetVal::Converging(Output::Success as u32)) } Err(e) => { let error_code = Output::from(e) as u32; @@ -655,33 +644,33 @@ where let caller = env.caller(); - let alpha = pallet_subtensor::Pallet::::do_add_stake( - RawOrigin::Signed(caller.clone()).into(), - hotkey.clone(), - netuid, - tao_amount, - ); + let result = transactional::with_transaction(|| { + let alpha = match pallet_subtensor::Pallet::::do_add_stake( + RawOrigin::Signed(caller.clone()).into(), + hotkey.clone(), + netuid, + tao_amount, + ) { + Ok(a) => a, + Err(e) => return TransactionOutcome::Rollback(Err(e)), + }; + + match pallet_subtensor::Pallet::::burn_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + alpha, + netuid, + ) { + Ok(_) => TransactionOutcome::Commit(Ok(alpha)), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }); - match alpha { + match result { Ok(alpha) => { - let burn_result = pallet_subtensor::Pallet::::burn_alpha( - RawOrigin::Signed(caller).into(), - hotkey, - alpha, - netuid, - ); - - match burn_result { - Ok(_) => { - env.write_output(&alpha.encode()) - .map_err(|_| DispatchError::Other("Failed to write output"))?; - Ok(RetVal::Converging(Output::Success as u32)) - } - Err(e) => { - let error_code = Output::from(e) as u32; - Ok(RetVal::Converging(error_code)) - } - } + env.write_output(&alpha.encode()) + .map_err(|_| DispatchError::Other("Failed to write output"))?; + Ok(RetVal::Converging(Output::Success as u32)) } Err(e) => { let error_code = Output::from(e) as u32; diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index fd08232dda..55db1d2c2e 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1141,8 +1141,8 @@ fn recycle_alpha_clamps_to_available_when_amount_exceeds_stake() { let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); assert_eq!( - returned_amount, alpha_before, - "should clamp to available alpha" + returned_amount, huge_amount, + "should return requested amount" ); let alpha_after = @@ -1242,8 +1242,8 @@ fn burn_alpha_clamps_to_available_when_amount_exceeds_stake() { let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); assert_eq!( - returned_amount, alpha_before, - "should clamp to available alpha" + returned_amount, huge_amount, + "should return requested amount" ); let alpha_after = @@ -1321,6 +1321,144 @@ fn assert_success(ret: RetVal) { } } +#[test] +fn add_stake_recycle_rollback_on_recycle_failure() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(12001); + let owner_coldkey = U256::from(12002); + let coldkey = U256::from(12101); + let hotkey = U256::from(12102); + let min_stake = DefaultMinStake::::get(); + let tao_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + + // Set up very low reserves so recycle will fail with InsufficientLiquidity + mock::setup_reserves( + netuid, + TaoBalance::from(1_000_u64), + AlphaBalance::from(1_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(tao_amount_raw.saturating_add(1_000_000_000)), + ); + + let balance_before = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); + let alpha_before = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + + let expected_weight = Weight::from_parts(454_200_000, 0) + .saturating_add(::DbWeight::get().reads(33)) + .saturating_add(::DbWeight::get().writes(19)); + + let mut env = MockEnv::new( + FunctionId::AddStakeRecycleV1, + coldkey, + (hotkey, netuid, TaoBalance::from(tao_amount_raw)).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + match ret { + RetVal::Converging(code) => { + assert_ne!(code, Output::Success as u32, "should not succeed") + } + _ => panic!("unexpected return value"), + } + + // Verify full rollback: balance and stake unchanged + let balance_after = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + + assert_eq!( + balance_before, balance_after, + "balance should be unchanged after rollback" + ); + assert_eq!( + alpha_before, alpha_after, + "stake should be unchanged after rollback" + ); + }); +} + +#[test] +fn add_stake_burn_rollback_on_burn_failure() { + mock::new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(12201); + let owner_coldkey = U256::from(12202); + let coldkey = U256::from(12301); + let hotkey = U256::from(12302); + let min_stake = DefaultMinStake::::get(); + let tao_amount_raw = min_stake.to_u64().saturating_mul(200); + + let netuid = mock::add_dynamic_network(&owner_hotkey, &owner_coldkey); + + // Set up very low reserves so burn will fail with InsufficientLiquidity + mock::setup_reserves( + netuid, + TaoBalance::from(1_000_u64), + AlphaBalance::from(1_000_u64), + ); + + mock::register_ok_neuron(netuid, hotkey, coldkey, 0); + + pallet_subtensor::Pallet::::add_balance_to_coldkey_account( + &coldkey, + TaoBalance::from(tao_amount_raw.saturating_add(1_000_000_000)), + ); + + let balance_before = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); + let alpha_before = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + + let expected_weight = Weight::from_parts(453_000_000, 0) + .saturating_add(::DbWeight::get().reads(33)) + .saturating_add(::DbWeight::get().writes(18)); + + let mut env = MockEnv::new( + FunctionId::AddStakeBurnV1, + coldkey, + (hotkey, netuid, TaoBalance::from(tao_amount_raw)).encode(), + ) + .with_expected_weight(expected_weight); + + let ret = SubtensorChainExtension::::dispatch(&mut env).unwrap(); + match ret { + RetVal::Converging(code) => { + assert_ne!(code, Output::Success as u32, "should not succeed") + } + _ => panic!("unexpected return value"), + } + + // Verify full rollback: balance and stake unchanged + let balance_after = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); + let alpha_after = + pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, &coldkey, netuid, + ); + + assert_eq!( + balance_before, balance_after, + "balance should be unchanged after rollback" + ); + assert_eq!( + alpha_before, alpha_after, + "stake should be unchanged after rollback" + ); + }); +} + #[test] fn get_stake_info_returns_encoded_runtime_value() { mock::new_test_ext(1).execute_with(|| { From 71ab22e22c96148ffbcf7dd004ed6946c9ffe1aa Mon Sep 17 00:00:00 2001 From: Landyn Date: Wed, 8 Apr 2026 11:14:28 -0500 Subject: [PATCH 06/15] Return actual recycled/burned alpha amount from pallet --- chain-extensions/src/lib.rs | 20 +++++++++---------- chain-extensions/src/tests.rs | 8 ++++---- pallets/subtensor/src/macros/dispatches.rs | 4 ++-- .../subtensor/src/staking/recycle_alpha.rs | 16 +++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 1df272fc1d..954176952f 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -536,7 +536,7 @@ where let caller = env.caller(); - let call_result = pallet_subtensor::Pallet::::recycle_alpha( + let call_result = pallet_subtensor::Pallet::::do_recycle_alpha( RawOrigin::Signed(caller).into(), hotkey, amount, @@ -544,8 +544,8 @@ where ); match call_result { - Ok(_) => { - env.write_output(&amount.encode()) + Ok(real_amount) => { + env.write_output(&real_amount.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; Ok(RetVal::Converging(Output::Success as u32)) } @@ -567,7 +567,7 @@ where let caller = env.caller(); - let call_result = pallet_subtensor::Pallet::::burn_alpha( + let call_result = pallet_subtensor::Pallet::::do_burn_alpha( RawOrigin::Signed(caller).into(), hotkey, amount, @@ -575,8 +575,8 @@ where ); match call_result { - Ok(_) => { - env.write_output(&amount.encode()) + Ok(real_amount) => { + env.write_output(&real_amount.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; Ok(RetVal::Converging(Output::Success as u32)) } @@ -609,13 +609,13 @@ where Err(e) => return TransactionOutcome::Rollback(Err(e)), }; - match pallet_subtensor::Pallet::::recycle_alpha( + match pallet_subtensor::Pallet::::do_recycle_alpha( RawOrigin::Signed(caller).into(), hotkey, alpha, netuid, ) { - Ok(_) => TransactionOutcome::Commit(Ok(alpha)), + Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), Err(e) => TransactionOutcome::Rollback(Err(e)), } }); @@ -655,13 +655,13 @@ where Err(e) => return TransactionOutcome::Rollback(Err(e)), }; - match pallet_subtensor::Pallet::::burn_alpha( + match pallet_subtensor::Pallet::::do_burn_alpha( RawOrigin::Signed(caller).into(), hotkey, alpha, netuid, ) { - Ok(_) => TransactionOutcome::Commit(Ok(alpha)), + Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), Err(e) => TransactionOutcome::Rollback(Err(e)), } }); diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index 55db1d2c2e..e468270daf 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1141,8 +1141,8 @@ fn recycle_alpha_clamps_to_available_when_amount_exceeds_stake() { let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); assert_eq!( - returned_amount, huge_amount, - "should return requested amount" + returned_amount, alpha_before, + "should return actual clamped amount, not requested amount" ); let alpha_after = @@ -1242,8 +1242,8 @@ fn burn_alpha_clamps_to_available_when_amount_exceeds_stake() { let returned_amount = AlphaBalance::decode(&mut env.output()).unwrap(); assert_eq!( - returned_amount, huge_amount, - "should return requested amount" + returned_amount, alpha_before, + "should return actual clamped amount, not requested amount" ); let alpha_after = diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index b098b58425..af503a557d 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -1857,7 +1857,7 @@ mod dispatches { amount: AlphaBalance, netuid: NetUid, ) -> DispatchResult { - Self::do_recycle_alpha(origin, hotkey, amount, netuid) + Self::do_recycle_alpha(origin, hotkey, amount, netuid).map(|_| ()) } /// Burns alpha from a cold/hot key pair without reducing `AlphaOut` @@ -1878,7 +1878,7 @@ mod dispatches { amount: AlphaBalance, netuid: NetUid, ) -> DispatchResult { - Self::do_burn_alpha(origin, hotkey, amount, netuid) + Self::do_burn_alpha(origin, hotkey, amount, netuid).map(|_| ()) } /// Sets the pending childkey cooldown (in blocks). Root only. diff --git a/pallets/subtensor/src/staking/recycle_alpha.rs b/pallets/subtensor/src/staking/recycle_alpha.rs index bb93c12818..96633eaebf 100644 --- a/pallets/subtensor/src/staking/recycle_alpha.rs +++ b/pallets/subtensor/src/staking/recycle_alpha.rs @@ -14,13 +14,13 @@ impl Pallet { /// /// # Returns /// - /// * `DispatchResult` - Success or error - pub(crate) fn do_recycle_alpha( + /// * `Result` - The actual amount recycled, or error + pub fn do_recycle_alpha( origin: OriginFor, hotkey: T::AccountId, amount: AlphaBalance, netuid: NetUid, - ) -> DispatchResult { + ) -> Result { let coldkey: T::AccountId = ensure_signed(origin)?; ensure!(Self::if_subnet_exist(netuid), Error::::SubnetNotExists); @@ -58,7 +58,7 @@ impl Pallet { Self::deposit_event(Event::AlphaRecycled(coldkey, hotkey, amount, netuid)); - Ok(()) + Ok(amount) } /// Burns alpha from a cold/hot key pair without reducing AlphaOut @@ -72,13 +72,13 @@ impl Pallet { /// /// # Returns /// - /// * `DispatchResult` - Success or error - pub(crate) fn do_burn_alpha( + /// * `Result` - The actual amount burned, or error + pub fn do_burn_alpha( origin: OriginFor, hotkey: T::AccountId, amount: AlphaBalance, netuid: NetUid, - ) -> DispatchResult { + ) -> Result { let coldkey = ensure_signed(origin)?; ensure!(Self::if_subnet_exist(netuid), Error::::SubnetNotExists); @@ -116,7 +116,7 @@ impl Pallet { // Deposit event Self::deposit_event(Event::AlphaBurned(coldkey, hotkey, amount, netuid)); - Ok(()) + Ok(amount) } pub(crate) fn do_add_stake_burn( origin: OriginFor, From c519e0a385bc548069a28b4775f1691ea05a1e11 Mon Sep 17 00:00:00 2001 From: Landyn Date: Mon, 13 Apr 2026 19:48:27 -0500 Subject: [PATCH 07/15] Use pallet WeightInfo trait for recycle/burn chain extensions Replaces hardcoded Weight::from_parts values with calls to pallet_subtensor::weights::WeightInfo, matching the pattern junius introduced in PR 2550. Weights now auto-track benchmark updates. AddStakeRecycleV1 sums add_stake() + recycle_alpha() since the pallet has no add_stake_recycle weight; AddStakeBurnV1 uses add_stake_burn() directly (1:1 with pallet's do_add_stake_burn). --- chain-extensions/src/lib.rs | 24 ++++++------ chain-extensions/src/tests.rs | 70 +++++++++++++++++------------------ 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 954176952f..f2ef5bd96a 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -15,6 +15,7 @@ use frame_system::RawOrigin; use pallet_contracts::chain_extension::{ BufInBufOutState, ChainExtension, Environment, Ext, InitState, RetVal, SysConfig, }; +use pallet_subtensor::weights::WeightInfo as SubtensorWeightInfo; use pallet_subtensor_proxy as pallet_proxy; use pallet_subtensor_proxy::WeightInfo; use sp_runtime::{DispatchError, Weight, traits::StaticLookup}; @@ -525,9 +526,8 @@ where Ok(RetVal::Converging(Output::Success as u32)) } FunctionId::RecycleAlphaV1 => { - let weight = Weight::from_parts(113_400_000, 0) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(4)); + let weight = + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); env.charge_weight(weight)?; @@ -556,9 +556,8 @@ where } } FunctionId::BurnAlphaV1 => { - let weight = Weight::from_parts(112_200_000, 0) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(3)); + let weight = + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); env.charge_weight(weight)?; @@ -587,9 +586,11 @@ where } } FunctionId::AddStakeRecycleV1 => { - let weight = Weight::from_parts(454_200_000, 0) - .saturating_add(T::DbWeight::get().reads(33)) - .saturating_add(T::DbWeight::get().writes(19)); + let weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), + ); env.charge_weight(weight)?; @@ -633,9 +634,8 @@ where } } FunctionId::AddStakeBurnV1 => { - let weight = Weight::from_parts(453_000_000, 0) - .saturating_add(T::DbWeight::get().reads(33)) - .saturating_add(T::DbWeight::get().writes(18)); + let weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake_burn(); env.charge_weight(weight)?; diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index e468270daf..aef12f1e0d 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -8,6 +8,7 @@ use frame_support::{assert_ok, weights::Weight}; use frame_system::RawOrigin; use pallet_contracts::chain_extension::RetVal; use pallet_subtensor::DefaultMinStake; +use pallet_subtensor::weights::WeightInfo as SubtensorWeightInfo; use sp_core::Get; use sp_core::U256; use sp_runtime::DispatchError; @@ -767,9 +768,8 @@ fn recycle_alpha_success_reduces_stake_and_returns_actual_amount() { let recycle_amount: AlphaBalance = (alpha_before.to_u64() / 2).into(); - let expected_weight = Weight::from_parts(113_400_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(4)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); let mut env = MockEnv::new( FunctionId::RecycleAlphaV1, @@ -804,9 +804,8 @@ fn recycle_alpha_on_root_subnet_returns_error() { pallet_subtensor::Owner::::insert(hotkey, coldkey); - let expected_weight = Weight::from_parts(113_400_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(4)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); let mut env = MockEnv::new( FunctionId::RecycleAlphaV1, @@ -870,9 +869,8 @@ fn burn_alpha_success_reduces_stake_and_returns_actual_amount() { let burn_amount: AlphaBalance = (alpha_before.to_u64() / 2).into(); - let expected_weight = Weight::from_parts(112_200_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(3)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); let mut env = MockEnv::new( FunctionId::BurnAlphaV1, @@ -906,9 +904,8 @@ fn burn_alpha_on_nonexistent_subnet_returns_error() { let coldkey = U256::from(9501); let hotkey = U256::from(9502); - let expected_weight = Weight::from_parts(112_200_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(3)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); let mut env = MockEnv::new( FunctionId::BurnAlphaV1, @@ -957,9 +954,11 @@ fn add_stake_recycle_success_atomically_stakes_and_recycles() { let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); - let expected_weight = Weight::from_parts(454_200_000, 0) - .saturating_add(::DbWeight::get().reads(33)) - .saturating_add(::DbWeight::get().writes(19)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), + ); let mut env = MockEnv::new( FunctionId::AddStakeRecycleV1, @@ -1014,9 +1013,8 @@ fn add_stake_burn_success_atomically_stakes_and_burns() { let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); - let expected_weight = Weight::from_parts(453_000_000, 0) - .saturating_add(::DbWeight::get().reads(33)) - .saturating_add(::DbWeight::get().writes(18)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake_burn(); let mut env = MockEnv::new( FunctionId::AddStakeBurnV1, @@ -1064,9 +1062,11 @@ fn add_stake_recycle_with_insufficient_balance_returns_error() { // Don't fund the coldkey - should fail with balance error - let expected_weight = Weight::from_parts(454_200_000, 0) - .saturating_add(::DbWeight::get().reads(33)) - .saturating_add(::DbWeight::get().writes(19)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), + ); let mut env = MockEnv::new( FunctionId::AddStakeRecycleV1, @@ -1125,9 +1125,8 @@ fn recycle_alpha_clamps_to_available_when_amount_exceeds_stake() { // Request way more than available — should clamp to alpha_before let huge_amount = AlphaBalance::from(u64::MAX); - let expected_weight = Weight::from_parts(113_400_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(4)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); let mut env = MockEnv::new( FunctionId::RecycleAlphaV1, @@ -1161,9 +1160,8 @@ fn burn_alpha_on_root_subnet_returns_error() { pallet_subtensor::Owner::::insert(hotkey, coldkey); - let expected_weight = Weight::from_parts(112_200_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(3)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); let mut env = MockEnv::new( FunctionId::BurnAlphaV1, @@ -1226,9 +1224,8 @@ fn burn_alpha_clamps_to_available_when_amount_exceeds_stake() { // Request way more than available — should clamp to alpha_before let huge_amount = AlphaBalance::from(u64::MAX); - let expected_weight = Weight::from_parts(112_200_000, 0) - .saturating_add(::DbWeight::get().reads(10)) - .saturating_add(::DbWeight::get().writes(3)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); let mut env = MockEnv::new( FunctionId::BurnAlphaV1, @@ -1353,9 +1350,11 @@ fn add_stake_recycle_rollback_on_recycle_failure() { &hotkey, &coldkey, netuid, ); - let expected_weight = Weight::from_parts(454_200_000, 0) - .saturating_add(::DbWeight::get().reads(33)) - .saturating_add(::DbWeight::get().writes(19)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), + ); let mut env = MockEnv::new( FunctionId::AddStakeRecycleV1, @@ -1422,9 +1421,8 @@ fn add_stake_burn_rollback_on_burn_failure() { &hotkey, &coldkey, netuid, ); - let expected_weight = Weight::from_parts(453_000_000, 0) - .saturating_add(::DbWeight::get().reads(33)) - .saturating_add(::DbWeight::get().writes(18)); + let expected_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake_burn(); let mut env = MockEnv::new( FunctionId::AddStakeBurnV1, From ff7758cb219444307c3f8a32b1bbbd7de4e13db1 Mon Sep 17 00:00:00 2001 From: Landyn Date: Mon, 13 Apr 2026 21:44:22 -0500 Subject: [PATCH 08/15] Charge second-stage weight only when stage is reached For AddStakeRecycleV1 and AddStakeBurnV1, charge add_stake() upfront and only charge the second-stage weight (recycle_alpha()/burn_alpha()) after do_add_stake returns Ok. Atomicity is preserved by keeping both ops inside with_transaction and tracking attempt state via a stack flag. --- chain-extensions/src/lib.rs | 121 ++++++++++++++++++++-------------- chain-extensions/src/tests.rs | 27 +++++--- 2 files changed, 89 insertions(+), 59 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index f2ef5bd96a..3b9d408086 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -586,40 +586,48 @@ where } } FunctionId::AddStakeRecycleV1 => { - let weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake() - .saturating_add( - <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), - ); + let add_stake_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake(); + let recycle_weight = + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); - env.charge_weight(weight)?; + env.charge_weight(add_stake_weight)?; let (hotkey, netuid, tao_amount): (T::AccountId, NetUid, TaoBalance) = env.read_as()?; let caller = env.caller(); - let result = transactional::with_transaction(|| { - let alpha = match pallet_subtensor::Pallet::::do_add_stake( - RawOrigin::Signed(caller.clone()).into(), - hotkey.clone(), - netuid, - tao_amount, - ) { - Ok(a) => a, - Err(e) => return TransactionOutcome::Rollback(Err(e)), - }; - - match pallet_subtensor::Pallet::::do_recycle_alpha( - RawOrigin::Signed(caller).into(), - hotkey, - alpha, - netuid, - ) { - Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), - Err(e) => TransactionOutcome::Rollback(Err(e)), - } - }); + let mut recycle_attempted = false; + + let result: Result = + transactional::with_transaction(|| { + let alpha = match pallet_subtensor::Pallet::::do_add_stake( + RawOrigin::Signed(caller.clone()).into(), + hotkey.clone(), + netuid, + tao_amount, + ) { + Ok(a) => a, + Err(e) => return TransactionOutcome::Rollback(Err(e)), + }; + + recycle_attempted = true; + + match pallet_subtensor::Pallet::::do_recycle_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + alpha, + netuid, + ) { + Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }); + + if recycle_attempted { + env.charge_weight(recycle_weight)?; + } match result { Ok(alpha) => { @@ -634,37 +642,48 @@ where } } FunctionId::AddStakeBurnV1 => { - let weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake_burn(); + let add_stake_weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake(); + let burn_weight = + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); - env.charge_weight(weight)?; + env.charge_weight(add_stake_weight)?; let (hotkey, netuid, tao_amount): (T::AccountId, NetUid, TaoBalance) = env.read_as()?; let caller = env.caller(); - let result = transactional::with_transaction(|| { - let alpha = match pallet_subtensor::Pallet::::do_add_stake( - RawOrigin::Signed(caller.clone()).into(), - hotkey.clone(), - netuid, - tao_amount, - ) { - Ok(a) => a, - Err(e) => return TransactionOutcome::Rollback(Err(e)), - }; - - match pallet_subtensor::Pallet::::do_burn_alpha( - RawOrigin::Signed(caller).into(), - hotkey, - alpha, - netuid, - ) { - Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), - Err(e) => TransactionOutcome::Rollback(Err(e)), - } - }); + let mut burn_attempted = false; + + let result: Result = + transactional::with_transaction(|| { + let alpha = match pallet_subtensor::Pallet::::do_add_stake( + RawOrigin::Signed(caller.clone()).into(), + hotkey.clone(), + netuid, + tao_amount, + ) { + Ok(a) => a, + Err(e) => return TransactionOutcome::Rollback(Err(e)), + }; + + burn_attempted = true; + + match pallet_subtensor::Pallet::::do_burn_alpha( + RawOrigin::Signed(caller).into(), + hotkey, + alpha, + netuid, + ) { + Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }); + + if burn_attempted { + env.charge_weight(burn_weight)?; + } match result { Ok(alpha) => { diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index aef12f1e0d..2b9da523b2 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1014,7 +1014,10 @@ fn add_stake_burn_success_atomically_stakes_and_burns() { let alpha_out_before = pallet_subtensor::SubnetAlphaOut::::get(netuid); let expected_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake_burn(); + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(), + ); let mut env = MockEnv::new( FunctionId::AddStakeBurnV1, @@ -1062,11 +1065,10 @@ fn add_stake_recycle_with_insufficient_balance_returns_error() { // Don't fund the coldkey - should fail with balance error + // add_stake fails early, so only add_stake weight should be charged — + // recycle_alpha weight is not charged because that stage is never reached. let expected_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake() - .saturating_add( - <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), - ); + <::WeightInfo as SubtensorWeightInfo>::add_stake(); let mut env = MockEnv::new( FunctionId::AddStakeRecycleV1, @@ -1082,6 +1084,7 @@ fn add_stake_recycle_with_insufficient_balance_returns_error() { } _ => panic!("unexpected return value"), } + assert_eq!(env.charged_weight(), Some(expected_weight)); }); } @@ -1283,14 +1286,19 @@ impl SubtensorExtensionEnv for MockEnv { } fn charge_weight(&mut self, weight: Weight) -> Result<(), DispatchError> { + let cumulative = self + .charged_weight + .unwrap_or_default() + .saturating_add(weight); if let Some(expected) = self.expected_weight - && weight != expected + && (cumulative.ref_time() > expected.ref_time() + || cumulative.proof_size() > expected.proof_size()) { return Err(DispatchError::Other( "unexpected weight charged by mock env", )); } - self.charged_weight = Some(weight); + self.charged_weight = Some(cumulative); Ok(()) } @@ -1422,7 +1430,10 @@ fn add_stake_burn_rollback_on_burn_failure() { ); let expected_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake_burn(); + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(), + ); let mut env = MockEnv::new( FunctionId::AddStakeBurnV1, From e940dc626e8229ce295f5770bda268c402ff3fe2 Mon Sep 17 00:00:00 2001 From: Landyn Date: Mon, 13 Apr 2026 22:57:53 -0500 Subject: [PATCH 09/15] Fix CI: rustfmt wrap and forbid-saturating-math in mock - cargo fmt wraps the add_stake() call in AddStakeRecycleV1/AddStakeBurnV1 - mock charge_weight replaces saturating_add with checked_add().unwrap() to satisfy the ForbidSaturatingMath custom lint --- chain-extensions/src/lib.rs | 6 ++++-- chain-extensions/src/tests.rs | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 3b9d408086..484b2af35d 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -587,7 +587,8 @@ where } FunctionId::AddStakeRecycleV1 => { let add_stake_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake(); + <::WeightInfo as SubtensorWeightInfo>::add_stake( + ); let recycle_weight = <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); @@ -643,7 +644,8 @@ where } FunctionId::AddStakeBurnV1 => { let add_stake_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake(); + <::WeightInfo as SubtensorWeightInfo>::add_stake( + ); let burn_weight = <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index 2b9da523b2..e749d64ffc 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1286,10 +1286,11 @@ impl SubtensorExtensionEnv for MockEnv { } fn charge_weight(&mut self, weight: Weight) -> Result<(), DispatchError> { - let cumulative = self - .charged_weight - .unwrap_or_default() - .saturating_add(weight); + let prev = self.charged_weight.unwrap_or_default(); + let cumulative = Weight::from_parts( + prev.ref_time().checked_add(weight.ref_time()).unwrap(), + prev.proof_size().checked_add(weight.proof_size()).unwrap(), + ); if let Some(expected) = self.expected_weight && (cumulative.ref_time() > expected.ref_time() || cumulative.proof_size() > expected.proof_size()) From 2dd88d2f97404059af180e660266f6ffc0e8fcb1 Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 17 Apr 2026 09:14:53 -0500 Subject: [PATCH 10/15] Align RecycleAlphaV1/BurnAlphaV1 arg order with stake-combo variants Swap the decode tuple in RecycleAlphaV1 and BurnAlphaV1 from (hotkey, amount, netuid) to (hotkey, netuid, amount) so the position of netuid matches AddStakeRecycleV1 and AddStakeBurnV1. Addresses evgeny-s's consistency feedback on #2560. --- chain-extensions/src/lib.rs | 4 ++-- chain-extensions/src/tests.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 484b2af35d..5fdcfce039 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -531,7 +531,7 @@ where env.charge_weight(weight)?; - let (hotkey, amount, netuid): (T::AccountId, AlphaBalance, NetUid) = + let (hotkey, netuid, amount): (T::AccountId, NetUid, AlphaBalance) = env.read_as()?; let caller = env.caller(); @@ -561,7 +561,7 @@ where env.charge_weight(weight)?; - let (hotkey, amount, netuid): (T::AccountId, AlphaBalance, NetUid) = + let (hotkey, netuid, amount): (T::AccountId, NetUid, AlphaBalance) = env.read_as()?; let caller = env.caller(); diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index e749d64ffc..492fc52f93 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -774,7 +774,7 @@ fn recycle_alpha_success_reduces_stake_and_returns_actual_amount() { let mut env = MockEnv::new( FunctionId::RecycleAlphaV1, coldkey, - (hotkey, recycle_amount, netuid).encode(), + (hotkey, netuid, recycle_amount).encode(), ) .with_expected_weight(expected_weight); @@ -810,7 +810,7 @@ fn recycle_alpha_on_root_subnet_returns_error() { let mut env = MockEnv::new( FunctionId::RecycleAlphaV1, coldkey, - (hotkey, AlphaBalance::from(1_000u64), NetUid::ROOT).encode(), + (hotkey, NetUid::ROOT, AlphaBalance::from(1_000u64)).encode(), ) .with_expected_weight(expected_weight); @@ -875,7 +875,7 @@ fn burn_alpha_success_reduces_stake_and_returns_actual_amount() { let mut env = MockEnv::new( FunctionId::BurnAlphaV1, coldkey, - (hotkey, burn_amount, netuid).encode(), + (hotkey, netuid, burn_amount).encode(), ) .with_expected_weight(expected_weight); @@ -910,7 +910,7 @@ fn burn_alpha_on_nonexistent_subnet_returns_error() { let mut env = MockEnv::new( FunctionId::BurnAlphaV1, coldkey, - (hotkey, AlphaBalance::from(1_000u64), NetUid::from(999u16)).encode(), + (hotkey, NetUid::from(999u16), AlphaBalance::from(1_000u64)).encode(), ) .with_expected_weight(expected_weight); @@ -1134,7 +1134,7 @@ fn recycle_alpha_clamps_to_available_when_amount_exceeds_stake() { let mut env = MockEnv::new( FunctionId::RecycleAlphaV1, coldkey, - (hotkey, huge_amount, netuid).encode(), + (hotkey, netuid, huge_amount).encode(), ) .with_expected_weight(expected_weight); @@ -1169,7 +1169,7 @@ fn burn_alpha_on_root_subnet_returns_error() { let mut env = MockEnv::new( FunctionId::BurnAlphaV1, coldkey, - (hotkey, AlphaBalance::from(1_000u64), NetUid::ROOT).encode(), + (hotkey, NetUid::ROOT, AlphaBalance::from(1_000u64)).encode(), ) .with_expected_weight(expected_weight); @@ -1233,7 +1233,7 @@ fn burn_alpha_clamps_to_available_when_amount_exceeds_stake() { let mut env = MockEnv::new( FunctionId::BurnAlphaV1, coldkey, - (hotkey, huge_amount, netuid).encode(), + (hotkey, netuid, huge_amount).encode(), ) .with_expected_weight(expected_weight); From 46989aabae5e94b8c01ed3e7d494949ea42db876 Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 17 Apr 2026 09:18:43 -0500 Subject: [PATCH 11/15] Extract add_stake+recycle/burn composition into pallet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds pub fn do_add_stake_recycle and do_add_stake_burn_permissionless to pallet_subtensor; each wraps do_add_stake + do_{recycle,burn}_alpha in a transactional::with_transaction so atomicity lives in the pallet. No subnet-owner guard or rate limit — those stay on do_add_stake_burn for the owner-priority path (per shamil-gadelshin). Chain-extension handlers AddStakeRecycleV1 and AddStakeBurnV1 collapse to a single pallet call, matching the thin-handler pattern of the rest of the extension. Weight is charged once upfront as add_stake + the matching tail weight. Addresses evgeny-s's architectural feedback on #2560. --- chain-extensions/src/lib.rs | 105 +++++------------- chain-extensions/src/tests.rs | 7 +- .../subtensor/src/staking/recycle_alpha.rs | 44 ++++++++ 3 files changed, 74 insertions(+), 82 deletions(-) diff --git a/chain-extensions/src/lib.rs b/chain-extensions/src/lib.rs index 5fdcfce039..a994193e52 100644 --- a/chain-extensions/src/lib.rs +++ b/chain-extensions/src/lib.rs @@ -9,7 +9,6 @@ pub mod types; use crate::types::{FunctionId, Output}; use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::storage::{TransactionOutcome, transactional}; use frame_support::{DebugNoBound, traits::Get}; use frame_system::RawOrigin; use pallet_contracts::chain_extension::{ @@ -586,51 +585,25 @@ where } } FunctionId::AddStakeRecycleV1 => { - let add_stake_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake( - ); - let recycle_weight = - <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(); + let weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), + ); - env.charge_weight(add_stake_weight)?; + env.charge_weight(weight)?; let (hotkey, netuid, tao_amount): (T::AccountId, NetUid, TaoBalance) = env.read_as()?; - let caller = env.caller(); - - let mut recycle_attempted = false; - - let result: Result = - transactional::with_transaction(|| { - let alpha = match pallet_subtensor::Pallet::::do_add_stake( - RawOrigin::Signed(caller.clone()).into(), - hotkey.clone(), - netuid, - tao_amount, - ) { - Ok(a) => a, - Err(e) => return TransactionOutcome::Rollback(Err(e)), - }; - - recycle_attempted = true; - - match pallet_subtensor::Pallet::::do_recycle_alpha( - RawOrigin::Signed(caller).into(), - hotkey, - alpha, - netuid, - ) { - Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), - Err(e) => TransactionOutcome::Rollback(Err(e)), - } - }); - - if recycle_attempted { - env.charge_weight(recycle_weight)?; - } + let call_result = pallet_subtensor::Pallet::::do_add_stake_recycle( + RawOrigin::Signed(env.caller()).into(), + hotkey, + netuid, + tao_amount, + ); - match result { + match call_result { Ok(alpha) => { env.write_output(&alpha.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; @@ -643,51 +616,25 @@ where } } FunctionId::AddStakeBurnV1 => { - let add_stake_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake( - ); - let burn_weight = - <::WeightInfo as SubtensorWeightInfo>::burn_alpha(); + let weight = + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::burn_alpha(), + ); - env.charge_weight(add_stake_weight)?; + env.charge_weight(weight)?; let (hotkey, netuid, tao_amount): (T::AccountId, NetUid, TaoBalance) = env.read_as()?; - let caller = env.caller(); - - let mut burn_attempted = false; - - let result: Result = - transactional::with_transaction(|| { - let alpha = match pallet_subtensor::Pallet::::do_add_stake( - RawOrigin::Signed(caller.clone()).into(), - hotkey.clone(), - netuid, - tao_amount, - ) { - Ok(a) => a, - Err(e) => return TransactionOutcome::Rollback(Err(e)), - }; - - burn_attempted = true; - - match pallet_subtensor::Pallet::::do_burn_alpha( - RawOrigin::Signed(caller).into(), - hotkey, - alpha, - netuid, - ) { - Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), - Err(e) => TransactionOutcome::Rollback(Err(e)), - } - }); - - if burn_attempted { - env.charge_weight(burn_weight)?; - } + let call_result = pallet_subtensor::Pallet::::do_add_stake_burn_permissionless( + RawOrigin::Signed(env.caller()).into(), + hotkey, + netuid, + tao_amount, + ); - match result { + match call_result { Ok(alpha) => { env.write_output(&alpha.encode()) .map_err(|_| DispatchError::Other("Failed to write output"))?; diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index 492fc52f93..89d1fee758 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -1065,10 +1065,11 @@ fn add_stake_recycle_with_insufficient_balance_returns_error() { // Don't fund the coldkey - should fail with balance error - // add_stake fails early, so only add_stake weight should be charged — - // recycle_alpha weight is not charged because that stage is never reached. let expected_weight = - <::WeightInfo as SubtensorWeightInfo>::add_stake(); + <::WeightInfo as SubtensorWeightInfo>::add_stake() + .saturating_add( + <::WeightInfo as SubtensorWeightInfo>::recycle_alpha(), + ); let mut env = MockEnv::new( FunctionId::AddStakeRecycleV1, diff --git a/pallets/subtensor/src/staking/recycle_alpha.rs b/pallets/subtensor/src/staking/recycle_alpha.rs index 96633eaebf..880f21534f 100644 --- a/pallets/subtensor/src/staking/recycle_alpha.rs +++ b/pallets/subtensor/src/staking/recycle_alpha.rs @@ -1,5 +1,6 @@ use super::*; use crate::{Error, system::ensure_signed}; +use frame_support::storage::{TransactionOutcome, transactional}; use subtensor_runtime_common::{AlphaBalance, NetUid}; impl Pallet { @@ -155,4 +156,47 @@ impl Pallet { Ok(()) } + + /// Atomically stakes TAO and recycles the resulting alpha. + /// Permissionless counterpart used by the chain extension so that contracts + /// can compose the two operations without leaving residual stake if the + /// second leg fails. + pub fn do_add_stake_recycle( + origin: OriginFor, + hotkey: T::AccountId, + netuid: NetUid, + amount: TaoBalance, + ) -> Result { + transactional::with_transaction(|| { + let alpha = match Self::do_add_stake(origin.clone(), hotkey.clone(), netuid, amount) { + Ok(a) => a, + Err(e) => return TransactionOutcome::Rollback(Err(e)), + }; + match Self::do_recycle_alpha(origin, hotkey, alpha, netuid) { + Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }) + } + + /// Atomically stakes TAO and burns the resulting alpha. Permissionless + /// counterpart to `do_add_stake_burn`: no subnet-owner guard and no rate + /// limit. Used by the chain extension. + pub fn do_add_stake_burn_permissionless( + origin: OriginFor, + hotkey: T::AccountId, + netuid: NetUid, + amount: TaoBalance, + ) -> Result { + transactional::with_transaction(|| { + let alpha = match Self::do_add_stake(origin.clone(), hotkey.clone(), netuid, amount) { + Ok(a) => a, + Err(e) => return TransactionOutcome::Rollback(Err(e)), + }; + match Self::do_burn_alpha(origin, hotkey, alpha, netuid) { + Ok(real_alpha) => TransactionOutcome::Commit(Ok(real_alpha)), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }) + } } From 3c4afa9c66d29868e8fa8639a233a1235c91548e Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 24 Apr 2026 08:50:00 -0500 Subject: [PATCH 12/15] chore: auto-update benchmark weights Applies the bench-patch artifact from validate-benchmarks CI (run 24733556355). Drift exceeded the 40% weight-compare threshold for pallet_subtensor, pallet_admin_utils, and pallet_subtensor_proxy. Autogenerated weights only - no logic change. --- pallets/admin-utils/src/weights.rs | 466 ++++++++++----------- pallets/proxy/src/weights.rs | 218 +++++----- pallets/subtensor/src/weights.rs | 646 ++++++++++++++--------------- 3 files changed, 644 insertions(+), 686 deletions(-) diff --git a/pallets/admin-utils/src/weights.rs b/pallets/admin-utils/src/weights.rs index 499e81fc51..e62fba5f70 100644 --- a/pallets/admin-utils/src/weights.rs +++ b/pallets/admin-utils/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_admin_utils` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-04-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-04-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervmrg6be`, CPU: `AMD EPYC 7763 64-Core Processor` +//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 7763 64-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.m2HtKiBFjt +// --output=/tmp/tmp.7rTcxn9z8w // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -103,10 +103,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_948_000 picoseconds. - Weight::from_parts(4_548_142, 0) - // Standard Error: 748 - .saturating_add(Weight::from_parts(27_191, 0).saturating_mul(a.into())) + // Minimum execution time: 3_938_000 picoseconds. + Weight::from_parts(4_750_164, 0) + // Standard Error: 832 + .saturating_add(Weight::from_parts(25_112, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -116,10 +116,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `174` // Estimated: `2779` - // Minimum execution time: 7_224_000 picoseconds. - Weight::from_parts(7_810_888, 2779) - // Standard Error: 825 - .saturating_add(Weight::from_parts(19_930, 0).saturating_mul(a.into())) + // Minimum execution time: 7_043_000 picoseconds. + Weight::from_parts(7_618_299, 2779) + // Standard Error: 1_813 + .saturating_add(Weight::from_parts(44_821, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -129,8 +129,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_300_000 picoseconds. - Weight::from_parts(5_661_000, 0) + // Minimum execution time: 5_340_000 picoseconds. + Weight::from_parts(5_710_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -143,8 +143,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `627` // Estimated: `4092` - // Minimum execution time: 20_689_000 picoseconds. - Weight::from_parts(21_229_000, 4092) + // Minimum execution time: 21_159_000 picoseconds. + Weight::from_parts(21_711_000, 4092) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -160,8 +160,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_169_000 picoseconds. - Weight::from_parts(26_830_000, 4225) + // Minimum execution time: 26_819_000 picoseconds. + Weight::from_parts(27_381_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -177,8 +177,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_989_000 picoseconds. - Weight::from_parts(26_741_000, 4225) + // Minimum execution time: 26_519_000 picoseconds. + Weight::from_parts(27_401_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -190,8 +190,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 16_271_000 picoseconds. - Weight::from_parts(16_902_000, 4074) + // Minimum execution time: 16_441_000 picoseconds. + Weight::from_parts(17_213_000, 4074) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -207,8 +207,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_099_000 picoseconds. - Weight::from_parts(26_910_000, 4225) + // Minimum execution time: 26_560_000 picoseconds. + Weight::from_parts(27_391_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -224,8 +224,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_918_000 picoseconds. - Weight::from_parts(26_910_000, 4225) + // Minimum execution time: 26_689_000 picoseconds. + Weight::from_parts(27_392_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -241,8 +241,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_169_000 picoseconds. - Weight::from_parts(26_971_000, 4225) + // Minimum execution time: 26_770_000 picoseconds. + Weight::from_parts(27_561_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -260,8 +260,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 27_702_000 picoseconds. - Weight::from_parts(28_414_000, 4225) + // Minimum execution time: 28_162_000 picoseconds. + Weight::from_parts(29_204_000, 4225) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -277,8 +277,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_698_000 picoseconds. - Weight::from_parts(26_760_000, 4225) + // Minimum execution time: 25_948_000 picoseconds. + Weight::from_parts(27_382_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -290,8 +290,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 16_090_000 picoseconds. - Weight::from_parts(16_641_000, 4074) + // Minimum execution time: 15_449_000 picoseconds. + Weight::from_parts(17_012_000, 4074) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -307,8 +307,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_999_000 picoseconds. - Weight::from_parts(26_801_000, 4225) + // Minimum execution time: 26_359_000 picoseconds. + Weight::from_parts(27_441_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -326,8 +326,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `822` // Estimated: `4287` - // Minimum execution time: 28_313_000 picoseconds. - Weight::from_parts(29_455_000, 4287) + // Minimum execution time: 28_634_000 picoseconds. + Weight::from_parts(29_545_000, 4287) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -343,8 +343,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 23_273_000 picoseconds. - Weight::from_parts(24_045_000, 4225) + // Minimum execution time: 22_021_000 picoseconds. + Weight::from_parts(24_115_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -356,8 +356,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 15_980_000 picoseconds. - Weight::from_parts(16_521_000, 4074) + // Minimum execution time: 15_288_000 picoseconds. + Weight::from_parts(17_032_000, 4074) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -377,8 +377,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 29_235_000 picoseconds. - Weight::from_parts(30_317_000, 4225) + // Minimum execution time: 27_912_000 picoseconds. + Weight::from_parts(30_777_000, 4225) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -400,8 +400,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `795` // Estimated: `4260` - // Minimum execution time: 32_470_000 picoseconds. - Weight::from_parts(33_493_000, 4260) + // Minimum execution time: 30_908_000 picoseconds. + Weight::from_parts(33_974_000, 4260) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -417,8 +417,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_999_000 picoseconds. - Weight::from_parts(27_291_000, 4225) + // Minimum execution time: 24_856_000 picoseconds. + Weight::from_parts(27_331_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -434,8 +434,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_059_000 picoseconds. - Weight::from_parts(26_770_000, 4225) + // Minimum execution time: 26_810_000 picoseconds. + Weight::from_parts(27_291_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -451,8 +451,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_029_000 picoseconds. - Weight::from_parts(26_680_000, 4225) + // Minimum execution time: 24_686_000 picoseconds. + Weight::from_parts(26_189_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -470,8 +470,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `787` // Estimated: `4252` - // Minimum execution time: 29_015_000 picoseconds. - Weight::from_parts(29_836_000, 4252) + // Minimum execution time: 27_231_000 picoseconds. + Weight::from_parts(30_688_000, 4252) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -489,8 +489,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `762` // Estimated: `4227` - // Minimum execution time: 28_925_000 picoseconds. - Weight::from_parts(29_665_000, 4227) + // Minimum execution time: 29_936_000 picoseconds. + Weight::from_parts(30_777_000, 4227) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -500,8 +500,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_352_000 picoseconds. - Weight::from_parts(6_763_000, 0) + // Minimum execution time: 6_823_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:1) @@ -514,8 +514,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_728_000 picoseconds. - Weight::from_parts(26_550_000, 4225) + // Minimum execution time: 26_500_000 picoseconds. + Weight::from_parts(27_261_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -531,8 +531,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_149_000 picoseconds. - Weight::from_parts(27_061_000, 4225) + // Minimum execution time: 27_140_000 picoseconds. + Weight::from_parts(27_842_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -548,8 +548,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_340_000 picoseconds. - Weight::from_parts(26_920_000, 4225) + // Minimum execution time: 26_379_000 picoseconds. + Weight::from_parts(27_342_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -559,8 +559,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_631_000 picoseconds. - Weight::from_parts(5_961_000, 0) + // Minimum execution time: 5_671_000 picoseconds. + Weight::from_parts(6_031_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -569,8 +569,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_129_000 picoseconds. - Weight::from_parts(5_460_000, 0) + // Minimum execution time: 5_230_000 picoseconds. + Weight::from_parts(5_590_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TotalIssuance` (r:0 w:1) @@ -579,8 +579,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_575_000 picoseconds. - Weight::from_parts(2_775_000, 0) + // Minimum execution time: 2_696_000 picoseconds. + Weight::from_parts(2_906_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -591,8 +591,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 16_020_000 picoseconds. - Weight::from_parts(16_912_000, 4074) + // Minimum execution time: 16_431_000 picoseconds. + Weight::from_parts(17_062_000, 4074) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -602,8 +602,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_240_000 picoseconds. - Weight::from_parts(5_611_000, 0) + // Minimum execution time: 5_500_000 picoseconds. + Weight::from_parts(5_761_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -616,10 +616,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_nominator_min_required_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `935` - // Estimated: `6875` - // Minimum execution time: 28_353_000 picoseconds. - Weight::from_parts(29_555_000, 6875) + // Measured: `912` + // Estimated: `6852` + // Minimum execution time: 28_793_000 picoseconds. + Weight::from_parts(29_446_000, 6852) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -629,8 +629,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_260_000 picoseconds. - Weight::from_parts(5_600_000, 0) + // Minimum execution time: 5_430_000 picoseconds. + Weight::from_parts(5_690_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -639,8 +639,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_279_000 picoseconds. - Weight::from_parts(5_501_000, 0) + // Minimum execution time: 5_430_000 picoseconds. + Weight::from_parts(5_631_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -653,8 +653,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 17_803_000 picoseconds. - Weight::from_parts(18_775_000, 4122) + // Minimum execution time: 18_134_000 picoseconds. + Weight::from_parts(18_766_000, 4122) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -670,8 +670,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `804` // Estimated: `4269` - // Minimum execution time: 25_789_000 picoseconds. - Weight::from_parts(27_011_000, 4269) + // Minimum execution time: 26_770_000 picoseconds. + Weight::from_parts(27_562_000, 4269) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -681,8 +681,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_289_000 picoseconds. - Weight::from_parts(5_691_000, 0) + // Minimum execution time: 5_350_000 picoseconds. + Weight::from_parts(5_761_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -691,8 +691,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_140_000 picoseconds. - Weight::from_parts(5_450_000, 0) + // Minimum execution time: 5_330_000 picoseconds. + Weight::from_parts(5_750_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -701,8 +701,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_200_000 picoseconds. - Weight::from_parts(5_561_000, 0) + // Minimum execution time: 5_421_000 picoseconds. + Weight::from_parts(5_791_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -715,8 +715,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 19_937_000 picoseconds. - Weight::from_parts(20_770_000, 4122) + // Minimum execution time: 20_879_000 picoseconds. + Weight::from_parts(21_460_000, 4122) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -726,8 +726,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 6_031_000 picoseconds. - Weight::from_parts(6_282_000, 3507) + // Minimum execution time: 6_201_000 picoseconds. + Weight::from_parts(6_542_000, 3507) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -736,8 +736,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_825_000 picoseconds. - Weight::from_parts(2_996_000, 0) + // Minimum execution time: 2_795_000 picoseconds. + Weight::from_parts(3_036_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -746,8 +746,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_687_000 picoseconds. - Weight::from_parts(4_027_000, 0) + // Minimum execution time: 3_857_000 picoseconds. + Weight::from_parts(4_238_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -762,8 +762,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 23_214_000 picoseconds. - Weight::from_parts(23_774_000, 4225) + // Minimum execution time: 23_674_000 picoseconds. + Weight::from_parts(24_256_000, 4225) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -777,8 +777,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 20_609_000 picoseconds. - Weight::from_parts(21_140_000, 4122) + // Minimum execution time: 21_120_000 picoseconds. + Weight::from_parts(21_711_000, 4122) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -792,8 +792,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 22_402_000 picoseconds. - Weight::from_parts(23_103_000, 4122) + // Minimum execution time: 22_642_000 picoseconds. + Weight::from_parts(23_324_000, 4122) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -807,8 +807,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `702` // Estimated: `4167` - // Minimum execution time: 21_560_000 picoseconds. - Weight::from_parts(22_221_000, 4167) + // Minimum execution time: 22_252_000 picoseconds. + Weight::from_parts(22_733_000, 4167) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -822,8 +822,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 17_513_000 picoseconds. - Weight::from_parts(17_914_000, 4122) + // Minimum execution time: 17_633_000 picoseconds. + Weight::from_parts(18_094_000, 4122) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -834,7 +834,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 5_300_000 picoseconds. - Weight::from_parts(5_601_000, 0) + Weight::from_parts(5_690_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -843,8 +843,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_250_000 picoseconds. - Weight::from_parts(5_550_000, 0) + // Minimum execution time: 5_070_000 picoseconds. + Weight::from_parts(5_570_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -857,8 +857,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 17_553_000 picoseconds. - Weight::from_parts(18_034_000, 4122) + // Minimum execution time: 16_751_000 picoseconds. + Weight::from_parts(18_124_000, 4122) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -878,8 +878,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 27_832_000 picoseconds. - Weight::from_parts(28_463_000, 4225) + // Minimum execution time: 26_660_000 picoseconds. + Weight::from_parts(28_844_000, 4225) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -889,8 +889,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_532_000 picoseconds. - Weight::from_parts(7_073_000, 0) + // Minimum execution time: 6_132_000 picoseconds. + Weight::from_parts(7_053_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -904,10 +904,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_948_000 picoseconds. - Weight::from_parts(4_548_142, 0) - // Standard Error: 748 - .saturating_add(Weight::from_parts(27_191, 0).saturating_mul(a.into())) + // Minimum execution time: 3_938_000 picoseconds. + Weight::from_parts(4_750_164, 0) + // Standard Error: 832 + .saturating_add(Weight::from_parts(25_112, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -917,10 +917,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `174` // Estimated: `2779` - // Minimum execution time: 7_224_000 picoseconds. - Weight::from_parts(7_810_888, 2779) - // Standard Error: 825 - .saturating_add(Weight::from_parts(19_930, 0).saturating_mul(a.into())) + // Minimum execution time: 7_043_000 picoseconds. + Weight::from_parts(7_618_299, 2779) + // Standard Error: 1_813 + .saturating_add(Weight::from_parts(44_821, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -930,8 +930,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_300_000 picoseconds. - Weight::from_parts(5_661_000, 0) + // Minimum execution time: 5_340_000 picoseconds. + Weight::from_parts(5_710_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -944,8 +944,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `627` // Estimated: `4092` - // Minimum execution time: 20_689_000 picoseconds. - Weight::from_parts(21_229_000, 4092) + // Minimum execution time: 21_159_000 picoseconds. + Weight::from_parts(21_711_000, 4092) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -961,8 +961,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_169_000 picoseconds. - Weight::from_parts(26_830_000, 4225) + // Minimum execution time: 26_819_000 picoseconds. + Weight::from_parts(27_381_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -978,8 +978,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_989_000 picoseconds. - Weight::from_parts(26_741_000, 4225) + // Minimum execution time: 26_519_000 picoseconds. + Weight::from_parts(27_401_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -991,8 +991,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 16_271_000 picoseconds. - Weight::from_parts(16_902_000, 4074) + // Minimum execution time: 16_441_000 picoseconds. + Weight::from_parts(17_213_000, 4074) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1008,8 +1008,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_099_000 picoseconds. - Weight::from_parts(26_910_000, 4225) + // Minimum execution time: 26_560_000 picoseconds. + Weight::from_parts(27_391_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1025,8 +1025,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_918_000 picoseconds. - Weight::from_parts(26_910_000, 4225) + // Minimum execution time: 26_689_000 picoseconds. + Weight::from_parts(27_392_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1042,8 +1042,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_169_000 picoseconds. - Weight::from_parts(26_971_000, 4225) + // Minimum execution time: 26_770_000 picoseconds. + Weight::from_parts(27_561_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1061,8 +1061,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 27_702_000 picoseconds. - Weight::from_parts(28_414_000, 4225) + // Minimum execution time: 28_162_000 picoseconds. + Weight::from_parts(29_204_000, 4225) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1078,8 +1078,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_698_000 picoseconds. - Weight::from_parts(26_760_000, 4225) + // Minimum execution time: 25_948_000 picoseconds. + Weight::from_parts(27_382_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1091,8 +1091,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 16_090_000 picoseconds. - Weight::from_parts(16_641_000, 4074) + // Minimum execution time: 15_449_000 picoseconds. + Weight::from_parts(17_012_000, 4074) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1108,8 +1108,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_999_000 picoseconds. - Weight::from_parts(26_801_000, 4225) + // Minimum execution time: 26_359_000 picoseconds. + Weight::from_parts(27_441_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1127,8 +1127,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `822` // Estimated: `4287` - // Minimum execution time: 28_313_000 picoseconds. - Weight::from_parts(29_455_000, 4287) + // Minimum execution time: 28_634_000 picoseconds. + Weight::from_parts(29_545_000, 4287) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1144,8 +1144,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 23_273_000 picoseconds. - Weight::from_parts(24_045_000, 4225) + // Minimum execution time: 22_021_000 picoseconds. + Weight::from_parts(24_115_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1157,8 +1157,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 15_980_000 picoseconds. - Weight::from_parts(16_521_000, 4074) + // Minimum execution time: 15_288_000 picoseconds. + Weight::from_parts(17_032_000, 4074) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1178,8 +1178,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 29_235_000 picoseconds. - Weight::from_parts(30_317_000, 4225) + // Minimum execution time: 27_912_000 picoseconds. + Weight::from_parts(30_777_000, 4225) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1201,8 +1201,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `795` // Estimated: `4260` - // Minimum execution time: 32_470_000 picoseconds. - Weight::from_parts(33_493_000, 4260) + // Minimum execution time: 30_908_000 picoseconds. + Weight::from_parts(33_974_000, 4260) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1218,8 +1218,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_999_000 picoseconds. - Weight::from_parts(27_291_000, 4225) + // Minimum execution time: 24_856_000 picoseconds. + Weight::from_parts(27_331_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1235,8 +1235,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_059_000 picoseconds. - Weight::from_parts(26_770_000, 4225) + // Minimum execution time: 26_810_000 picoseconds. + Weight::from_parts(27_291_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1252,8 +1252,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_029_000 picoseconds. - Weight::from_parts(26_680_000, 4225) + // Minimum execution time: 24_686_000 picoseconds. + Weight::from_parts(26_189_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1271,8 +1271,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `787` // Estimated: `4252` - // Minimum execution time: 29_015_000 picoseconds. - Weight::from_parts(29_836_000, 4252) + // Minimum execution time: 27_231_000 picoseconds. + Weight::from_parts(30_688_000, 4252) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1290,8 +1290,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `762` // Estimated: `4227` - // Minimum execution time: 28_925_000 picoseconds. - Weight::from_parts(29_665_000, 4227) + // Minimum execution time: 29_936_000 picoseconds. + Weight::from_parts(30_777_000, 4227) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1301,8 +1301,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_352_000 picoseconds. - Weight::from_parts(6_763_000, 0) + // Minimum execution time: 6_823_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:1) @@ -1315,8 +1315,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 25_728_000 picoseconds. - Weight::from_parts(26_550_000, 4225) + // Minimum execution time: 26_500_000 picoseconds. + Weight::from_parts(27_261_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1332,8 +1332,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_149_000 picoseconds. - Weight::from_parts(27_061_000, 4225) + // Minimum execution time: 27_140_000 picoseconds. + Weight::from_parts(27_842_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1349,8 +1349,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 26_340_000 picoseconds. - Weight::from_parts(26_920_000, 4225) + // Minimum execution time: 26_379_000 picoseconds. + Weight::from_parts(27_342_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1360,8 +1360,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_631_000 picoseconds. - Weight::from_parts(5_961_000, 0) + // Minimum execution time: 5_671_000 picoseconds. + Weight::from_parts(6_031_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -1370,8 +1370,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_129_000 picoseconds. - Weight::from_parts(5_460_000, 0) + // Minimum execution time: 5_230_000 picoseconds. + Weight::from_parts(5_590_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TotalIssuance` (r:0 w:1) @@ -1380,8 +1380,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_575_000 picoseconds. - Weight::from_parts(2_775_000, 0) + // Minimum execution time: 2_696_000 picoseconds. + Weight::from_parts(2_906_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -1392,8 +1392,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `609` // Estimated: `4074` - // Minimum execution time: 16_020_000 picoseconds. - Weight::from_parts(16_912_000, 4074) + // Minimum execution time: 16_431_000 picoseconds. + Weight::from_parts(17_062_000, 4074) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1403,8 +1403,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_240_000 picoseconds. - Weight::from_parts(5_611_000, 0) + // Minimum execution time: 5_500_000 picoseconds. + Weight::from_parts(5_761_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -1417,10 +1417,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_nominator_min_required_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `935` - // Estimated: `6875` - // Minimum execution time: 28_353_000 picoseconds. - Weight::from_parts(29_555_000, 6875) + // Measured: `912` + // Estimated: `6852` + // Minimum execution time: 28_793_000 picoseconds. + Weight::from_parts(29_446_000, 6852) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1430,8 +1430,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_260_000 picoseconds. - Weight::from_parts(5_600_000, 0) + // Minimum execution time: 5_430_000 picoseconds. + Weight::from_parts(5_690_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -1440,8 +1440,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_279_000 picoseconds. - Weight::from_parts(5_501_000, 0) + // Minimum execution time: 5_430_000 picoseconds. + Weight::from_parts(5_631_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1454,8 +1454,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 17_803_000 picoseconds. - Weight::from_parts(18_775_000, 4122) + // Minimum execution time: 18_134_000 picoseconds. + Weight::from_parts(18_766_000, 4122) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1471,8 +1471,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `804` // Estimated: `4269` - // Minimum execution time: 25_789_000 picoseconds. - Weight::from_parts(27_011_000, 4269) + // Minimum execution time: 26_770_000 picoseconds. + Weight::from_parts(27_562_000, 4269) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1482,8 +1482,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_289_000 picoseconds. - Weight::from_parts(5_691_000, 0) + // Minimum execution time: 5_350_000 picoseconds. + Weight::from_parts(5_761_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -1492,8 +1492,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_140_000 picoseconds. - Weight::from_parts(5_450_000, 0) + // Minimum execution time: 5_330_000 picoseconds. + Weight::from_parts(5_750_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -1502,8 +1502,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_200_000 picoseconds. - Weight::from_parts(5_561_000, 0) + // Minimum execution time: 5_421_000 picoseconds. + Weight::from_parts(5_791_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1516,8 +1516,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 19_937_000 picoseconds. - Weight::from_parts(20_770_000, 4122) + // Minimum execution time: 20_879_000 picoseconds. + Weight::from_parts(21_460_000, 4122) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1527,8 +1527,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 6_031_000 picoseconds. - Weight::from_parts(6_282_000, 3507) + // Minimum execution time: 6_201_000 picoseconds. + Weight::from_parts(6_542_000, 3507) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -1537,8 +1537,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_825_000 picoseconds. - Weight::from_parts(2_996_000, 0) + // Minimum execution time: 2_795_000 picoseconds. + Weight::from_parts(3_036_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -1547,8 +1547,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_687_000 picoseconds. - Weight::from_parts(4_027_000, 0) + // Minimum execution time: 3_857_000 picoseconds. + Weight::from_parts(4_238_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1563,8 +1563,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 23_214_000 picoseconds. - Weight::from_parts(23_774_000, 4225) + // Minimum execution time: 23_674_000 picoseconds. + Weight::from_parts(24_256_000, 4225) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1578,8 +1578,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 20_609_000 picoseconds. - Weight::from_parts(21_140_000, 4122) + // Minimum execution time: 21_120_000 picoseconds. + Weight::from_parts(21_711_000, 4122) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1593,8 +1593,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 22_402_000 picoseconds. - Weight::from_parts(23_103_000, 4122) + // Minimum execution time: 22_642_000 picoseconds. + Weight::from_parts(23_324_000, 4122) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1608,8 +1608,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `702` // Estimated: `4167` - // Minimum execution time: 21_560_000 picoseconds. - Weight::from_parts(22_221_000, 4167) + // Minimum execution time: 22_252_000 picoseconds. + Weight::from_parts(22_733_000, 4167) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1623,8 +1623,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 17_513_000 picoseconds. - Weight::from_parts(17_914_000, 4122) + // Minimum execution time: 17_633_000 picoseconds. + Weight::from_parts(18_094_000, 4122) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1635,7 +1635,7 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 5_300_000 picoseconds. - Weight::from_parts(5_601_000, 0) + Weight::from_parts(5_690_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -1644,8 +1644,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_250_000 picoseconds. - Weight::from_parts(5_550_000, 0) + // Minimum execution time: 5_070_000 picoseconds. + Weight::from_parts(5_570_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1658,8 +1658,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `657` // Estimated: `4122` - // Minimum execution time: 17_553_000 picoseconds. - Weight::from_parts(18_034_000, 4122) + // Minimum execution time: 16_751_000 picoseconds. + Weight::from_parts(18_124_000, 4122) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1679,8 +1679,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `760` // Estimated: `4225` - // Minimum execution time: 27_832_000 picoseconds. - Weight::from_parts(28_463_000, 4225) + // Minimum execution time: 26_660_000 picoseconds. + Weight::from_parts(28_844_000, 4225) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1690,8 +1690,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_532_000 picoseconds. - Weight::from_parts(7_073_000, 0) + // Minimum execution time: 6_132_000 picoseconds. + Weight::from_parts(7_053_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallets/proxy/src/weights.rs b/pallets/proxy/src/weights.rs index 01c74167c6..73de2fe719 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-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-04-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm35a4x`, CPU: `AMD EPYC 7763 64-Core Processor` +//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 7763 64-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.9EbSf4VvRZ +// --output=/tmp/tmp.I42idExrxC // --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: 25_647_000 picoseconds. - Weight::from_parts(26_843_168, 4254) - // Standard Error: 3_436 - .saturating_add(Weight::from_parts(63_244, 0).saturating_mul(p.into())) + // Minimum execution time: 24_526_000 picoseconds. + Weight::from_parts(27_645_810, 4254) + // Standard Error: 2_884 + .saturating_add(Weight::from_parts(63_532, 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,10 +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: 49_944_000 picoseconds. - Weight::from_parts(52_503_282, 8615) - // Standard Error: 2_497 - .saturating_add(Weight::from_parts(216_567, 0).saturating_mul(a.into())) + // Minimum execution time: 52_789_000 picoseconds. + Weight::from_parts(53_719_932, 8615) + // Standard Error: 1_870 + .saturating_add(Weight::from_parts(215_748, 0).saturating_mul(a.into())) + // Standard Error: 7_489 + .saturating_add(Weight::from_parts(19_066, 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())) @@ -111,12 +113,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 24_506_000 picoseconds. - Weight::from_parts(24_531_799, 8615) - // Standard Error: 1_117 - .saturating_add(Weight::from_parts(191_518, 0).saturating_mul(a.into())) - // Standard Error: 4_477 - .saturating_add(Weight::from_parts(47_993, 0).saturating_mul(p.into())) + // Minimum execution time: 23_664_000 picoseconds. + Weight::from_parts(25_272_232, 8615) + // Standard Error: 1_335 + .saturating_add(Weight::from_parts(211_654, 0).saturating_mul(a.into())) + // Standard Error: 5_349 + .saturating_add(Weight::from_parts(38_309, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -130,12 +132,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 24_646_000 picoseconds. - Weight::from_parts(25_377_466, 8615) - // Standard Error: 1_170 - .saturating_add(Weight::from_parts(191_897, 0).saturating_mul(a.into())) - // Standard Error: 4_688 - .saturating_add(Weight::from_parts(10_603, 0).saturating_mul(p.into())) + // Minimum execution time: 25_458_000 picoseconds. + Weight::from_parts(26_354_054, 8615) + // Standard Error: 1_465 + .saturating_add(Weight::from_parts(198_569, 0).saturating_mul(a.into())) + // Standard Error: 5_871 + .saturating_add(Weight::from_parts(9_188, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -151,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: 31_980_000 picoseconds. - Weight::from_parts(32_625_067, 8615) - // Standard Error: 1_191 - .saturating_add(Weight::from_parts(194_396, 0).saturating_mul(a.into())) - // Standard Error: 4_771 - .saturating_add(Weight::from_parts(32_404, 0).saturating_mul(p.into())) + // Minimum execution time: 33_733_000 picoseconds. + Weight::from_parts(33_537_445, 8615) + // Standard Error: 1_248 + .saturating_add(Weight::from_parts(205_225, 0).saturating_mul(a.into())) + // Standard Error: 5_002 + .saturating_add(Weight::from_parts(54_720, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -167,10 +169,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 23_393_000 picoseconds. - Weight::from_parts(24_228_885, 4254) - // Standard Error: 2_353 - .saturating_add(Weight::from_parts(59_058, 0).saturating_mul(p.into())) + // Minimum execution time: 24_736_000 picoseconds. + Weight::from_parts(25_488_966, 4254) + // Standard Error: 2_576 + .saturating_add(Weight::from_parts(83_520, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -183,10 +185,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_886_000 picoseconds. - Weight::from_parts(26_026_566, 4254) - // Standard Error: 2_820 - .saturating_add(Weight::from_parts(61_530, 0).saturating_mul(p.into())) + // Minimum execution time: 26_490_000 picoseconds. + Weight::from_parts(27_744_956, 4254) + // Standard Error: 2_755 + .saturating_add(Weight::from_parts(58_179, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -197,10 +199,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_566_000 picoseconds. - Weight::from_parts(25_878_725, 4254) - // Standard Error: 3_203 - .saturating_add(Weight::from_parts(47_554, 0).saturating_mul(p.into())) + // Minimum execution time: 26_329_000 picoseconds. + Weight::from_parts(27_685_350, 4254) + // Standard Error: 2_618 + .saturating_add(Weight::from_parts(38_031, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -211,10 +213,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4254` - // Minimum execution time: 25_177_000 picoseconds. - Weight::from_parts(26_179_682, 4254) - // Standard Error: 2_818 - .saturating_add(Weight::from_parts(21_434, 0).saturating_mul(p.into())) + // Minimum execution time: 26_510_000 picoseconds. + Weight::from_parts(27_607_060, 4254) + // Standard Error: 2_526 + .saturating_add(Weight::from_parts(22_892, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -225,10 +227,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `156 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_286_000 picoseconds. - Weight::from_parts(25_243_103, 4254) - // Standard Error: 2_546 - .saturating_add(Weight::from_parts(40_266, 0).saturating_mul(p.into())) + // Minimum execution time: 25_438_000 picoseconds. + Weight::from_parts(26_608_817, 4254) + // Standard Error: 2_807 + .saturating_add(Weight::from_parts(41_735, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -242,8 +244,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `412` // Estimated: `8615` - // Minimum execution time: 42_890_000 picoseconds. - Weight::from_parts(43_922_000, 8615) + // Minimum execution time: 44_453_000 picoseconds. + Weight::from_parts(46_146_000, 8615) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -256,10 +258,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 13_245_000 picoseconds. - Weight::from_parts(13_801_801, 4254) - // Standard Error: 1_780 - .saturating_add(Weight::from_parts(50_093, 0).saturating_mul(p.into())) + // Minimum execution time: 13_676_000 picoseconds. + Weight::from_parts(14_327_757, 4254) + // Standard Error: 1_603 + .saturating_add(Weight::from_parts(40_388, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -280,10 +282,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `637 + p * (37 ±0)` // Estimated: `4254 + p * (37 ±0)` - // Minimum execution time: 25_647_000 picoseconds. - Weight::from_parts(26_843_168, 4254) - // Standard Error: 3_436 - .saturating_add(Weight::from_parts(63_244, 0).saturating_mul(p.into())) + // Minimum execution time: 24_526_000 picoseconds. + Weight::from_parts(27_645_810, 4254) + // Standard Error: 2_884 + .saturating_add(Weight::from_parts(63_532, 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())) @@ -306,10 +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: 49_944_000 picoseconds. - Weight::from_parts(52_503_282, 8615) - // Standard Error: 2_497 - .saturating_add(Weight::from_parts(216_567, 0).saturating_mul(a.into())) + // Minimum execution time: 52_789_000 picoseconds. + Weight::from_parts(53_719_932, 8615) + // Standard Error: 1_870 + .saturating_add(Weight::from_parts(215_748, 0).saturating_mul(a.into())) + // Standard Error: 7_489 + .saturating_add(Weight::from_parts(19_066, 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())) @@ -325,12 +329,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 24_506_000 picoseconds. - Weight::from_parts(24_531_799, 8615) - // Standard Error: 1_117 - .saturating_add(Weight::from_parts(191_518, 0).saturating_mul(a.into())) - // Standard Error: 4_477 - .saturating_add(Weight::from_parts(47_993, 0).saturating_mul(p.into())) + // Minimum execution time: 23_664_000 picoseconds. + Weight::from_parts(25_272_232, 8615) + // Standard Error: 1_335 + .saturating_add(Weight::from_parts(211_654, 0).saturating_mul(a.into())) + // Standard Error: 5_349 + .saturating_add(Weight::from_parts(38_309, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -344,12 +348,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 24_646_000 picoseconds. - Weight::from_parts(25_377_466, 8615) - // Standard Error: 1_170 - .saturating_add(Weight::from_parts(191_897, 0).saturating_mul(a.into())) - // Standard Error: 4_688 - .saturating_add(Weight::from_parts(10_603, 0).saturating_mul(p.into())) + // Minimum execution time: 25_458_000 picoseconds. + Weight::from_parts(26_354_054, 8615) + // Standard Error: 1_465 + .saturating_add(Weight::from_parts(198_569, 0).saturating_mul(a.into())) + // Standard Error: 5_871 + .saturating_add(Weight::from_parts(9_188, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -365,12 +369,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `308 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615` - // Minimum execution time: 31_980_000 picoseconds. - Weight::from_parts(32_625_067, 8615) - // Standard Error: 1_191 - .saturating_add(Weight::from_parts(194_396, 0).saturating_mul(a.into())) - // Standard Error: 4_771 - .saturating_add(Weight::from_parts(32_404, 0).saturating_mul(p.into())) + // Minimum execution time: 33_733_000 picoseconds. + Weight::from_parts(33_537_445, 8615) + // Standard Error: 1_248 + .saturating_add(Weight::from_parts(205_225, 0).saturating_mul(a.into())) + // Standard Error: 5_002 + .saturating_add(Weight::from_parts(54_720, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -381,10 +385,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 23_393_000 picoseconds. - Weight::from_parts(24_228_885, 4254) - // Standard Error: 2_353 - .saturating_add(Weight::from_parts(59_058, 0).saturating_mul(p.into())) + // Minimum execution time: 24_736_000 picoseconds. + Weight::from_parts(25_488_966, 4254) + // Standard Error: 2_576 + .saturating_add(Weight::from_parts(83_520, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -397,10 +401,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_886_000 picoseconds. - Weight::from_parts(26_026_566, 4254) - // Standard Error: 2_820 - .saturating_add(Weight::from_parts(61_530, 0).saturating_mul(p.into())) + // Minimum execution time: 26_490_000 picoseconds. + Weight::from_parts(27_744_956, 4254) + // Standard Error: 2_755 + .saturating_add(Weight::from_parts(58_179, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -411,10 +415,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_566_000 picoseconds. - Weight::from_parts(25_878_725, 4254) - // Standard Error: 3_203 - .saturating_add(Weight::from_parts(47_554, 0).saturating_mul(p.into())) + // Minimum execution time: 26_329_000 picoseconds. + Weight::from_parts(27_685_350, 4254) + // Standard Error: 2_618 + .saturating_add(Weight::from_parts(38_031, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -425,10 +429,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4254` - // Minimum execution time: 25_177_000 picoseconds. - Weight::from_parts(26_179_682, 4254) - // Standard Error: 2_818 - .saturating_add(Weight::from_parts(21_434, 0).saturating_mul(p.into())) + // Minimum execution time: 26_510_000 picoseconds. + Weight::from_parts(27_607_060, 4254) + // Standard Error: 2_526 + .saturating_add(Weight::from_parts(22_892, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -439,10 +443,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `156 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 24_286_000 picoseconds. - Weight::from_parts(25_243_103, 4254) - // Standard Error: 2_546 - .saturating_add(Weight::from_parts(40_266, 0).saturating_mul(p.into())) + // Minimum execution time: 25_438_000 picoseconds. + Weight::from_parts(26_608_817, 4254) + // Standard Error: 2_807 + .saturating_add(Weight::from_parts(41_735, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -456,8 +460,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `412` // Estimated: `8615` - // Minimum execution time: 42_890_000 picoseconds. - Weight::from_parts(43_922_000, 8615) + // Minimum execution time: 44_453_000 picoseconds. + Weight::from_parts(46_146_000, 8615) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -470,10 +474,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 13_245_000 picoseconds. - Weight::from_parts(13_801_801, 4254) - // Standard Error: 1_780 - .saturating_add(Weight::from_parts(50_093, 0).saturating_mul(p.into())) + // Minimum execution time: 13_676_000 picoseconds. + Weight::from_parts(14_327_757, 4254) + // Standard Error: 1_603 + .saturating_add(Weight::from_parts(40_388, 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 d6c63175f0..53d94c0a02 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-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-04-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm727z3`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervmeorf1`, CPU: `AMD EPYC 7763 64-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.caw6C0JGm3 +// --output=/tmp/tmp.PO6A7YtTdr // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -86,9 +86,9 @@ pub trait WeightInfo { fn claim_root() -> Weight; fn sudo_set_num_root_claims() -> Weight; fn sudo_set_root_claim_threshold() -> Weight; + fn set_auto_parent_delegation_enabled() -> Weight; fn add_stake_burn() -> Weight; fn set_pending_childkey_cooldown() -> Weight; - fn set_auto_parent_delegation_enabled() -> Weight; } /// Weights for `pallet_subtensor` using the Substrate node and recommended hardware. @@ -190,8 +190,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1629` // Estimated: `13600` - // Minimum execution time: 348_026_000 picoseconds. - Weight::from_parts(354_034_000, 13600) + // Minimum execution time: 348_070_000 picoseconds. + Weight::from_parts(356_136_000, 13600) .saturating_add(T::DbWeight::get().reads(46_u64)) .saturating_add(T::DbWeight::get().writes(38_u64)) } @@ -233,8 +233,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `188782` // Estimated: `10327372` - // Minimum execution time: 16_089_221_000 picoseconds. - Weight::from_parts(16_473_771_000, 10327372) + // Minimum execution time: 15_061_457_000 picoseconds. + Weight::from_parts(15_447_901_000, 10327372) .saturating_add(T::DbWeight::get().reads(4112_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -296,8 +296,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2307` // Estimated: `8556` - // Minimum execution time: 338_691_000 picoseconds. - Weight::from_parts(346_814_000, 8556) + // Minimum execution time: 337_624_000 picoseconds. + Weight::from_parts(341_310_000, 8556) .saturating_add(T::DbWeight::get().reads(27_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -311,8 +311,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `791` // Estimated: `6731` - // Minimum execution time: 32_479_000 picoseconds. - Weight::from_parts(33_721_000, 6731) + // Minimum execution time: 34_124_000 picoseconds. + Weight::from_parts(35_557_000, 6731) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -326,8 +326,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `764` // Estimated: `6704` - // Minimum execution time: 29_264_000 picoseconds. - Weight::from_parts(30_095_000, 6704) + // Minimum execution time: 30_357_000 picoseconds. + Weight::from_parts(31_328_000, 6704) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -427,8 +427,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1639` // Estimated: `13600` - // Minimum execution time: 341_145_000 picoseconds. - Weight::from_parts(345_863_000, 13600) + // Minimum execution time: 344_366_000 picoseconds. + Weight::from_parts(366_799_000, 13600) .saturating_add(T::DbWeight::get().reads(46_u64)) .saturating_add(T::DbWeight::get().writes(38_u64)) } @@ -480,8 +480,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1415` // Estimated: `4880` - // Minimum execution time: 100_752_000 picoseconds. - Weight::from_parts(102_565_000, 4880) + // Minimum execution time: 102_301_000 picoseconds. + Weight::from_parts(104_115_000, 4880) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -551,18 +551,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::ValidatorTrust` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ValidatorPermit` (r:1 w:1) /// Proof: `SubtensorModule::ValidatorPermit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RegisteredSubnetCounter` (r:1 w:1) + /// Proof: `SubtensorModule::RegisteredSubnetCounter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TokenSymbol` (r:3 w:1) /// Proof: `SubtensorModule::TokenSymbol` (`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::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::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::TotalStake` (r:1 w:1) /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:1 w:1) @@ -607,12 +599,12 @@ impl WeightInfo for SubstrateWeight { /// 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: 289_917_000 picoseconds. - Weight::from_parts(293_954_000, 10091) - .saturating_add(T::DbWeight::get().reads(45_u64)) - .saturating_add(T::DbWeight::get().writes(49_u64)) + // Measured: `1459` + // Estimated: `9874` + // Minimum execution time: 255_939_000 picoseconds. + Weight::from_parts(263_813_000, 9874) + .saturating_add(T::DbWeight::get().reads(41_u64)) + .saturating_add(T::DbWeight::get().writes(47_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -638,8 +630,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1061` // Estimated: `4526` - // Minimum execution time: 59_199_000 picoseconds. - Weight::from_parts(60_772_000, 4526) + // Minimum execution time: 61_264_000 picoseconds. + Weight::from_parts(62_287_000, 4526) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -683,8 +675,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1579` // Estimated: `7519` - // Minimum execution time: 107_763_000 picoseconds. - Weight::from_parts(109_746_000, 7519) + // Minimum execution time: 109_425_000 picoseconds. + Weight::from_parts(111_438_000, 7519) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -694,8 +686,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(4_407_000, 0) + // Minimum execution time: 5_390_000 picoseconds. + Weight::from_parts(5_751_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -712,8 +704,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `938` // Estimated: `4403` - // Minimum execution time: 45_358_000 picoseconds. - Weight::from_parts(46_140_000, 4403) + // Minimum execution time: 46_818_000 picoseconds. + Weight::from_parts(48_099_000, 4403) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -729,8 +721,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 39_469_000 picoseconds. - Weight::from_parts(40_962_000, 4159) + // Minimum execution time: 42_900_000 picoseconds. + Weight::from_parts(44_463_000, 4159) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -768,8 +760,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1815` // Estimated: `12705` - // Minimum execution time: 260_764_000 picoseconds. - Weight::from_parts(265_261_000, 12705) + // Minimum execution time: 260_477_000 picoseconds. + Weight::from_parts(263_493_000, 12705) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -811,8 +803,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1908` // Estimated: `12798` - // Minimum execution time: 281_736_000 picoseconds. - Weight::from_parts(286_753_000, 12798) + // Minimum execution time: 284_482_000 picoseconds. + Weight::from_parts(289_470_000, 12798) .saturating_add(T::DbWeight::get().reads(31_u64)) .saturating_add(T::DbWeight::get().writes(19_u64)) } @@ -824,8 +816,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 19_950_000 picoseconds. - Weight::from_parts(20_701_000, 4130) + // Minimum execution time: 22_452_000 picoseconds. + Weight::from_parts(23_043_000, 4130) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -837,8 +829,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 16_415_000 picoseconds. - Weight::from_parts(17_096_000, 4078) + // Minimum execution time: 18_454_000 picoseconds. + Weight::from_parts(19_206_000, 4078) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -850,8 +842,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_790_000 picoseconds. - Weight::from_parts(7_151_000, 0) + // Minimum execution time: 8_486_000 picoseconds. + Weight::from_parts(8_827_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -894,8 +886,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2084` // Estimated: `8024` - // Minimum execution time: 426_724_000 picoseconds. - Weight::from_parts(431_712_000, 8024) + // Minimum execution time: 424_554_000 picoseconds. + Weight::from_parts(433_861_000, 8024) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -921,8 +913,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 128_484_000 picoseconds. - Weight::from_parts(130_548_000, 4889) + // Minimum execution time: 129_312_000 picoseconds. + Weight::from_parts(130_614_000, 4889) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -948,8 +940,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 126_171_000 picoseconds. - Weight::from_parts(128_965_000, 4889) + // Minimum execution time: 127_979_000 picoseconds. + Weight::from_parts(128_931_000, 4889) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -969,8 +961,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1079` // Estimated: `4544` - // Minimum execution time: 37_957_000 picoseconds. - Weight::from_parts(38_939_000, 4544) + // Minimum execution time: 38_592_000 picoseconds. + Weight::from_parts(39_554_000, 4544) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1032,8 +1024,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2307` // Estimated: `8556` - // Minimum execution time: 376_539_000 picoseconds. - Weight::from_parts(383_750_000, 8556) + // Minimum execution time: 377_325_000 picoseconds. + Weight::from_parts(380_301_000, 8556) .saturating_add(T::DbWeight::get().reads(27_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -1069,8 +1061,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2002` // Estimated: `7942` - // Minimum execution time: 222_486_000 picoseconds. - Weight::from_parts(223_918_000, 7942) + // Minimum execution time: 219_000_000 picoseconds. + Weight::from_parts(221_754_000, 7942) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -1128,8 +1120,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2211` // Estimated: `10626` - // Minimum execution time: 387_646_000 picoseconds. - Weight::from_parts(403_169_000, 10626) + // Minimum execution time: 397_733_000 picoseconds. + Weight::from_parts(418_001_000, 10626) .saturating_add(T::DbWeight::get().reads(30_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } @@ -1189,8 +1181,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2494` // Estimated: `8556` - // Minimum execution time: 461_377_000 picoseconds. - Weight::from_parts(477_951_000, 8556) + // Minimum execution time: 463_767_000 picoseconds. + Weight::from_parts(469_047_000, 8556) .saturating_add(T::DbWeight::get().reads(40_u64)) .saturating_add(T::DbWeight::get().writes(22_u64)) } @@ -1228,8 +1220,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1829` // Estimated: `7769` - // Minimum execution time: 215_726_000 picoseconds. - Weight::from_parts(219_552_000, 7769) + // Minimum execution time: 215_332_000 picoseconds. + Weight::from_parts(218_628_000, 7769) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -1289,8 +1281,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2421` // Estimated: `8556` - // Minimum execution time: 402_808_000 picoseconds. - Weight::from_parts(420_035_000, 8556) + // Minimum execution time: 405_518_000 picoseconds. + Weight::from_parts(428_160_000, 8556) .saturating_add(T::DbWeight::get().reads(40_u64)) .saturating_add(T::DbWeight::get().writes(22_u64)) } @@ -1320,8 +1312,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1084` // Estimated: `4549` - // Minimum execution time: 125_589_000 picoseconds. - Weight::from_parts(141_484_000, 4549) + // Minimum execution time: 128_470_000 picoseconds. + Weight::from_parts(130_904_000, 4549) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1361,8 +1353,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1416` // Estimated: `7356` - // Minimum execution time: 99_310_000 picoseconds. - Weight::from_parts(101_193_000, 7356) + // Minimum execution time: 102_201_000 picoseconds. + Weight::from_parts(103_063_000, 7356) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1378,8 +1370,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `793` // Estimated: `4258` - // Minimum execution time: 25_499_000 picoseconds. - Weight::from_parts(26_330_000, 4258) + // Minimum execution time: 28_173_000 picoseconds. + Weight::from_parts(29_124_000, 4258) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1397,8 +1389,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `886` // Estimated: `4351` - // Minimum execution time: 32_540_000 picoseconds. - Weight::from_parts(33_501_000, 4351) + // Minimum execution time: 34_855_000 picoseconds. + Weight::from_parts(36_077_000, 4351) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1466,18 +1458,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::ValidatorTrust` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ValidatorPermit` (r:1 w:1) /// Proof: `SubtensorModule::ValidatorPermit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RegisteredSubnetCounter` (r:1 w:1) + /// Proof: `SubtensorModule::RegisteredSubnetCounter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TokenSymbol` (r:3 w:1) /// Proof: `SubtensorModule::TokenSymbol` (`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::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::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::TotalStake` (r:1 w:1) /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:1 w:1) @@ -1522,12 +1506,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_network_with_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `1560` - // Estimated: `9975` - // Minimum execution time: 279_983_000 picoseconds. - Weight::from_parts(284_690_000, 9975) - .saturating_add(T::DbWeight::get().reads(44_u64)) - .saturating_add(T::DbWeight::get().writes(48_u64)) + // Measured: `1343` + // Estimated: `9758` + // Minimum execution time: 253_714_000 picoseconds. + Weight::from_parts(256_750_000, 9758) + .saturating_add(T::DbWeight::get().reads(40_u64)) + .saturating_add(T::DbWeight::get().writes(46_u64)) } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1539,8 +1523,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `762` // Estimated: `6702` - // Minimum execution time: 31_257_000 picoseconds. - Weight::from_parts(32_769_000, 6702) + // Minimum execution time: 33_913_000 picoseconds. + Weight::from_parts(34_886_000, 6702) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1554,8 +1538,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `842` // Estimated: `6782` - // Minimum execution time: 28_703_000 picoseconds. - Weight::from_parts(30_106_000, 6782) + // Minimum execution time: 31_218_000 picoseconds. + Weight::from_parts(32_160_000, 6782) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1567,8 +1551,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `595` // Estimated: `4060` - // Minimum execution time: 15_634_000 picoseconds. - Weight::from_parts(16_254_000, 4060) + // Minimum execution time: 17_743_000 picoseconds. + Weight::from_parts(18_285_000, 4060) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1580,6 +1564,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TxRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:6 w:10) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:9 w:8) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`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::Alpha` (r:9 w:0) @@ -1606,8 +1594,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:5 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:4 w:8) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:4 w:0) @@ -1622,8 +1610,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LoadedEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NeuronCertificates` (r:4 w:0) /// Proof: `SubtensorModule::NeuronCertificates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:8 w:8) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyShares` (r:8 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:8 w:8) @@ -1638,9 +1624,9 @@ impl WeightInfo for SubstrateWeight { // 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) - .saturating_add(T::DbWeight::get().reads(159_u64)) + // Minimum execution time: 1_157_243_000 picoseconds. + Weight::from_parts(1_163_966_000, 28766) + .saturating_add(T::DbWeight::get().reads(161_u64)) .saturating_add(T::DbWeight::get().writes(95_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -1653,8 +1639,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `745` // Estimated: `4210` - // Minimum execution time: 21_963_000 picoseconds. - Weight::from_parts(22_504_000, 4210) + // Minimum execution time: 23_875_000 picoseconds. + Weight::from_parts(24_466_000, 4210) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1668,8 +1654,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `740` // Estimated: `9155` - // Minimum execution time: 24_397_000 picoseconds. - Weight::from_parts(25_138_000, 9155) + // Minimum execution time: 27_351_000 picoseconds. + Weight::from_parts(28_013_000, 9155) .saturating_add(T::DbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -1736,8 +1722,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2372` // Estimated: `10787` - // Minimum execution time: 414_015_000 picoseconds. - Weight::from_parts(427_445_000, 10787) + // Minimum execution time: 418_041_000 picoseconds. + Weight::from_parts(426_828_000, 10787) .saturating_add(T::DbWeight::get().reads(44_u64)) .saturating_add(T::DbWeight::get().writes(24_u64)) } @@ -1795,8 +1781,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2211` // Estimated: `10626` - // Minimum execution time: 412_223_000 picoseconds. - Weight::from_parts(430_190_000, 10626) + // Minimum execution time: 419_094_000 picoseconds. + Weight::from_parts(440_885_000, 10626) .saturating_add(T::DbWeight::get().reads(30_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } @@ -1872,18 +1858,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::ValidatorTrust` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ValidatorPermit` (r:1 w:1) /// Proof: `SubtensorModule::ValidatorPermit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RegisteredSubnetCounter` (r:1 w:1) + /// Proof: `SubtensorModule::RegisteredSubnetCounter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TokenSymbol` (r:3 w:1) /// Proof: `SubtensorModule::TokenSymbol` (`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::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::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::TotalStake` (r:1 w:1) /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:1 w:1) @@ -1941,15 +1919,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `k` is `[2, 500]`. fn register_leased_network(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1979 + k * (44 ±0)` - // Estimated: `10400 + k * (2579 ±0)` - // Minimum execution time: 488_338_000 picoseconds. - Weight::from_parts(286_320_370, 10400) - // Standard Error: 33_372 - .saturating_add(Weight::from_parts(47_145_967, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(54_u64)) + // Measured: `1762 + k * (44 ±0)` + // Estimated: `10183 + k * (2579 ±0)` + // Minimum execution time: 470_329_000 picoseconds. + Weight::from_parts(418_764_108, 10183) + // Standard Error: 49_669 + .saturating_add(Weight::from_parts(48_083_065, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(50_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(54_u64)) + .saturating_add(T::DbWeight::get().writes(52_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) } @@ -1976,10 +1954,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1447 + k * (53 ±0)` // Estimated: `6148 + k * (2514 ±0)` - // Minimum execution time: 112_219_000 picoseconds. - Weight::from_parts(130_541_041, 6148) - // Standard Error: 7_186 - .saturating_add(Weight::from_parts(1_496_294, 0).saturating_mul(k.into())) + // Minimum execution time: 92_884_000 picoseconds. + Weight::from_parts(80_858_260, 6148) + // Standard Error: 4_349 + .saturating_add(Weight::from_parts(1_581_238, 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)) @@ -1994,8 +1972,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `649` // Estimated: `9064` - // Minimum execution time: 24_617_000 picoseconds. - Weight::from_parts(25_379_000, 9064) + // Minimum execution time: 27_943_000 picoseconds. + Weight::from_parts(29_074_000, 9064) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2023,8 +2001,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1060` // Estimated: `4525` - // Minimum execution time: 72_058_000 picoseconds. - Weight::from_parts(73_902_000, 4525) + // Minimum execution time: 74_289_000 picoseconds. + Weight::from_parts(75_341_000, 4525) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2040,8 +2018,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 31_788_000 picoseconds. - Weight::from_parts(32_469_000, 4264) + // Minimum execution time: 33_553_000 picoseconds. + Weight::from_parts(34_104_000, 4264) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2057,8 +2035,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 15_574_000 picoseconds. - Weight::from_parts(15_894_000, 3941) + // Minimum execution time: 17_673_000 picoseconds. + Weight::from_parts(18_735_000, 3941) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2088,8 +2066,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1908` // Estimated: `7848` - // Minimum execution time: 137_608_000 picoseconds. - Weight::from_parts(140_011_000, 7848) + // Minimum execution time: 135_954_000 picoseconds. + Weight::from_parts(137_357_000, 7848) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2099,8 +2077,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_983_000 picoseconds. - Weight::from_parts(2_173_000, 0) + // Minimum execution time: 2_584_000 picoseconds. + Weight::from_parts(2_975_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) @@ -2109,8 +2087,23 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_336_000 picoseconds. - Weight::from_parts(4_737_000, 0) + // Minimum execution time: 5_309_000 picoseconds. + Weight::from_parts(5_560_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:1 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:0 w:1) + /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_auto_parent_delegation_enabled() -> Weight { + // Proof Size summary in bytes: + // Measured: `852` + // Estimated: `4317` + // Minimum execution time: 26_680_000 picoseconds. + Weight::from_parts(27_592_000, 4317) + .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2177,8 +2170,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2365` // Estimated: `8556` - // Minimum execution time: 471_702_000 picoseconds. - Weight::from_parts(484_481_000, 8556) + // Minimum execution time: 472_785_000 picoseconds. + Weight::from_parts(495_848_000, 8556) .saturating_add(T::DbWeight::get().reads(30_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -2188,26 +2181,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_013_000 picoseconds. - Weight::from_parts(2_243_000, 0) + // Minimum execution time: 2_775_000 picoseconds. + Weight::from_parts(2_986_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:1 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:0 w:1) - /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_auto_parent_delegation_enabled() -> Weight { - // Proof Size summary in bytes: - // Measured: `852` - // Estimated: `4317` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 4317) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } } // For backwards compatibility and tests. @@ -2308,8 +2285,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1629` // Estimated: `13600` - // Minimum execution time: 348_026_000 picoseconds. - Weight::from_parts(354_034_000, 13600) + // Minimum execution time: 348_070_000 picoseconds. + Weight::from_parts(356_136_000, 13600) .saturating_add(RocksDbWeight::get().reads(46_u64)) .saturating_add(RocksDbWeight::get().writes(38_u64)) } @@ -2351,8 +2328,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `188782` // Estimated: `10327372` - // Minimum execution time: 16_089_221_000 picoseconds. - Weight::from_parts(16_473_771_000, 10327372) + // Minimum execution time: 15_061_457_000 picoseconds. + Weight::from_parts(15_447_901_000, 10327372) .saturating_add(RocksDbWeight::get().reads(4112_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2414,8 +2391,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2307` // Estimated: `8556` - // Minimum execution time: 338_691_000 picoseconds. - Weight::from_parts(346_814_000, 8556) + // Minimum execution time: 337_624_000 picoseconds. + Weight::from_parts(341_310_000, 8556) .saturating_add(RocksDbWeight::get().reads(27_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -2429,8 +2406,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `791` // Estimated: `6731` - // Minimum execution time: 32_479_000 picoseconds. - Weight::from_parts(33_721_000, 6731) + // Minimum execution time: 34_124_000 picoseconds. + Weight::from_parts(35_557_000, 6731) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2444,8 +2421,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `764` // Estimated: `6704` - // Minimum execution time: 29_264_000 picoseconds. - Weight::from_parts(30_095_000, 6704) + // Minimum execution time: 30_357_000 picoseconds. + Weight::from_parts(31_328_000, 6704) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2545,8 +2522,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1639` // Estimated: `13600` - // Minimum execution time: 341_145_000 picoseconds. - Weight::from_parts(345_863_000, 13600) + // Minimum execution time: 344_366_000 picoseconds. + Weight::from_parts(366_799_000, 13600) .saturating_add(RocksDbWeight::get().reads(46_u64)) .saturating_add(RocksDbWeight::get().writes(38_u64)) } @@ -2598,8 +2575,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1415` // Estimated: `4880` - // Minimum execution time: 100_752_000 picoseconds. - Weight::from_parts(102_565_000, 4880) + // Minimum execution time: 102_301_000 picoseconds. + Weight::from_parts(104_115_000, 4880) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -2669,18 +2646,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::ValidatorTrust` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ValidatorPermit` (r:1 w:1) /// Proof: `SubtensorModule::ValidatorPermit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RegisteredSubnetCounter` (r:1 w:1) + /// Proof: `SubtensorModule::RegisteredSubnetCounter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TokenSymbol` (r:3 w:1) /// Proof: `SubtensorModule::TokenSymbol` (`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::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::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::TotalStake` (r:1 w:1) /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:1 w:1) @@ -2725,12 +2694,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: 289_917_000 picoseconds. - Weight::from_parts(293_954_000, 10091) - .saturating_add(RocksDbWeight::get().reads(45_u64)) - .saturating_add(RocksDbWeight::get().writes(49_u64)) + // Measured: `1459` + // Estimated: `9874` + // Minimum execution time: 255_939_000 picoseconds. + Weight::from_parts(263_813_000, 9874) + .saturating_add(RocksDbWeight::get().reads(41_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`) @@ -2756,8 +2725,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1061` // Estimated: `4526` - // Minimum execution time: 59_199_000 picoseconds. - Weight::from_parts(60_772_000, 4526) + // Minimum execution time: 61_264_000 picoseconds. + Weight::from_parts(62_287_000, 4526) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2801,8 +2770,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1579` // Estimated: `7519` - // Minimum execution time: 107_763_000 picoseconds. - Weight::from_parts(109_746_000, 7519) + // Minimum execution time: 109_425_000 picoseconds. + Weight::from_parts(111_438_000, 7519) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2812,8 +2781,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(4_407_000, 0) + // Minimum execution time: 5_390_000 picoseconds. + Weight::from_parts(5_751_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2830,8 +2799,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `938` // Estimated: `4403` - // Minimum execution time: 45_358_000 picoseconds. - Weight::from_parts(46_140_000, 4403) + // Minimum execution time: 46_818_000 picoseconds. + Weight::from_parts(48_099_000, 4403) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2847,8 +2816,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 39_469_000 picoseconds. - Weight::from_parts(40_962_000, 4159) + // Minimum execution time: 42_900_000 picoseconds. + Weight::from_parts(44_463_000, 4159) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -2886,8 +2855,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1815` // Estimated: `12705` - // Minimum execution time: 260_764_000 picoseconds. - Weight::from_parts(265_261_000, 12705) + // Minimum execution time: 260_477_000 picoseconds. + Weight::from_parts(263_493_000, 12705) .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -2929,8 +2898,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1908` // Estimated: `12798` - // Minimum execution time: 281_736_000 picoseconds. - Weight::from_parts(286_753_000, 12798) + // Minimum execution time: 284_482_000 picoseconds. + Weight::from_parts(289_470_000, 12798) .saturating_add(RocksDbWeight::get().reads(31_u64)) .saturating_add(RocksDbWeight::get().writes(19_u64)) } @@ -2942,8 +2911,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 19_950_000 picoseconds. - Weight::from_parts(20_701_000, 4130) + // Minimum execution time: 22_452_000 picoseconds. + Weight::from_parts(23_043_000, 4130) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2955,8 +2924,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 16_415_000 picoseconds. - Weight::from_parts(17_096_000, 4078) + // Minimum execution time: 18_454_000 picoseconds. + Weight::from_parts(19_206_000, 4078) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2968,8 +2937,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_790_000 picoseconds. - Weight::from_parts(7_151_000, 0) + // Minimum execution time: 8_486_000 picoseconds. + Weight::from_parts(8_827_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3012,8 +2981,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2084` // Estimated: `8024` - // Minimum execution time: 426_724_000 picoseconds. - Weight::from_parts(431_712_000, 8024) + // Minimum execution time: 424_554_000 picoseconds. + Weight::from_parts(433_861_000, 8024) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3039,8 +3008,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 128_484_000 picoseconds. - Weight::from_parts(130_548_000, 4889) + // Minimum execution time: 129_312_000 picoseconds. + Weight::from_parts(130_614_000, 4889) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -3066,8 +3035,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1424` // Estimated: `4889` - // Minimum execution time: 126_171_000 picoseconds. - Weight::from_parts(128_965_000, 4889) + // Minimum execution time: 127_979_000 picoseconds. + Weight::from_parts(128_931_000, 4889) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3087,8 +3056,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1079` // Estimated: `4544` - // Minimum execution time: 37_957_000 picoseconds. - Weight::from_parts(38_939_000, 4544) + // Minimum execution time: 38_592_000 picoseconds. + Weight::from_parts(39_554_000, 4544) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3150,8 +3119,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2307` // Estimated: `8556` - // Minimum execution time: 376_539_000 picoseconds. - Weight::from_parts(383_750_000, 8556) + // Minimum execution time: 377_325_000 picoseconds. + Weight::from_parts(380_301_000, 8556) .saturating_add(RocksDbWeight::get().reads(27_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -3187,8 +3156,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2002` // Estimated: `7942` - // Minimum execution time: 222_486_000 picoseconds. - Weight::from_parts(223_918_000, 7942) + // Minimum execution time: 219_000_000 picoseconds. + Weight::from_parts(221_754_000, 7942) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -3246,8 +3215,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2211` // Estimated: `10626` - // Minimum execution time: 387_646_000 picoseconds. - Weight::from_parts(403_169_000, 10626) + // Minimum execution time: 397_733_000 picoseconds. + Weight::from_parts(418_001_000, 10626) .saturating_add(RocksDbWeight::get().reads(30_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -3307,8 +3276,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2494` // Estimated: `8556` - // Minimum execution time: 461_377_000 picoseconds. - Weight::from_parts(477_951_000, 8556) + // Minimum execution time: 463_767_000 picoseconds. + Weight::from_parts(469_047_000, 8556) .saturating_add(RocksDbWeight::get().reads(40_u64)) .saturating_add(RocksDbWeight::get().writes(22_u64)) } @@ -3346,8 +3315,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1829` // Estimated: `7769` - // Minimum execution time: 215_726_000 picoseconds. - Weight::from_parts(219_552_000, 7769) + // Minimum execution time: 215_332_000 picoseconds. + Weight::from_parts(218_628_000, 7769) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -3407,8 +3376,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2421` // Estimated: `8556` - // Minimum execution time: 402_808_000 picoseconds. - Weight::from_parts(420_035_000, 8556) + // Minimum execution time: 405_518_000 picoseconds. + Weight::from_parts(428_160_000, 8556) .saturating_add(RocksDbWeight::get().reads(40_u64)) .saturating_add(RocksDbWeight::get().writes(22_u64)) } @@ -3438,8 +3407,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1084` // Estimated: `4549` - // Minimum execution time: 125_589_000 picoseconds. - Weight::from_parts(141_484_000, 4549) + // Minimum execution time: 128_470_000 picoseconds. + Weight::from_parts(130_904_000, 4549) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3479,8 +3448,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1416` // Estimated: `7356` - // Minimum execution time: 99_310_000 picoseconds. - Weight::from_parts(101_193_000, 7356) + // Minimum execution time: 102_201_000 picoseconds. + Weight::from_parts(103_063_000, 7356) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3496,8 +3465,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `793` // Estimated: `4258` - // Minimum execution time: 25_499_000 picoseconds. - Weight::from_parts(26_330_000, 4258) + // Minimum execution time: 28_173_000 picoseconds. + Weight::from_parts(29_124_000, 4258) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3515,8 +3484,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `886` // Estimated: `4351` - // Minimum execution time: 32_540_000 picoseconds. - Weight::from_parts(33_501_000, 4351) + // Minimum execution time: 34_855_000 picoseconds. + Weight::from_parts(36_077_000, 4351) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3584,18 +3553,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::ValidatorTrust` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ValidatorPermit` (r:1 w:1) /// Proof: `SubtensorModule::ValidatorPermit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RegisteredSubnetCounter` (r:1 w:1) + /// Proof: `SubtensorModule::RegisteredSubnetCounter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TokenSymbol` (r:3 w:1) /// Proof: `SubtensorModule::TokenSymbol` (`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::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::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::TotalStake` (r:1 w:1) /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:1 w:1) @@ -3640,12 +3601,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_network_with_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `1560` - // Estimated: `9975` - // Minimum execution time: 279_983_000 picoseconds. - Weight::from_parts(284_690_000, 9975) - .saturating_add(RocksDbWeight::get().reads(44_u64)) - .saturating_add(RocksDbWeight::get().writes(48_u64)) + // Measured: `1343` + // Estimated: `9758` + // Minimum execution time: 253_714_000 picoseconds. + Weight::from_parts(256_750_000, 9758) + .saturating_add(RocksDbWeight::get().reads(40_u64)) + .saturating_add(RocksDbWeight::get().writes(46_u64)) } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3657,8 +3618,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `762` // Estimated: `6702` - // Minimum execution time: 31_257_000 picoseconds. - Weight::from_parts(32_769_000, 6702) + // Minimum execution time: 33_913_000 picoseconds. + Weight::from_parts(34_886_000, 6702) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3672,8 +3633,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `842` // Estimated: `6782` - // Minimum execution time: 28_703_000 picoseconds. - Weight::from_parts(30_106_000, 6782) + // Minimum execution time: 31_218_000 picoseconds. + Weight::from_parts(32_160_000, 6782) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3685,8 +3646,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `595` // Estimated: `4060` - // Minimum execution time: 15_634_000 picoseconds. - Weight::from_parts(16_254_000, 4060) + // Minimum execution time: 17_743_000 picoseconds. + Weight::from_parts(18_285_000, 4060) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3698,6 +3659,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TxRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:6 w:10) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:9 w:8) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`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::Alpha` (r:9 w:0) @@ -3724,8 +3689,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:5 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:4 w:8) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:4 w:0) @@ -3740,8 +3705,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LoadedEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NeuronCertificates` (r:4 w:0) /// Proof: `SubtensorModule::NeuronCertificates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:8 w:8) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyShares` (r:8 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:8 w:8) @@ -3756,9 +3719,9 @@ 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) - .saturating_add(RocksDbWeight::get().reads(159_u64)) + // Minimum execution time: 1_157_243_000 picoseconds. + Weight::from_parts(1_163_966_000, 28766) + .saturating_add(RocksDbWeight::get().reads(161_u64)) .saturating_add(RocksDbWeight::get().writes(95_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -3771,8 +3734,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `745` // Estimated: `4210` - // Minimum execution time: 21_963_000 picoseconds. - Weight::from_parts(22_504_000, 4210) + // Minimum execution time: 23_875_000 picoseconds. + Weight::from_parts(24_466_000, 4210) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3786,8 +3749,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `740` // Estimated: `9155` - // Minimum execution time: 24_397_000 picoseconds. - Weight::from_parts(25_138_000, 9155) + // Minimum execution time: 27_351_000 picoseconds. + Weight::from_parts(28_013_000, 9155) .saturating_add(RocksDbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -3854,8 +3817,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2372` // Estimated: `10787` - // Minimum execution time: 414_015_000 picoseconds. - Weight::from_parts(427_445_000, 10787) + // Minimum execution time: 418_041_000 picoseconds. + Weight::from_parts(426_828_000, 10787) .saturating_add(RocksDbWeight::get().reads(44_u64)) .saturating_add(RocksDbWeight::get().writes(24_u64)) } @@ -3913,8 +3876,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2211` // Estimated: `10626` - // Minimum execution time: 412_223_000 picoseconds. - Weight::from_parts(430_190_000, 10626) + // Minimum execution time: 419_094_000 picoseconds. + Weight::from_parts(440_885_000, 10626) .saturating_add(RocksDbWeight::get().reads(30_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -3990,18 +3953,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::ValidatorTrust` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ValidatorPermit` (r:1 w:1) /// Proof: `SubtensorModule::ValidatorPermit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RegisteredSubnetCounter` (r:1 w:1) + /// Proof: `SubtensorModule::RegisteredSubnetCounter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TokenSymbol` (r:3 w:1) /// Proof: `SubtensorModule::TokenSymbol` (`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::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::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::TotalStake` (r:1 w:1) /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:1 w:1) @@ -4059,15 +4014,15 @@ impl WeightInfo for () { /// The range of component `k` is `[2, 500]`. fn register_leased_network(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1979 + k * (44 ±0)` - // Estimated: `10400 + k * (2579 ±0)` - // Minimum execution time: 488_338_000 picoseconds. - Weight::from_parts(286_320_370, 10400) - // Standard Error: 33_372 - .saturating_add(Weight::from_parts(47_145_967, 0).saturating_mul(k.into())) - .saturating_add(RocksDbWeight::get().reads(54_u64)) + // Measured: `1762 + k * (44 ±0)` + // Estimated: `10183 + k * (2579 ±0)` + // Minimum execution time: 470_329_000 picoseconds. + Weight::from_parts(418_764_108, 10183) + // Standard Error: 49_669 + .saturating_add(Weight::from_parts(48_083_065, 0).saturating_mul(k.into())) + .saturating_add(RocksDbWeight::get().reads(50_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into()))) - .saturating_add(RocksDbWeight::get().writes(54_u64)) + .saturating_add(RocksDbWeight::get().writes(52_u64)) .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) } @@ -4094,10 +4049,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1447 + k * (53 ±0)` // Estimated: `6148 + k * (2514 ±0)` - // Minimum execution time: 112_219_000 picoseconds. - Weight::from_parts(130_541_041, 6148) - // Standard Error: 7_186 - .saturating_add(Weight::from_parts(1_496_294, 0).saturating_mul(k.into())) + // Minimum execution time: 92_884_000 picoseconds. + Weight::from_parts(80_858_260, 6148) + // Standard Error: 4_349 + .saturating_add(Weight::from_parts(1_581_238, 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)) @@ -4112,8 +4067,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `649` // Estimated: `9064` - // Minimum execution time: 24_617_000 picoseconds. - Weight::from_parts(25_379_000, 9064) + // Minimum execution time: 27_943_000 picoseconds. + Weight::from_parts(29_074_000, 9064) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4141,8 +4096,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1060` // Estimated: `4525` - // Minimum execution time: 72_058_000 picoseconds. - Weight::from_parts(73_902_000, 4525) + // Minimum execution time: 74_289_000 picoseconds. + Weight::from_parts(75_341_000, 4525) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4158,8 +4113,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 31_788_000 picoseconds. - Weight::from_parts(32_469_000, 4264) + // Minimum execution time: 33_553_000 picoseconds. + Weight::from_parts(34_104_000, 4264) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4175,8 +4130,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 15_574_000 picoseconds. - Weight::from_parts(15_894_000, 3941) + // Minimum execution time: 17_673_000 picoseconds. + Weight::from_parts(18_735_000, 3941) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4206,8 +4161,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1908` // Estimated: `7848` - // Minimum execution time: 137_608_000 picoseconds. - Weight::from_parts(140_011_000, 7848) + // Minimum execution time: 135_954_000 picoseconds. + Weight::from_parts(137_357_000, 7848) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4217,8 +4172,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_983_000 picoseconds. - Weight::from_parts(2_173_000, 0) + // Minimum execution time: 2_584_000 picoseconds. + Weight::from_parts(2_975_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) @@ -4227,8 +4182,23 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_336_000 picoseconds. - Weight::from_parts(4_737_000, 0) + // Minimum execution time: 5_309_000 picoseconds. + Weight::from_parts(5_560_000, 0) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:1 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:0 w:1) + /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_auto_parent_delegation_enabled() -> Weight { + // Proof Size summary in bytes: + // Measured: `852` + // Estimated: `4317` + // Minimum execution time: 26_680_000 picoseconds. + Weight::from_parts(27_592_000, 4317) + .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -4295,8 +4265,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2365` // Estimated: `8556` - // Minimum execution time: 471_702_000 picoseconds. - Weight::from_parts(484_481_000, 8556) + // Minimum execution time: 472_785_000 picoseconds. + Weight::from_parts(495_848_000, 8556) .saturating_add(RocksDbWeight::get().reads(30_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -4306,24 +4276,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_013_000 picoseconds. - Weight::from_parts(2_243_000, 0) + // Minimum execution time: 2_775_000 picoseconds. + Weight::from_parts(2_986_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:1 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:0 w:1) - /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_auto_parent_delegation_enabled() -> Weight { - // Proof Size summary in bytes: - // Measured: `852` - // Estimated: `4317` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 4317) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } } From 78ad491396f6da013bc8c545d6587f8dad434123 Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 24 Apr 2026 08:50:05 -0500 Subject: [PATCH 13/15] chore: bump spec_version 397 -> 398 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unblocks the Devnet Deploy Check — devnet chain has caught up to spec_version 397, so local must be strictly greater. --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ed6d4d6176..a2911cbe5e 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -272,7 +272,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 397, + spec_version: 398, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From f52ec05faf5abc8665b2818395263ab676b07325 Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 24 Apr 2026 09:06:20 -0500 Subject: [PATCH 14/15] Revert "chore: bump spec_version 397 -> 398" This reverts commit 78ad491396f6da013bc8c545d6587f8dad434123. --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a2911cbe5e..ed6d4d6176 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -272,7 +272,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 398, + spec_version: 397, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From a73b929928984097cd19751df1749e52bb622a2f Mon Sep 17 00:00:00 2001 From: Landyn Date: Fri, 24 Apr 2026 09:11:03 -0500 Subject: [PATCH 15/15] chore: match devnet-ready spec_version (401) --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ed6d4d6176..7c4112837d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -272,7 +272,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 397, + spec_version: 401, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,