From 9643f7faed8727e8ff93fea86f2c815f9110c8cb Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 12:42:21 +0200 Subject: [PATCH 1/9] Bypass rate limit for the same netuid stake transfer --- pallets/subtensor/src/staking/stake_utils.rs | 13 ++-- pallets/subtensor/src/tests/move_stake.rs | 76 ++++++++++++++++++-- 2 files changed, 79 insertions(+), 10 deletions(-) diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 0f6a553c91..4a3018e617 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1244,11 +1244,14 @@ impl Pallet { ensure!(origin_netuid != destination_netuid, Error::::SameNetuid); } - Self::ensure_stake_operation_limit_not_exceeded( - origin_hotkey, - origin_coldkey, - origin_netuid.into(), - )?; + // Only rate-limit cross-subnet transitions. + if origin_netuid != destination_netuid { + Self::ensure_stake_operation_limit_not_exceeded( + origin_hotkey, + origin_coldkey, + origin_netuid.into(), + )?; + } // Ensure that both subnets exist. ensure!( diff --git a/pallets/subtensor/src/tests/move_stake.rs b/pallets/subtensor/src/tests/move_stake.rs index a991df20a5..86d17011c8 100644 --- a/pallets/subtensor/src/tests/move_stake.rs +++ b/pallets/subtensor/src/tests/move_stake.rs @@ -1812,7 +1812,8 @@ fn test_transfer_stake_rate_limited() { new_test_ext(1).execute_with(|| { let subnet_owner_coldkey = U256::from(1001); let subnet_owner_hotkey = U256::from(1002); - let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); + let origin_netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); + let destination_netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); let origin_coldkey = U256::from(1); let destination_coldkey = U256::from(2); @@ -1825,7 +1826,7 @@ fn test_transfer_stake_rate_limited() { SubtensorModule::stake_into_subnet( &hotkey, &origin_coldkey, - netuid, + origin_netuid, stake_amount.into(), ::SwapInterface::max_price(), true, @@ -1835,16 +1836,19 @@ fn test_transfer_stake_rate_limited() { let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &origin_coldkey, - netuid, + origin_netuid, ); + // add_stake set the limiter for (hotkey, origin_coldkey, origin_netuid). + // A cross-subnet transfer in the same block goes through the AMM (price impact), + // so it is still rate limited. assert_err!( SubtensorModule::do_transfer_stake( RuntimeOrigin::signed(origin_coldkey), destination_coldkey, hotkey, - netuid, - netuid, + origin_netuid, + destination_netuid, alpha ), Error::::StakingOperationRateLimitExceeded @@ -1852,6 +1856,68 @@ fn test_transfer_stake_rate_limited() { }); } +#[test] +fn test_transfer_stake_same_netuid_not_rate_limited() { + new_test_ext(1).execute_with(|| { + let subnet_owner_coldkey = U256::from(1001); + let subnet_owner_hotkey = U256::from(1002); + let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); + + let origin_coldkey = U256::from(1); + let destination_coldkey = U256::from(2); + let hotkey = U256::from(3); + let stake_amount = DefaultMinStake::::get().to_u64() * 10; + + let _ = SubtensorModule::create_account_if_non_existent(&origin_coldkey, &hotkey); + let _ = SubtensorModule::create_account_if_non_existent(&destination_coldkey, &hotkey); + add_balance_to_coldkey_account(&origin_coldkey, stake_amount.into()); + SubtensorModule::stake_into_subnet( + &hotkey, + &origin_coldkey, + netuid, + stake_amount.into(), + ::SwapInterface::max_price(), + true, + false, + ) + .unwrap(); + let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, + &origin_coldkey, + netuid, + ); + + // add_stake set the limiter for (hotkey, origin_coldkey, netuid), but a same-netuid + // transfer performs no AMM swap (no price impact), so it is NOT rate limited + assert_ok!(SubtensorModule::do_transfer_stake( + RuntimeOrigin::signed(origin_coldkey), + destination_coldkey, + hotkey, + netuid, + netuid, + alpha + )); + + // The whole position was moved to the destination coldkey on the same subnet. + assert_eq!( + SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, + &origin_coldkey, + netuid + ), + AlphaBalance::ZERO + ); + assert_ne!( + SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, + &destination_coldkey, + netuid + ), + AlphaBalance::ZERO + ); + }); +} + #[test] fn test_transfer_stake_doesnt_limit_destination_coldkey() { new_test_ext(1).execute_with(|| { From 0476b632213003fe8cbb120d46b294a2549184fe Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 12:56:57 +0200 Subject: [PATCH 2/9] minor fix --- pallets/subtensor/src/staking/stake_utils.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 4a3018e617..7be1c7adf8 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1244,21 +1244,19 @@ impl Pallet { ensure!(origin_netuid != destination_netuid, Error::::SameNetuid); } - // Only rate-limit cross-subnet transitions. + // Ensure that both subnets exist. + ensure!( + Self::if_subnet_exist(origin_netuid), + Error::::SubnetNotExists + ); if origin_netuid != destination_netuid { + // Only rate-limit cross-subnet transitions. Self::ensure_stake_operation_limit_not_exceeded( origin_hotkey, origin_coldkey, origin_netuid.into(), )?; - } - // Ensure that both subnets exist. - ensure!( - Self::if_subnet_exist(origin_netuid), - Error::::SubnetNotExists - ); - if origin_netuid != destination_netuid { ensure!( Self::if_subnet_exist(destination_netuid), Error::::SubnetNotExists From 66ad30ab1e27b018f0c52036df7dd204e114c255 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 13:31:28 +0200 Subject: [PATCH 3/9] - Fixed PR comment + rust test + ts test --- pallets/subtensor/src/staking/stake_utils.rs | 10 + pallets/subtensor/src/tests/move_stake.rs | 77 ++++++ .../staking/test-transfer-stake-rate-limit.ts | 252 ++++++++++++++++++ 3 files changed, 339 insertions(+) create mode 100644 ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 7be1c7adf8..5ce19c5c3e 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -1040,6 +1040,16 @@ impl Pallet { 0_u64, // 0 fee )); + // Carry the per-block staking-operation limit across the transfer. Same-netuid + // transfers/moves are not rate-limited themselves (no AMM price impact), but if the + // origin tuple is already limited this block (e.g. a same-block `add_stake` set the + // marker), we propagate it to the destination tuple. Otherwise a same-block `add_stake` + // could be laundered to a fresh (hotkey, coldkey) tuple and then removed / swapped / + // cross-subnet transferred within the same block, bypassing the limiter. + if StakingOperationRateLimiter::::contains_key((origin_hotkey, origin_coldkey, netuid)) { + Self::set_stake_operation_limit(destination_hotkey, destination_coldkey, netuid); + } + Ok(tao_equivalent) } diff --git a/pallets/subtensor/src/tests/move_stake.rs b/pallets/subtensor/src/tests/move_stake.rs index 86d17011c8..40f76247e6 100644 --- a/pallets/subtensor/src/tests/move_stake.rs +++ b/pallets/subtensor/src/tests/move_stake.rs @@ -1918,6 +1918,83 @@ fn test_transfer_stake_same_netuid_not_rate_limited() { }); } +#[test] +fn test_transfer_stake_same_netuid_propagates_rate_limit() { + new_test_ext(1).execute_with(|| { + let subnet_owner_coldkey = U256::from(1001); + let subnet_owner_hotkey = U256::from(1002); + let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); + + let origin_coldkey = U256::from(1); + let destination_coldkey = U256::from(2); + let hotkey = U256::from(3); + let stake_amount = DefaultMinStake::::get().to_u64() * 10; + + let _ = SubtensorModule::create_account_if_non_existent(&origin_coldkey, &hotkey); + let _ = SubtensorModule::create_account_if_non_existent(&destination_coldkey, &hotkey); + add_balance_to_coldkey_account(&origin_coldkey, stake_amount.into()); + + // add_stake sets the limiter for the origin tuple (hotkey, origin_coldkey, netuid). + SubtensorModule::stake_into_subnet( + &hotkey, + &origin_coldkey, + netuid, + stake_amount.into(), + ::SwapInterface::max_price(), + true, + false, + ) + .unwrap(); + let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, + &origin_coldkey, + netuid, + ); + + // Same-netuid transfer to a different coldkey is allowed (no AMM price impact)... + assert_ok!(SubtensorModule::do_transfer_stake( + RuntimeOrigin::signed(origin_coldkey), + destination_coldkey, + hotkey, + netuid, + netuid, + alpha + )); + + // ...but the limiter marker is PROPAGATED to the destination tuple, closing the + // laundering bypass: the moved stake cannot be removed/swapped/cross-subnet transferred + // from the destination tuple within the same block. + assert!(StakingOperationRateLimiter::::contains_key(( + hotkey, + destination_coldkey, + netuid + ))); + + let moved_alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &hotkey, + &destination_coldkey, + netuid, + ); + assert_err!( + SubtensorModule::remove_stake( + RuntimeOrigin::signed(destination_coldkey), + hotkey, + netuid, + moved_alpha + ), + Error::::StakingOperationRateLimitExceeded + ); + + // The limiter clears at the block boundary, so removal works in the next block. + next_block(); + assert!(!StakingOperationRateLimiter::::contains_key(( + hotkey, + destination_coldkey, + netuid + ))); + }); +} + #[test] fn test_transfer_stake_doesnt_limit_destination_coldkey() { new_test_ext(1).execute_with(|| { diff --git a/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts b/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts new file mode 100644 index 0000000000..ede2808a68 --- /dev/null +++ b/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts @@ -0,0 +1,252 @@ +import { beforeAll, describeSuite, expect } from "@moonwall/cli"; +import type { ApiPromise } from "@polkadot/api"; +import type { KeyringPair } from "@moonwall/util"; +import { tao, generateKeyringPair } from "../../../../utils"; + +async function devForceSetBalance( + polkadotJs: ApiPromise, + context: any, + address: string, + amount: bigint +): Promise { + await context.createBlock([ + await polkadotJs.tx.sudo + .sudo(polkadotJs.tx.balances.forceSetBalance(address, amount)) + .signAsync(context.keyring.alice), + ]); +} + +async function devSudoSetLockReductionInterval( + polkadotJs: ApiPromise, + context: any, + alice: KeyringPair, + interval: number +): Promise { + await context.createBlock([await polkadotJs.tx.adminUtils.sudoSetLockReductionInterval(interval).signAsync(alice)]); +} + +async function devRegisterSubnet( + polkadotJs: ApiPromise, + context: any, + alice: KeyringPair, + hotkey: KeyringPair +): Promise { + await context.createBlock([await polkadotJs.tx.subtensorModule.registerNetwork(hotkey.address).signAsync(alice)]); + const events = (await polkadotJs.query.system.events()) as any; + const netuid = (events as any[]).filter((e: any) => e.event.method === "NetworkAdded")[0].event.data[0].toNumber(); + return netuid; +} + +async function devEnableSubtoken( + polkadotJs: ApiPromise, + context: any, + alice: KeyringPair, + netuid: number +): Promise { + await context.createBlock([ + await polkadotJs.tx.sudo.sudo(polkadotJs.tx.adminUtils.sudoSetSubtokenEnabled(netuid, true)).signAsync(alice), + ]); +} + +async function devAssociateHotKey( + polkadotJs: ApiPromise, + context: any, + coldkey: KeyringPair, + hotkey: string +): Promise { + await context.createBlock([await polkadotJs.tx.subtensorModule.tryAssociateHotkey(hotkey).signAsync(coldkey)]); +} + +async function devGetAlphaStake( + polkadotJs: ApiPromise, + hotkey: string, + coldkey: string, + netuid: number +): Promise { + const value = (await polkadotJs.query.subtensorModule.alphaV2(hotkey, coldkey, netuid)) as any; + const mantissa = value.mantissa; + const exponent = value.exponent; + if (exponent >= 0n) { + return BigInt(mantissa) * BigInt(10) ** BigInt(exponent); + } + return BigInt(mantissa) / BigInt(10) ** BigInt(-exponent); +} + +describeSuite({ + id: "DEV_SUB_STAKING_TRANSFER_RATE_LIMIT", + title: "staking rate limiter — add_stake then transfer_stake in one block", + foundationMethods: "dev", + testCases: ({ it, context }) => { + let polkadotJs: ApiPromise; + let alice: KeyringPair; + let aliceHotKey: KeyringPair; + let destinationColdkey: KeyringPair; + let netuid: number; + + beforeAll(async () => { + polkadotJs = context.polkadotJs(); + alice = context.keyring.alice; + aliceHotKey = generateKeyringPair("sr25519"); + destinationColdkey = generateKeyringPair("sr25519"); + + await devForceSetBalance(polkadotJs, context, alice.address, tao(10_000)); + // ensure destination coldkey can receive transferred stake + await devForceSetBalance(polkadotJs, context, destinationColdkey.address, tao(10_000)); + await devSudoSetLockReductionInterval(polkadotJs, context, alice, 1); + + await context.createBlock([ + await polkadotJs.tx.sudo.sudo(polkadotJs.tx.adminUtils.sudoSetNetworkRateLimit(0)).signAsync(alice), + ]); + + netuid = await devRegisterSubnet(polkadotJs, context, alice, aliceHotKey); + + await devEnableSubtoken(polkadotJs, context, alice, netuid); + await devAssociateHotKey(polkadotJs, context, alice, aliceHotKey.address); + }); + + it({ + id: "T01", + title: "add_stake + same-subnet transfer_stake in one block now BOTH succeed (rate limiter skipped for same-subnet)", + test: async () => { + // Both extrinsics are signed by alice, so use explicit incrementing + // nonces to land them in the same block in submission order. + const aliceNonce = ((await polkadotJs.query.system.account(alice.address)) as any).nonce.toNumber(); + + // Stake a large amount so the same-block transfer has plenty of alpha + // to move and clears the DefaultMinStake floor. + const addTx = await polkadotJs.tx.subtensorModule + .addStake(aliceHotKey.address, netuid, tao(100)) + .signAsync(alice, { nonce: aliceNonce }); + + const transferAmount = 1_000_000_000n; + const transferTx = await polkadotJs.tx.subtensorModule + .transferStake(destinationColdkey.address, aliceHotKey.address, netuid, netuid, transferAmount) + .signAsync(alice, { nonce: aliceNonce + 1 }); + + const { result } = await context.createBlock([addTx, transferTx]); + const [addAttempt, transferAttempt] = result; + + expect(addAttempt.successful).toEqual(true); + expect(transferAttempt.successful).toEqual(true); + }, + }); + + it({ + id: "T02", + title: "the same add_stake and transfer_stake across SEPARATE blocks both succeed — only the block boundary matters", + test: async () => { + // add in its own block — limiter is set then drained on_finalize + const { + result: [addAttempt2], + } = await context.createBlock([ + await polkadotJs.tx.subtensorModule + .addStake(aliceHotKey.address, netuid, tao(100)) + .signAsync(alice), + ]); + expect(addAttempt2.successful).toEqual(true); + + const alphaStaked = await devGetAlphaStake(polkadotJs, aliceHotKey.address, alice.address, netuid); + const transferAmount = alphaStaked / 2n; + expect(transferAmount > 0n).toEqual(true); + + // transfer in the NEXT block — same triple, limiter cleared, succeeds + const { + result: [transferAttempt2], + } = await context.createBlock([ + await polkadotJs.tx.subtensorModule + .transferStake(destinationColdkey.address, aliceHotKey.address, netuid, netuid, transferAmount) + .signAsync(alice), + ]); + expect(transferAttempt2.successful).toEqual(true); + }, + }); + + it({ + id: "T03", + title: "two add_stake on the IDENTICAL (coldkey, hotkey, netuid) in the SAME block both succeed — add_stake sets the limiter but never checks it", + test: async () => { + const aliceNonce = ((await polkadotJs.query.system.account(alice.address)) as any).nonce.toNumber(); + + const addTx1 = await polkadotJs.tx.subtensorModule + .addStake(aliceHotKey.address, netuid, tao(10)) + .signAsync(alice, { nonce: aliceNonce }); + + const addTx2 = await polkadotJs.tx.subtensorModule + .addStake(aliceHotKey.address, netuid, tao(10)) + .signAsync(alice, { nonce: aliceNonce + 1 }); + + const { result } = await context.createBlock([addTx1, addTx2]); + const [addAttempt1, addAttempt2] = result; + + expect(addAttempt1.successful).toEqual(true); + expect(addAttempt2.successful).toEqual(true); + }, + }); + + it({ + id: "T04", + title: "remove_stake then transfer_stake on the IDENTICAL (coldkey, hotkey, netuid) in the SAME block both succeed — neither SETS the limiter, both only CHECK it", + test: async () => { + const { + result: [seedAdd], + } = await context.createBlock([ + await polkadotJs.tx.subtensorModule + .addStake(aliceHotKey.address, netuid, tao(100)) + .signAsync(alice), + ]); + expect(seedAdd.successful).toEqual(true); + + // Size both legs as a real fraction of available alpha so neither trips the + // DefaultMinStake floor, and their sum stays below the available balance. + const alphaStaked = await devGetAlphaStake(polkadotJs, aliceHotKey.address, alice.address, netuid); + const legAmount = alphaStaked / 4n; + expect(legAmount > 0n).toEqual(true); + + const aliceNonce = ((await polkadotJs.query.system.account(alice.address)) as any).nonce.toNumber(); + + const removeTx = await polkadotJs.tx.subtensorModule + .removeStake(aliceHotKey.address, netuid, legAmount) + .signAsync(alice, { nonce: aliceNonce }); + + const transferTx = await polkadotJs.tx.subtensorModule + .transferStake(destinationColdkey.address, aliceHotKey.address, netuid, netuid, legAmount) + .signAsync(alice, { nonce: aliceNonce + 1 }); + + const { result } = await context.createBlock([removeTx, transferTx]); + const [removeAttempt, transferAttempt] = result; + + expect(removeAttempt.successful).toEqual(true); + expect(transferAttempt.successful).toEqual(true); + }, + }); + + it({ + id: "T05", + title: "add_stake + CROSS-subnet transfer_stake in one block STILL reverts with StakingOperationRateLimitExceeded", + test: async () => { + const netuid2 = await devRegisterSubnet(polkadotJs, context, alice, aliceHotKey); + await devEnableSubtoken(polkadotJs, context, alice, netuid2); + + const aliceNonce = ((await polkadotJs.query.system.account(alice.address)) as any).nonce.toNumber(); + + const addTx = await polkadotJs.tx.subtensorModule + .addStake(aliceHotKey.address, netuid, tao(100)) + .signAsync(alice, { nonce: aliceNonce }); + + // A tiny amount is fine: the rate-limit check runs before the + // min-amount / liquidity checks on the cross-subnet path, so the failure + // is unambiguously the limiter. + const transferTx = await polkadotJs.tx.subtensorModule + .transferStake(destinationColdkey.address, aliceHotKey.address, netuid, netuid2, 1000n) + .signAsync(alice, { nonce: aliceNonce + 1 }); + + const { result } = await context.createBlock([addTx, transferTx]); + const [addAttempt, transferAttempt] = result; + + expect(addAttempt.successful).toEqual(true); + expect(transferAttempt.successful).toEqual(false); + expect(transferAttempt.error.name).toEqual("StakingOperationRateLimitExceeded"); + }, + }); + }, +}); From 3ad2f8c788b5e09c0eb0a888292aa01e49a49331 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 14:08:30 +0200 Subject: [PATCH 4/9] - Fixed PR comment --- pallets/subtensor/src/benchmarks.rs | 12 +- pallets/subtensor/src/weights.rs | 312 ++++++++++++++-------------- 2 files changed, 166 insertions(+), 158 deletions(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 1dd62bab0b..9e11faba5a 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -934,7 +934,11 @@ mod pallet_benchmarks { let _ = Subtensor::::create_account_if_non_existent(&coldkey, &destination); - StakingOperationRateLimiter::::remove((origin.clone(), coldkey.clone(), netuid)); + // Worst case for weight: the origin tuple is already rate-limited this block (e.g. a + // same-block `add_stake`). A same-netuid move is not rate-limited itself but propagates + // the limiter marker to the destination tuple, costing one extra + // `StakingOperationRateLimiter` write. + Subtensor::::set_stake_operation_limit(&origin, &coldkey, netuid); #[extrinsic_call] _( @@ -1172,7 +1176,11 @@ mod pallet_benchmarks { let _ = Subtensor::::create_account_if_non_existent(&dest, &hot); - StakingOperationRateLimiter::::remove((hot.clone(), coldkey.clone(), netuid)); + // Worst case for weight: the origin tuple is already rate-limited this block (e.g. a + // same-block `add_stake`). A same-netuid transfer is not rate-limited itself but + // propagates the limiter marker to the destination tuple, costing one extra + // `StakingOperationRateLimiter` write. + Subtensor::::set_stake_operation_limit(&hot, &coldkey, netuid); #[extrinsic_call] _( diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 6d536dadaa..eb7833d404 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -1100,43 +1100,43 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(38_u64)) .saturating_add(T::DbWeight::get().writes(18_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:2 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn move_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2060` - // Estimated: `8000` - // Minimum execution time: 222_999_000 picoseconds. - Weight::from_parts(227_526_000, 8000) - .saturating_add(T::DbWeight::get().reads(19_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:2 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn move_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2180` + // Estimated: `8120` + // Minimum execution time: 149_000_000 picoseconds. + Weight::from_parts(152_000_000, 8120) + .saturating_add(T::DbWeight::get().reads(19_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:1 w:0) @@ -1350,47 +1350,47 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(54_u64)) .saturating_add(T::DbWeight::get().writes(26_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) - /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Lock` (r:1 w:0) - /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn transfer_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2054` - // Estimated: `7994` - // Minimum execution time: 254_636_000 picoseconds. - Weight::from_parts(258_541_000, 7994) - .saturating_add(T::DbWeight::get().reads(18_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) + /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Lock` (r:1 w:0) + /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn transfer_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2174` + // Estimated: `8114` + // Minimum execution time: 166_000_000 picoseconds. + Weight::from_parts(168_000_000, 8114) + .saturating_add(T::DbWeight::get().reads(18_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -3480,43 +3480,43 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(38_u64)) .saturating_add(RocksDbWeight::get().writes(18_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:2 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn move_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2060` - // Estimated: `8000` - // Minimum execution time: 222_999_000 picoseconds. - Weight::from_parts(227_526_000, 8000) - .saturating_add(RocksDbWeight::get().reads(19_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) - } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:2 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn move_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2180` + // Estimated: `8120` + // Minimum execution time: 149_000_000 picoseconds. + Weight::from_parts(152_000_000, 8120) + .saturating_add(RocksDbWeight::get().reads(19_u64)) + .saturating_add(RocksDbWeight::get().writes(8_u64)) + } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:1 w:0) @@ -3730,47 +3730,47 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(54_u64)) .saturating_add(RocksDbWeight::get().writes(26_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) - /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Lock` (r:1 w:0) - /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn transfer_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2054` - // Estimated: `7994` - // Minimum execution time: 254_636_000 picoseconds. - Weight::from_parts(258_541_000, 7994) - .saturating_add(RocksDbWeight::get().reads(18_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) + /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Lock` (r:1 w:0) + /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) + /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn transfer_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2174` + // Estimated: `8114` + // Minimum execution time: 166_000_000 picoseconds. + Weight::from_parts(168_000_000, 8114) + .saturating_add(RocksDbWeight::get().reads(18_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) + } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) From 58e6056970fc3042cd4399a11dfe70facfe5a6e7 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 14:15:36 +0200 Subject: [PATCH 5/9] - version bump --- 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 14827faf48..e41653831c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -277,7 +277,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: 415, + spec_version: 416, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 4828fb5b031105be6318265a4345b9f783871b27 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 14:58:08 +0200 Subject: [PATCH 6/9] - fixed import --- .../dev/subtensor/staking/test-transfer-stake-rate-limit.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts b/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts index ede2808a68..bbd9820cba 100644 --- a/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts +++ b/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts @@ -1,7 +1,10 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import type { ApiPromise } from "@polkadot/api"; import type { KeyringPair } from "@moonwall/util"; -import { tao, generateKeyringPair } from "../../../../utils"; +import { generateKeyringPair } from "../../../../utils/account"; + +const TAO = 1_000_000_000n; // 10^9 RAO per TAO +const tao = (value: number): bigint => TAO * BigInt(value); async function devForceSetBalance( polkadotJs: ApiPromise, From 7b44e87e2d430f570e988fbd1b7b90df8c9ff6aa Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 3 Jun 2026 16:07:31 +0200 Subject: [PATCH 7/9] - reverted weights --- pallets/subtensor/src/weights.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index eb7833d404..3960c05b28 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -1133,7 +1133,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `2180` // Estimated: `8120` // Minimum execution time: 149_000_000 picoseconds. - Weight::from_parts(152_000_000, 8120) + Weight::from_parts(227_526_000, 8000) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -1387,7 +1387,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `2174` // Estimated: `8114` // Minimum execution time: 166_000_000 picoseconds. - Weight::from_parts(168_000_000, 8114) + Weight::from_parts(258_541_000, 7994) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -3513,7 +3513,7 @@ impl WeightInfo for () { // Measured: `2180` // Estimated: `8120` // Minimum execution time: 149_000_000 picoseconds. - Weight::from_parts(152_000_000, 8120) + Weight::from_parts(227_526_000, 8000) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } @@ -3767,7 +3767,7 @@ impl WeightInfo for () { // Measured: `2174` // Estimated: `8114` // Minimum execution time: 166_000_000 picoseconds. - Weight::from_parts(168_000_000, 8114) + Weight::from_parts(258_541_000, 7994) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } From f522bf7727bcc621ed5209213410ed3149877874 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 4 Jun 2026 12:40:45 +0200 Subject: [PATCH 8/9] - Remove staking rate limiter + benchmarks + tests + fmt --- chain-extensions/src/mock.rs | 5 - chain-extensions/src/tests.rs | 32 -- eco-tests/src/helpers.rs | 4 - pallets/subtensor/src/benchmarks.rs | 24 - pallets/subtensor/src/coinbase/root.rs | 15 - pallets/subtensor/src/lib.rs | 14 - pallets/subtensor/src/macros/errors.rs | 2 - pallets/subtensor/src/macros/hooks.rs | 11 - pallets/subtensor/src/staking/add_stake.rs | 2 - pallets/subtensor/src/staking/move_stake.rs | 6 - pallets/subtensor/src/staking/remove_stake.rs | 1 - pallets/subtensor/src/staking/stake_utils.rs | 45 -- pallets/subtensor/src/tests/children.rs | 1 - pallets/subtensor/src/tests/locks.rs | 15 - pallets/subtensor/src/tests/mock.rs | 5 - pallets/subtensor/src/tests/move_stake.rs | 218 -------- pallets/subtensor/src/tests/staking.rs | 72 --- pallets/subtensor/src/tests/subnet.rs | 4 - pallets/subtensor/src/weights.rs | 496 ++++++++---------- pallets/transaction-fee/src/tests/mock.rs | 5 - pallets/transaction-fee/src/tests/mod.rs | 1 - precompiles/src/staking.rs | 30 -- .../staking/test-transfer-stake-rate-limit.ts | 22 +- 23 files changed, 236 insertions(+), 794 deletions(-) diff --git a/chain-extensions/src/mock.rs b/chain-extensions/src/mock.rs index 37c6d4fb47..fc3398bbb9 100644 --- a/chain-extensions/src/mock.rs +++ b/chain-extensions/src/mock.rs @@ -765,11 +765,6 @@ pub fn add_dynamic_network(hotkey: &U256, coldkey: &U256) -> NetUid { netuid } -#[allow(dead_code)] -pub(crate) fn remove_stake_rate_limit_for_tests(hotkey: &U256, coldkey: &U256, netuid: NetUid) { - StakingOperationRateLimiter::::remove((hotkey, coldkey, netuid)); -} - #[allow(dead_code)] pub(crate) fn setup_reserves(netuid: NetUid, tao: TaoBalance, alpha: AlphaBalance) { SubnetTAO::::set(netuid, tao); diff --git a/chain-extensions/src/tests.rs b/chain-extensions/src/tests.rs index 08a9e17f77..eeac0ce451 100644 --- a/chain-extensions/src/tests.rs +++ b/chain-extensions/src/tests.rs @@ -106,8 +106,6 @@ fn remove_stake_full_limit_success_with_limit_price() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let expected_weight = <::WeightInfo as SubtensorWeightInfo>::remove_stake_full_limit(); let balance_before = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); @@ -170,8 +168,6 @@ fn swap_stake_limit_with_tight_price_returns_slippage_error() { stake_alpha, ); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid_a); - let alpha_origin_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &coldkey, netuid_a, @@ -241,8 +237,6 @@ fn remove_stake_limit_success_respects_price_limit() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let alpha_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &coldkey, netuid, @@ -382,8 +376,6 @@ fn swap_stake_success_moves_between_subnets() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid_a); - let alpha_origin_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &coldkey, netuid_a, @@ -454,8 +446,6 @@ fn transfer_stake_success_moves_between_coldkeys() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &origin_coldkey, netuid); - let alpha_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, @@ -533,8 +523,6 @@ fn move_stake_success_moves_alpha_between_hotkeys() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&origin_hotkey, &coldkey, netuid); - let alpha_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &origin_hotkey, @@ -608,8 +596,6 @@ fn unstake_all_alpha_success_moves_stake_to_root() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let expected_weight = <::WeightInfo as SubtensorWeightInfo>::unstake_all_alpha(); let mut env = MockEnv::new(FunctionId::UnstakeAllAlphaV1, coldkey, hotkey.encode()) @@ -1579,8 +1565,6 @@ fn unstake_all_success_unstakes_balance() { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let expected_weight = <::WeightInfo as SubtensorWeightInfo>::unstake_all(); let pre_balance = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); @@ -1752,8 +1736,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let expected_weight = <::WeightInfo as SubtensorWeightInfo>::unstake_all(); let pre_balance = pallet_subtensor::Pallet::::get_coldkey_balance(&coldkey); @@ -1806,8 +1788,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let expected_weight = <::WeightInfo as SubtensorWeightInfo>::unstake_all_alpha(); let mut env = MockEnv::new( @@ -1870,8 +1850,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&origin_hotkey, &coldkey, netuid); - let alpha_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &origin_hotkey, @@ -1950,8 +1928,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &origin_coldkey, netuid); - let alpha_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, @@ -2039,8 +2015,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid_a); - let alpha_origin_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &coldkey, netuid_a, @@ -2171,8 +2145,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let alpha_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &coldkey, netuid, @@ -2251,8 +2223,6 @@ mod caller_dispatch_tests { stake_alpha, ); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid_a); - let alpha_origin_before = pallet_subtensor::Pallet::::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &coldkey, netuid_a, @@ -2321,8 +2291,6 @@ mod caller_dispatch_tests { stake_amount_raw.into(), )); - mock::remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - let expected_weight = <::WeightInfo as SubtensorWeightInfo>::remove_stake_full_limit(); let balance_before = diff --git a/eco-tests/src/helpers.rs b/eco-tests/src/helpers.rs index c6fa0ec72d..aa960f0bec 100644 --- a/eco-tests/src/helpers.rs +++ b/eco-tests/src/helpers.rs @@ -322,10 +322,6 @@ pub fn increase_stake_on_hotkey_account(hotkey: &U256, increment: TaoBalance, ne ); } -pub fn remove_stake_rate_limit_for_tests(hotkey: &U256, coldkey: &U256, netuid: NetUid) { - StakingOperationRateLimiter::::remove((hotkey, coldkey, netuid)); -} - pub fn setup_reserves(netuid: NetUid, tao: TaoBalance, alpha: AlphaBalance) { SubnetTAO::::set(netuid, tao); SubnetAlphaIn::::set(netuid, alpha); diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 9e11faba5a..79dbae7df9 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -934,12 +934,6 @@ mod pallet_benchmarks { let _ = Subtensor::::create_account_if_non_existent(&coldkey, &destination); - // Worst case for weight: the origin tuple is already rate-limited this block (e.g. a - // same-block `add_stake`). A same-netuid move is not rate-limited itself but propagates - // the limiter marker to the destination tuple, costing one extra - // `StakingOperationRateLimiter` write. - Subtensor::::set_stake_operation_limit(&origin, &coldkey, netuid); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), @@ -995,8 +989,6 @@ mod pallet_benchmarks { let amount_unstaked = AlphaBalance::from(30_000_000_000_u64); - StakingOperationRateLimiter::::remove((hotkey.clone(), coldkey.clone(), netuid)); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), @@ -1057,8 +1049,6 @@ mod pallet_benchmarks { .saturating_to_num::() .into(); - StakingOperationRateLimiter::::remove((hotkey.clone(), coldkey.clone(), netuid)); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), @@ -1122,8 +1112,6 @@ mod pallet_benchmarks { allow )); - StakingOperationRateLimiter::::remove((hot.clone(), coldkey.clone(), netuid1)); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), @@ -1176,12 +1164,6 @@ mod pallet_benchmarks { let _ = Subtensor::::create_account_if_non_existent(&dest, &hot); - // Worst case for weight: the origin tuple is already rate-limited this block (e.g. a - // same-block `add_stake`). A same-netuid transfer is not rate-limited itself but - // propagates the limiter marker to the destination tuple, costing one extra - // `StakingOperationRateLimiter` write. - Subtensor::::set_stake_operation_limit(&hot, &coldkey, netuid); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), @@ -1237,8 +1219,6 @@ mod pallet_benchmarks { let alpha_to_swap = Subtensor::::get_stake_for_hotkey_and_coldkey_on_subnet(&hot, &coldkey, netuid1); - StakingOperationRateLimiter::::remove((hot.clone(), coldkey.clone(), netuid1)); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), @@ -1592,8 +1572,6 @@ mod pallet_benchmarks { staked_amt )); - StakingOperationRateLimiter::::remove((hotkey.clone(), coldkey.clone(), netuid)); - #[extrinsic_call] _(RawOrigin::Signed(coldkey), hotkey); } @@ -1648,8 +1626,6 @@ mod pallet_benchmarks { staked_amt )); - StakingOperationRateLimiter::::remove((hotkey.clone(), coldkey.clone(), netuid)); - #[extrinsic_call] _( RawOrigin::Signed(coldkey.clone()), diff --git a/pallets/subtensor/src/coinbase/root.rs b/pallets/subtensor/src/coinbase/root.rs index b64043a4f5..a87d22c514 100644 --- a/pallets/subtensor/src/coinbase/root.rs +++ b/pallets/subtensor/src/coinbase/root.rs @@ -462,21 +462,6 @@ impl Pallet { TransactionKeyLastBlock::::remove((hot, netuid, name)); } } - // StakingOperationRateLimiter NMAP: (hot, cold, netuid) → bool - { - let to_rm: sp_std::vec::Vec<(T::AccountId, T::AccountId)> = - StakingOperationRateLimiter::::iter() - .filter_map( - |((hot, cold, n), _)| { - if n == netuid { Some((hot, cold)) } else { None } - }, - ) - .collect(); - for (hot, cold) in to_rm { - StakingOperationRateLimiter::::remove((hot, cold, netuid)); - } - } - // --- 22. Subnet leasing: remove mapping and any lease-scoped state linked to this netuid. if let Some(lease_id) = SubnetUidToLeaseId::::take(netuid) { SubnetLeases::::remove(lease_id); diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 97ba77a92a..933c2fcfa7 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -2459,20 +2459,6 @@ pub mod pallet { OptionQuery, >; - /// DMAP ( hot, cold, netuid ) --> rate limits for staking operations - /// Value contains just a marker: we use this map as a set. - #[pallet::storage] - pub type StakingOperationRateLimiter = StorageNMap< - _, - ( - NMapKey, // hot - NMapKey, // cold - NMapKey, // subnet - ), - bool, - ValueQuery, - >; - #[pallet::storage] // --- MAP(netuid ) --> Root claim threshold pub type RootClaimableThreshold = StorageMap<_, Blake2_128Concat, NetUid, I96F32, ValueQuery, DefaultMinRootClaimAmount>; diff --git a/pallets/subtensor/src/macros/errors.rs b/pallets/subtensor/src/macros/errors.rs index cb120b56b5..eb889a8ed5 100644 --- a/pallets/subtensor/src/macros/errors.rs +++ b/pallets/subtensor/src/macros/errors.rs @@ -219,8 +219,6 @@ mod errors { SameNetuid, /// The caller does not have enough balance for the operation. InsufficientBalance, - /// Too frequent staking operations - StakingOperationRateLimitExceeded, /// Invalid lease beneficiary to register the leased network. InvalidLeaseBeneficiary, /// Lease cannot end in the past. diff --git a/pallets/subtensor/src/macros/hooks.rs b/pallets/subtensor/src/macros/hooks.rs index 203a2d2828..fa7fbb3b16 100644 --- a/pallets/subtensor/src/macros/hooks.rs +++ b/pallets/subtensor/src/macros/hooks.rs @@ -38,17 +38,6 @@ mod hooks { } } - // ---- Called on the finalization of this pallet. The code weight must be taken into account prior to the execution of this macro. - // - // # Args: - // * 'n': (BlockNumberFor): - // - The number of the block we are finalizing. - fn on_finalize(_block_number: BlockNumberFor) { - for _ in StakingOperationRateLimiter::::drain() { - // Clear all entries each block - } - } - fn on_runtime_upgrade() -> frame_support::weights::Weight { // --- Migrate storage let mut weight = frame_support::weights::Weight::from_parts(0, 0); diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index b88e75cd31..08edde6f59 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -66,7 +66,6 @@ impl Pallet { netuid, stake_to_be_added, T::SwapInterface::max_price(), - true, false, ) } @@ -155,7 +154,6 @@ impl Pallet { netuid, possible_stake, limit_price, - true, false, ) } diff --git a/pallets/subtensor/src/staking/move_stake.rs b/pallets/subtensor/src/staking/move_stake.rs index aafefa28ed..7669be93dc 100644 --- a/pallets/subtensor/src/staking/move_stake.rs +++ b/pallets/subtensor/src/staking/move_stake.rs @@ -50,7 +50,6 @@ impl Pallet { None, None, false, - true, )?; // Log the event. @@ -141,7 +140,6 @@ impl Pallet { None, None, true, - false, )?; // 9. Emit an event for logging/monitoring. @@ -206,7 +204,6 @@ impl Pallet { None, None, false, - true, )?; // Emit an event for logging. @@ -274,7 +271,6 @@ impl Pallet { Some(limit_price), Some(allow_partial), false, - true, )?; // Emit an event for logging. @@ -306,7 +302,6 @@ impl Pallet { maybe_limit_price: Option, maybe_allow_partial: Option, check_transfer_toggle: bool, - set_limit: bool, ) -> Result { // Cap the alpha_amount at available Alpha because user might be paying transaxtion fees // in Alpha and their total is already reduced by now. @@ -385,7 +380,6 @@ impl Pallet { destination_netuid, tao_unstaked, T::SwapInterface::max_price(), - set_limit, drop_fee_destination, )?; } diff --git a/pallets/subtensor/src/staking/remove_stake.rs b/pallets/subtensor/src/staking/remove_stake.rs index 03b962202c..56bccbaf5c 100644 --- a/pallets/subtensor/src/staking/remove_stake.rs +++ b/pallets/subtensor/src/staking/remove_stake.rs @@ -274,7 +274,6 @@ impl Pallet { NetUid::ROOT, total_tao_unstaked, T::SwapInterface::max_price(), - false, // no limit for Root subnet false, )?; diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index 5ce19c5c3e..cd0fb5f2d5 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -847,7 +847,6 @@ impl Pallet { netuid: NetUid, tao: TaoBalance, price_limit: TaoBalance, - set_limit: bool, drop_fees: bool, ) -> Result { // Transfer TAO from coldkey to the subnet account. @@ -913,10 +912,6 @@ impl Pallet { LastColdkeyHotkeyStakeBlock::::insert(coldkey, hotkey, Self::get_current_block_as_u64()); - if set_limit { - Self::set_stake_operation_limit(hotkey, coldkey, netuid.into()); - } - // If this is a root-stake if netuid == NetUid::ROOT { // Adjust root claimed for this hotkey and coldkey. @@ -1040,16 +1035,6 @@ impl Pallet { 0_u64, // 0 fee )); - // Carry the per-block staking-operation limit across the transfer. Same-netuid - // transfers/moves are not rate-limited themselves (no AMM price impact), but if the - // origin tuple is already limited this block (e.g. a same-block `add_stake` set the - // marker), we propagate it to the destination tuple. Otherwise a same-block `add_stake` - // could be laundered to a fresh (hotkey, coldkey) tuple and then removed / swapped / - // cross-subnet transferred within the same block, bypassing the limiter. - if StakingOperationRateLimiter::::contains_key((origin_hotkey, origin_coldkey, netuid)) { - Self::set_stake_operation_limit(destination_hotkey, destination_coldkey, netuid); - } - Ok(tao_equivalent) } @@ -1151,8 +1136,6 @@ impl Pallet { // Ensure that the subnet exists. ensure!(Self::if_subnet_exist(netuid), Error::::SubnetNotExists); - Self::ensure_stake_operation_limit_not_exceeded(hotkey, coldkey, netuid.into())?; - // Ensure that the subnet is enabled. // Self::ensure_subtoken_enabled(netuid)?; @@ -1260,13 +1243,6 @@ impl Pallet { Error::::SubnetNotExists ); if origin_netuid != destination_netuid { - // Only rate-limit cross-subnet transitions. - Self::ensure_stake_operation_limit_not_exceeded( - origin_hotkey, - origin_coldkey, - origin_netuid.into(), - )?; - ensure!( Self::if_subnet_exist(destination_netuid), Error::::SubnetNotExists @@ -1381,27 +1357,6 @@ impl Pallet { }); } } - - pub fn set_stake_operation_limit( - hotkey: &T::AccountId, - coldkey: &T::AccountId, - netuid: NetUid, - ) { - StakingOperationRateLimiter::::insert((hotkey, coldkey, netuid), true); - } - - pub fn ensure_stake_operation_limit_not_exceeded( - hotkey: &T::AccountId, - coldkey: &T::AccountId, - netuid: NetUid, - ) -> Result<(), Error> { - ensure!( - !StakingOperationRateLimiter::::contains_key((hotkey, coldkey, netuid)), - Error::::StakingOperationRateLimitExceeded - ); - - Ok(()) - } } /////////////////////////////////////////// diff --git a/pallets/subtensor/src/tests/children.rs b/pallets/subtensor/src/tests/children.rs index ec191ba0e7..0b65d6e0fd 100644 --- a/pallets/subtensor/src/tests/children.rs +++ b/pallets/subtensor/src/tests/children.rs @@ -2318,7 +2318,6 @@ fn test_do_remove_stake_clears_pending_childkeys() { assert!(pending_before.1 > 0); // Remove stake - remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); assert_ok!(SubtensorModule::do_remove_stake( RuntimeOrigin::signed(coldkey), hotkey, diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index 4b452d639f..ecefd49a6f 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -49,7 +49,6 @@ fn setup_subnet_with_stake( amount, ::SwapInterface::max_price(), false, - false, ) .unwrap(); DecayingLock::::insert(coldkey, netuid, false); @@ -457,7 +456,6 @@ fn test_mixed_perpetual_and_decaying_non_owner_locks_same_hotkey_update_aggregat 100_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1770,7 +1768,6 @@ fn test_lock_on_multiple_subnets() { 100_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); DecayingLock::::insert(coldkey, netuid_b, false); @@ -1839,7 +1836,6 @@ fn test_unstake_one_subnet_does_not_affect_other() { 100_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1913,7 +1909,6 @@ fn test_hotkey_conviction_multiple_lockers() { 50_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1967,7 +1962,6 @@ fn test_mixed_perpetual_owner_and_decaying_non_owner_locks_roll_forward() { 100_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -2037,7 +2031,6 @@ fn test_total_conviction_equals_sum_of_participating_aggregate_convictions() { 100_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -2097,7 +2090,6 @@ fn test_total_conviction_equals_sum_of_individual_lock_convictions_for_many_lock 50_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); lockers.push((coldkey, hotkey)); @@ -2176,7 +2168,6 @@ fn test_subnet_king_highest_conviction_wins() { 50_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -2597,7 +2588,6 @@ fn test_reduce_lock_two_coldkeys() { 100_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); DecayingLock::::insert(coldkey2, netuid, false); @@ -3224,7 +3214,6 @@ fn test_clear_small_nomination_checks_lock() { 50_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -3294,7 +3283,6 @@ fn test_clear_small_nomination_reduces_only_tiny_amount_from_lock_state() { large_tao, ::SwapInterface::max_price(), false, - false, ) .unwrap(); SubtensorModule::stake_into_subnet( @@ -3304,7 +3292,6 @@ fn test_clear_small_nomination_reduces_only_tiny_amount_from_lock_state() { tiny_tao, ::SwapInterface::max_price(), false, - false, ) .unwrap(); DecayingLock::::insert(nominator, netuid, false); @@ -3710,7 +3697,6 @@ fn test_moving_partial_lock() { 50_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); DecayingLock::::insert(coldkey2, netuid, false); @@ -3795,7 +3781,6 @@ fn test_moving_partial_lock_same_owners() { 50_000_000_000u64.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); DecayingLock::::insert(coldkey2, netuid, false); diff --git a/pallets/subtensor/src/tests/mock.rs b/pallets/subtensor/src/tests/mock.rs index 277162dde4..5c47a04389 100644 --- a/pallets/subtensor/src/tests/mock.rs +++ b/pallets/subtensor/src/tests/mock.rs @@ -996,7 +996,6 @@ pub fn increase_stake_on_coldkey_hotkey_account( tao_staked, ::SwapInterface::max_price(), false, - false, ) .unwrap(); } @@ -1016,10 +1015,6 @@ pub fn increase_stake_on_hotkey_account(hotkey: &U256, increment: TaoBalance, ne ); } -pub(crate) fn remove_stake_rate_limit_for_tests(hotkey: &U256, coldkey: &U256, netuid: NetUid) { - StakingOperationRateLimiter::::remove((hotkey, coldkey, netuid)); -} - pub(crate) fn setup_reserves(netuid: NetUid, tao: TaoBalance, alpha: AlphaBalance) { SubnetTAO::::set(netuid, tao); SubnetAlphaIn::::set(netuid, alpha); diff --git a/pallets/subtensor/src/tests/move_stake.rs b/pallets/subtensor/src/tests/move_stake.rs index 40f76247e6..9b830d49df 100644 --- a/pallets/subtensor/src/tests/move_stake.rs +++ b/pallets/subtensor/src/tests/move_stake.rs @@ -36,7 +36,6 @@ fn test_do_move_success() { stake_amount, ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -114,7 +113,6 @@ fn test_do_move_different_subnets() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -183,7 +181,6 @@ fn test_do_move_nonexistent_subnet() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -290,7 +287,6 @@ fn test_do_move_nonexistent_destination_hotkey() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -356,7 +352,6 @@ fn test_do_move_partial_stake() { total_stake.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -427,7 +422,6 @@ fn test_do_move_multiple_times() { initial_stake.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = @@ -439,7 +433,6 @@ fn test_do_move_multiple_times() { let alpha1 = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey1, &coldkey, netuid, ); - remove_stake_rate_limit_for_tests(&hotkey1, &coldkey, netuid); assert_ok!(SubtensorModule::do_move_stake( RuntimeOrigin::signed(coldkey), hotkey1, @@ -451,7 +444,6 @@ fn test_do_move_multiple_times() { let alpha2 = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey2, &coldkey, netuid, ); - remove_stake_rate_limit_for_tests(&hotkey2, &coldkey, netuid); assert_ok!(SubtensorModule::do_move_stake( RuntimeOrigin::signed(coldkey), hotkey2, @@ -502,7 +494,6 @@ fn test_do_move_wrong_origin() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -570,7 +561,6 @@ fn test_do_move_same_hotkey_fails() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = @@ -622,7 +612,6 @@ fn test_do_move_event_emission() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -684,7 +673,6 @@ fn test_do_move_storage_updates() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -752,7 +740,6 @@ fn test_move_full_amount_same_netuid() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -821,7 +808,6 @@ fn test_do_move_max_values() { max_stake.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -885,7 +871,6 @@ fn test_moving_too_little_unstakes() { (amount.to_u64() + fee * 2).into() )); - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); assert_err!( SubtensorModule::move_stake( RuntimeOrigin::signed(coldkey_account_id), @@ -925,7 +910,6 @@ fn test_do_transfer_success() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -1035,7 +1019,6 @@ fn test_do_transfer_insufficient_stake() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1076,7 +1059,6 @@ fn test_do_transfer_wrong_origin() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1115,7 +1097,6 @@ fn test_do_transfer_minimum_stake_check() { stake_amount, ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1163,7 +1144,6 @@ fn test_do_transfer_different_subnets() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1230,7 +1210,6 @@ fn test_do_swap_success() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha_before = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -1339,7 +1318,6 @@ fn test_do_swap_insufficient_stake() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1375,7 +1353,6 @@ fn test_do_swap_wrong_origin() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1414,7 +1391,6 @@ fn test_do_swap_minimum_stake_check() { total_stake, ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1451,7 +1427,6 @@ fn test_do_swap_same_subnet() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1497,7 +1472,6 @@ fn test_do_swap_partial_stake() { total_stake_tao.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let total_stake_alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -1550,7 +1524,6 @@ fn test_do_swap_storage_updates() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1611,7 +1584,6 @@ fn test_do_swap_multiple_times() { initial_stake.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -1621,7 +1593,6 @@ fn test_do_swap_multiple_times() { &hotkey, &coldkey, netuid1, ); if !alpha1.is_zero() { - remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid1); assert_ok!(SubtensorModule::do_swap_stake( RuntimeOrigin::signed(coldkey), hotkey, @@ -1637,7 +1608,6 @@ fn test_do_swap_multiple_times() { let (tao_equivalent, _) = mock::swap_alpha_to_tao_ext(netuid2, alpha2, true); // we do this in the loop, because we need the value before the swap expected_alpha = mock::swap_tao_to_alpha(netuid1, tao_equivalent).0; - remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid2); assert_ok!(SubtensorModule::do_swap_stake( RuntimeOrigin::signed(coldkey), hotkey, @@ -1683,7 +1653,6 @@ fn test_do_swap_allows_non_owned_hotkey() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha_before = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -1775,7 +1744,6 @@ fn test_move_stake_specific_stake_into_subnet_fail() { // Move stake to destination subnet let (tao_equivalent, _) = mock::swap_alpha_to_tao_ext(origin_netuid, alpha_to_move, true); let (expected_value, _) = mock::swap_tao_to_alpha(netuid, tao_equivalent); - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, origin_netuid); assert_ok!(SubtensorModule::move_stake( RuntimeOrigin::signed(coldkey_account_id), hotkey_account_id, @@ -1807,55 +1775,6 @@ fn test_move_stake_specific_stake_into_subnet_fail() { }); } -#[test] -fn test_transfer_stake_rate_limited() { - new_test_ext(1).execute_with(|| { - let subnet_owner_coldkey = U256::from(1001); - let subnet_owner_hotkey = U256::from(1002); - let origin_netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - let destination_netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - - let origin_coldkey = U256::from(1); - let destination_coldkey = U256::from(2); - let hotkey = U256::from(3); - let stake_amount = DefaultMinStake::::get().to_u64() * 10; - - let _ = SubtensorModule::create_account_if_non_existent(&origin_coldkey, &hotkey); - let _ = SubtensorModule::create_account_if_non_existent(&destination_coldkey, &hotkey); - add_balance_to_coldkey_account(&origin_coldkey, stake_amount.into()); - SubtensorModule::stake_into_subnet( - &hotkey, - &origin_coldkey, - origin_netuid, - stake_amount.into(), - ::SwapInterface::max_price(), - true, - false, - ) - .unwrap(); - let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( - &hotkey, - &origin_coldkey, - origin_netuid, - ); - - // add_stake set the limiter for (hotkey, origin_coldkey, origin_netuid). - // A cross-subnet transfer in the same block goes through the AMM (price impact), - // so it is still rate limited. - assert_err!( - SubtensorModule::do_transfer_stake( - RuntimeOrigin::signed(origin_coldkey), - destination_coldkey, - hotkey, - origin_netuid, - destination_netuid, - alpha - ), - Error::::StakingOperationRateLimitExceeded - ); - }); -} - #[test] fn test_transfer_stake_same_netuid_not_rate_limited() { new_test_ext(1).execute_with(|| { @@ -1877,7 +1796,6 @@ fn test_transfer_stake_same_netuid_not_rate_limited() { netuid, stake_amount.into(), ::SwapInterface::max_price(), - true, false, ) .unwrap(); @@ -1918,83 +1836,6 @@ fn test_transfer_stake_same_netuid_not_rate_limited() { }); } -#[test] -fn test_transfer_stake_same_netuid_propagates_rate_limit() { - new_test_ext(1).execute_with(|| { - let subnet_owner_coldkey = U256::from(1001); - let subnet_owner_hotkey = U256::from(1002); - let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - - let origin_coldkey = U256::from(1); - let destination_coldkey = U256::from(2); - let hotkey = U256::from(3); - let stake_amount = DefaultMinStake::::get().to_u64() * 10; - - let _ = SubtensorModule::create_account_if_non_existent(&origin_coldkey, &hotkey); - let _ = SubtensorModule::create_account_if_non_existent(&destination_coldkey, &hotkey); - add_balance_to_coldkey_account(&origin_coldkey, stake_amount.into()); - - // add_stake sets the limiter for the origin tuple (hotkey, origin_coldkey, netuid). - SubtensorModule::stake_into_subnet( - &hotkey, - &origin_coldkey, - netuid, - stake_amount.into(), - ::SwapInterface::max_price(), - true, - false, - ) - .unwrap(); - let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( - &hotkey, - &origin_coldkey, - netuid, - ); - - // Same-netuid transfer to a different coldkey is allowed (no AMM price impact)... - assert_ok!(SubtensorModule::do_transfer_stake( - RuntimeOrigin::signed(origin_coldkey), - destination_coldkey, - hotkey, - netuid, - netuid, - alpha - )); - - // ...but the limiter marker is PROPAGATED to the destination tuple, closing the - // laundering bypass: the moved stake cannot be removed/swapped/cross-subnet transferred - // from the destination tuple within the same block. - assert!(StakingOperationRateLimiter::::contains_key(( - hotkey, - destination_coldkey, - netuid - ))); - - let moved_alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( - &hotkey, - &destination_coldkey, - netuid, - ); - assert_err!( - SubtensorModule::remove_stake( - RuntimeOrigin::signed(destination_coldkey), - hotkey, - netuid, - moved_alpha - ), - Error::::StakingOperationRateLimitExceeded - ); - - // The limiter clears at the block boundary, so removal works in the next block. - next_block(); - assert!(!StakingOperationRateLimiter::::contains_key(( - hotkey, - destination_coldkey, - netuid - ))); - }); -} - #[test] fn test_transfer_stake_doesnt_limit_destination_coldkey() { new_test_ext(1).execute_with(|| { @@ -2018,7 +1859,6 @@ fn test_transfer_stake_doesnt_limit_destination_coldkey() { stake_amount.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( @@ -2035,63 +1875,5 @@ fn test_transfer_stake_doesnt_limit_destination_coldkey() { netuid2, alpha ),); - - assert!(!StakingOperationRateLimiter::::contains_key(( - hotkey, - destination_coldkey, - netuid2 - ))); - }); -} - -#[test] -fn test_swap_stake_limits_destination_netuid() { - new_test_ext(1).execute_with(|| { - let subnet_owner_coldkey = U256::from(1001); - let subnet_owner_hotkey = U256::from(1002); - let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - let netuid2 = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - - let origin_coldkey = U256::from(1); - let hotkey = U256::from(3); - let stake_amount = DefaultMinStake::::get().to_u64() * 10; - - let _ = SubtensorModule::create_account_if_non_existent(&origin_coldkey, &hotkey); - add_balance_to_coldkey_account(&origin_coldkey, stake_amount.into()); - SubtensorModule::stake_into_subnet( - &hotkey, - &origin_coldkey, - netuid, - stake_amount.into(), - ::SwapInterface::max_price(), - false, - false, - ) - .unwrap(); - let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( - &hotkey, - &origin_coldkey, - netuid, - ); - - assert_ok!(SubtensorModule::do_swap_stake( - RuntimeOrigin::signed(origin_coldkey), - hotkey, - netuid, - netuid2, - alpha - ),); - - assert!(!StakingOperationRateLimiter::::contains_key(( - hotkey, - origin_coldkey, - netuid - ))); - - assert!(StakingOperationRateLimiter::::contains_key(( - hotkey, - origin_coldkey, - netuid2 - ))); }); } diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 0fe951a29b..d77feb8269 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -863,7 +863,6 @@ fn test_remove_stake_insufficient_liquidity() { amount_staked.into(), ::SwapInterface::max_price(), false, - false, ) .unwrap(); @@ -934,8 +933,6 @@ fn test_remove_stake_total_issuance_no_change() { netuid, ); - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); - assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(coldkey_account_id), hotkey_account_id, @@ -1038,7 +1035,6 @@ fn test_remove_prev_epoch_stake() { netuid, ); - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); let fee = mock::swap_alpha_to_tao(netuid, stake).1 + fee; assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(coldkey_account_id), @@ -1694,7 +1690,6 @@ fn test_clear_small_nominations() { SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet(&hot1, &cold1, netuid); let unstake_amount1 = AlphaBalance::from(alpha_stake1.to_u64() * 997 / 1000); let small1 = alpha_stake1 - unstake_amount1; - remove_stake_rate_limit_for_tests(&hot1, &cold1, netuid); assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(cold1), hot1, @@ -1718,7 +1713,6 @@ fn test_clear_small_nominations() { SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet(&hot1, &cold2, netuid); let unstake_amount2 = AlphaBalance::from(alpha_stake2.to_u64() * 997 / 1000); let small2 = alpha_stake2 - unstake_amount2; - remove_stake_rate_limit_for_tests(&hot1, &cold2, netuid); assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(cold2), hot1, @@ -2201,10 +2195,8 @@ fn test_get_total_delegated_stake_after_unstaking() { &delegator, netuid, ); - remove_stake_rate_limit_for_tests(&delegator, &delegate_hotkey, netuid); // Unstake part of the delegation let unstake_amount_alpha = delegated_alpha / 2.into(); - remove_stake_rate_limit_for_tests(&delegate_hotkey, &delegator, netuid); assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(delegator), delegate_hotkey, @@ -3956,7 +3948,6 @@ fn test_remove_stake_limit_ok() { let fee: u64 = (expected_alpha_reduction as f64 * 0.003) as u64; // Remove stake with slippage safety - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); assert_ok!(SubtensorModule::remove_stake_limit( RuntimeOrigin::signed(coldkey_account_id), hotkey_account_id, @@ -4151,8 +4142,6 @@ fn test_remove_99_9991_per_cent_stake_works_precisely() { let coldkey_balance_before_remove = SubtensorModule::get_coldkey_balance(&coldkey_account_id); - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); - let remove_amount = AlphaBalance::from( (U64F64::from_num(alpha) * U64F64::from_num(0.999991)).to_num::(), ); @@ -4223,7 +4212,6 @@ fn test_remove_99_9989_per_cent_stake_leaves_a_little() { )); // Remove 99.9989% stake - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( &hotkey_account_id, &coldkey_account_id, @@ -4464,8 +4452,6 @@ fn test_unstake_all_alpha_works() { stake_amount )); - remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - // Setup the pool so that removing all the TAO will keep liq above min mock::setup_reserves( netuid, @@ -4519,8 +4505,6 @@ fn test_unstake_all_works() { stake_amount * 10.into(), u64::from(stake_amount * 100.into()).into(), ); - remove_stake_rate_limit_for_tests(&hotkey, &coldkey, netuid); - // Unstake all alpha to free balance assert_ok!(SubtensorModule::unstake_all( RuntimeOrigin::signed(coldkey), @@ -4574,7 +4558,6 @@ fn test_stake_into_subnet_ok() { amount.into(), TaoBalance::MAX, false, - false, )); let fee_rate = pallet_subtensor_swap::FeeRate::::get(NetUid::from(netuid)) as f64 / u16::MAX as f64; @@ -4629,7 +4612,6 @@ fn test_stake_into_subnet_low_amount() { amount.into(), TaoBalance::MAX, false, - false, )); let expected_stake = AlphaBalance::from(((amount as f64) * 0.997 / current_price) as u64); @@ -4678,7 +4660,6 @@ fn test_unstake_from_subnet_low_amount() { amount.into(), TaoBalance::MAX, false, - false, )); // Remove stake @@ -4796,7 +4777,6 @@ fn test_unstake_from_subnet_prohibitive_limit() { amount.into(), TaoBalance::MAX, false, - false, )); // Remove stake @@ -4872,7 +4852,6 @@ fn test_unstake_full_amount() { amount.into(), TaoBalance::MAX, false, - false, )); // Remove stake @@ -5014,7 +4993,6 @@ fn test_swap_fees_tao_correctness() { &coldkey, netuid, ); - remove_stake_rate_limit_for_tests(&owner_hotkey, &coldkey, netuid); assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(coldkey), owner_hotkey, @@ -5275,7 +5253,6 @@ fn test_default_min_stake_sufficiency() { let fee_stake = (fee_rate * u64::from(amount) as f64) as u64; let current_price_after_stake = ::SwapInterface::current_alpha_price(netuid.into()); - remove_stake_rate_limit_for_tests(&owner_hotkey, &coldkey, netuid); let user_alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( &owner_hotkey, &coldkey, @@ -5298,54 +5275,6 @@ fn test_default_min_stake_sufficiency() { }); } -#[test] -fn test_stake_rate_limits() { - new_test_ext(0).execute_with(|| { - // Create subnet and accounts. - let subnet_owner_coldkey = U256::from(10); - let subnet_owner_hotkey = U256::from(20); - let hot1 = U256::from(1); - let cold1 = U256::from(3); - let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey); - let amount = DefaultMinStake::::get() * 10.into(); - let fee = DefaultMinStake::::get(); - let init_balance = amount + fee + ExistentialDeposit::get(); - - register_ok_neuron(netuid, hot1, cold1, 0); - Delegates::::insert(hot1, SubtensorModule::get_min_delegate_take()); - assert_eq!(SubtensorModule::get_owning_coldkey_for_hotkey(&hot1), cold1); - - add_balance_to_coldkey_account(&cold1, init_balance); - assert_ok!(SubtensorModule::add_stake( - RuntimeOrigin::signed(cold1), - hot1, - netuid, - (amount + fee).into() - )); - - assert_err!( - SubtensorModule::remove_stake( - RuntimeOrigin::signed(cold1), - hot1, - netuid, - AlphaBalance::from(amount.to_u64()) - ), - Error::::StakingOperationRateLimitExceeded - ); - - // Test limit clear each block - assert!(StakingOperationRateLimiter::::contains_key(( - hot1, cold1, netuid - ))); - - next_block(); - - assert!(!StakingOperationRateLimiter::::contains_key(( - hot1, cold1, netuid - ))); - }); -} - // cargo test --package pallet-subtensor --lib -- tests::staking::test_add_root_updates_counters --exact --show-output #[test] fn test_add_root_updates_counters() { @@ -5502,7 +5431,6 @@ fn test_staking_records_flow() { amount.into(), TaoBalance::MAX, false, - false, )); let fee_rate = pallet_subtensor_swap::FeeRate::::get(NetUid::from(netuid)) as f64 / u16::MAX as f64; diff --git a/pallets/subtensor/src/tests/subnet.rs b/pallets/subtensor/src/tests/subnet.rs index 12b23c74e4..e44119540c 100644 --- a/pallets/subtensor/src/tests/subnet.rs +++ b/pallets/subtensor/src/tests/subnet.rs @@ -633,8 +633,6 @@ fn test_subtoken_enable_trading_ok_with_enable() { stake_amount )); - remove_stake_rate_limit_for_tests(&hotkey_account_id, &coldkey_account_id, netuid); - assert_ok!(SubtensorModule::remove_stake( RuntimeOrigin::signed(coldkey_account_id), hotkey_account_id, @@ -665,8 +663,6 @@ fn test_subtoken_enable_trading_ok_with_enable() { unstake_amount, )); - remove_stake_rate_limit_for_tests(&hotkey_account_2_id, &coldkey_account_id, netuid); - assert_ok!(SubtensorModule::transfer_stake( RuntimeOrigin::signed(coldkey_account_id), hotkey_account_id, diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 3960c05b28..57eed14d35 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -309,18 +309,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::UnlockRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaturityRate` (r:1 w:0) /// Proof: `SubtensorModule::MaturityRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake() -> Weight { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 459_249_000 picoseconds. - Weight::from_parts(476_173_000, 8727) + // Minimum execution time: 273_000_000 picoseconds. + Weight::from_parts(277_000_000, 8727) .saturating_add(T::DbWeight::get().reads(38_u64)) - .saturating_add(T::DbWeight::get().writes(18_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1087,56 +1085,52 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::UnlockRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaturityRate` (r:1 w:0) /// Proof: `SubtensorModule::MaturityRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_limit() -> Weight { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 499_258_000 picoseconds. - Weight::from_parts(516_242_000, 8727) + // Minimum execution time: 328_000_000 picoseconds. + Weight::from_parts(385_000_000, 8727) .saturating_add(T::DbWeight::get().reads(38_u64)) - .saturating_add(T::DbWeight::get().writes(18_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) + } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:2 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn move_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2045` + // Estimated: `7985` + // Minimum execution time: 129_000_000 picoseconds. + Weight::from_parts(130_000_000, 7985) + .saturating_add(T::DbWeight::get().reads(18_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:2 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn move_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2180` - // Estimated: `8120` - // Minimum execution time: 149_000_000 picoseconds. - Weight::from_parts(227_526_000, 8000) - .saturating_add(T::DbWeight::get().reads(19_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:1 w:0) @@ -1151,8 +1145,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) @@ -1197,11 +1189,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2564` - // Estimated: `10979` - // Minimum execution time: 435_183_000 picoseconds. - Weight::from_parts(444_777_000, 10979) - .saturating_add(T::DbWeight::get().reads(35_u64)) + // Measured: `2549` + // Estimated: `10964` + // Minimum execution time: 261_000_000 picoseconds. + Weight::from_parts(262_000_000, 10964) + .saturating_add(T::DbWeight::get().reads(34_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) @@ -1224,8 +1216,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:1 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) @@ -1262,11 +1252,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2598` - // Estimated: `11013` - // Minimum execution time: 475_352_000 picoseconds. - Weight::from_parts(478_116_000, 11013) - .saturating_add(T::DbWeight::get().reads(34_u64)) + // Measured: `2583` + // Estimated: `10998` + // Minimum execution time: 277_000_000 picoseconds. + Weight::from_parts(280_000_000, 10998) + .saturating_add(T::DbWeight::get().reads(33_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) @@ -1297,8 +1287,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) @@ -1343,54 +1331,52 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `3108` - // Estimated: `11523` - // Minimum execution time: 688_567_000 picoseconds. - Weight::from_parts(707_234_000, 11523) - .saturating_add(T::DbWeight::get().reads(54_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) + // Measured: `3073` + // Estimated: `11488` + // Minimum execution time: 404_000_000 picoseconds. + Weight::from_parts(410_000_000, 11488) + .saturating_add(T::DbWeight::get().reads(53_u64)) + .saturating_add(T::DbWeight::get().writes(25_u64)) + } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) + /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Lock` (r:1 w:0) + /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn transfer_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2054` + // Estimated: `7994` + // Minimum execution time: 161_000_000 picoseconds. + Weight::from_parts(164_000_000, 7994) + .saturating_add(T::DbWeight::get().reads(17_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) - /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Lock` (r:1 w:0) - /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn transfer_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2174` - // Estimated: `8114` - // Minimum execution time: 166_000_000 picoseconds. - Weight::from_parts(258_541_000, 7994) - .saturating_add(T::DbWeight::get().reads(18_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -1401,8 +1387,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) @@ -1465,12 +1449,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2951` - // Estimated: `11366` - // Minimum execution time: 633_996_000 picoseconds. - Weight::from_parts(655_699_000, 11366) - .saturating_add(T::DbWeight::get().reads(54_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) + // Measured: `2916` + // Estimated: `11331` + // Minimum execution time: 370_000_000 picoseconds. + Weight::from_parts(382_000_000, 11331) + .saturating_add(T::DbWeight::get().reads(53_u64)) + .saturating_add(T::DbWeight::get().writes(25_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1868,8 +1852,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) @@ -1920,9 +1902,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2642` // Estimated: `11306` - // Minimum execution time: 583_803_000 picoseconds. - Weight::from_parts(599_485_000, 11306) - .saturating_add(T::DbWeight::get().reads(50_u64)) + // Minimum execution time: 371_000_000 picoseconds. + Weight::from_parts(380_000_000, 11306) + .saturating_add(T::DbWeight::get().reads(49_u64)) .saturating_add(T::DbWeight::get().writes(27_u64)) } /// Storage: `SubtensorModule::Alpha` (r:1 w:0) @@ -1955,8 +1937,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -1983,11 +1963,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2598` - // Estimated: `11013` - // Minimum execution time: 497_956_000 picoseconds. - Weight::from_parts(503_033_000, 11013) - .saturating_add(T::DbWeight::get().reads(34_u64)) + // Measured: `2583` + // Estimated: `10998` + // Minimum execution time: 295_000_000 picoseconds. + Weight::from_parts(297_000_000, 10998) + .saturating_add(T::DbWeight::get().reads(33_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } /// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:0) @@ -2380,18 +2360,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MaturityRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `AlphaAssets::AlphaBurned` (r:1 w:1) /// Proof: `AlphaAssets::AlphaBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_burn() -> Weight { // Proof Size summary in bytes: // Measured: `2636` // Estimated: `8727` - // Minimum execution time: 630_852_000 picoseconds. - Weight::from_parts(646_565_000, 8727) + // Minimum execution time: 383_000_000 picoseconds. + Weight::from_parts(405_000_000, 8727) .saturating_add(T::DbWeight::get().reads(39_u64)) - .saturating_add(T::DbWeight::get().writes(19_u64)) + .saturating_add(T::DbWeight::get().writes(18_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -2689,18 +2667,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::UnlockRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaturityRate` (r:1 w:0) /// Proof: `SubtensorModule::MaturityRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake() -> Weight { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 459_249_000 picoseconds. - Weight::from_parts(476_173_000, 8727) + // Minimum execution time: 273_000_000 picoseconds. + Weight::from_parts(277_000_000, 8727) .saturating_add(RocksDbWeight::get().reads(38_u64)) - .saturating_add(RocksDbWeight::get().writes(18_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::IsNetworkMember` (r:2 w:0) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3467,56 +3443,52 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::UnlockRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaturityRate` (r:1 w:0) /// Proof: `SubtensorModule::MaturityRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_limit() -> Weight { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 499_258_000 picoseconds. - Weight::from_parts(516_242_000, 8727) + // Minimum execution time: 328_000_000 picoseconds. + Weight::from_parts(385_000_000, 8727) .saturating_add(RocksDbWeight::get().reads(38_u64)) - .saturating_add(RocksDbWeight::get().writes(18_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) + } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:2 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn move_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2045` + // Estimated: `7985` + // Minimum execution time: 129_000_000 picoseconds. + Weight::from_parts(130_000_000, 7985) + .saturating_add(RocksDbWeight::get().reads(18_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:2 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn move_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2180` - // Estimated: `8120` - // Minimum execution time: 149_000_000 picoseconds. - Weight::from_parts(227_526_000, 8000) - .saturating_add(RocksDbWeight::get().reads(19_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) - } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:1 w:0) @@ -3531,8 +3503,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) @@ -3577,11 +3547,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2564` - // Estimated: `10979` - // Minimum execution time: 435_183_000 picoseconds. - Weight::from_parts(444_777_000, 10979) - .saturating_add(RocksDbWeight::get().reads(35_u64)) + // Measured: `2549` + // Estimated: `10964` + // Minimum execution time: 261_000_000 picoseconds. + Weight::from_parts(262_000_000, 10964) + .saturating_add(RocksDbWeight::get().reads(34_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) @@ -3604,8 +3574,6 @@ impl WeightInfo for () { /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:1 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:1 w:1) @@ -3642,11 +3610,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2598` - // Estimated: `11013` - // Minimum execution time: 475_352_000 picoseconds. - Weight::from_parts(478_116_000, 11013) - .saturating_add(RocksDbWeight::get().reads(34_u64)) + // Measured: `2583` + // Estimated: `10998` + // Minimum execution time: 277_000_000 picoseconds. + Weight::from_parts(280_000_000, 10998) + .saturating_add(RocksDbWeight::get().reads(33_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) @@ -3677,8 +3645,6 @@ impl WeightInfo for () { /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::CurrentLiquidity` (r:1 w:0) /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) @@ -3723,54 +3689,52 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `3108` - // Estimated: `11523` - // Minimum execution time: 688_567_000 picoseconds. - Weight::from_parts(707_234_000, 11523) - .saturating_add(RocksDbWeight::get().reads(54_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) + // Measured: `3073` + // Estimated: `11488` + // Minimum execution time: 404_000_000 picoseconds. + Weight::from_parts(410_000_000, 11488) + .saturating_add(RocksDbWeight::get().reads(53_u64)) + .saturating_add(RocksDbWeight::get().writes(25_u64)) + } + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) + /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Lock` (r:1 w:0) + /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) + /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) + /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn transfer_stake() -> Weight { + // Proof Size summary in bytes: + // Measured: `2054` + // Estimated: `7994` + // Minimum execution time: 161_000_000 picoseconds. + Weight::from_parts(164_000_000, 7994) + .saturating_add(RocksDbWeight::get().reads(17_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:1 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) - /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Lock` (r:1 w:0) - /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapV3Initialized` (r:1 w:0) - /// Proof: `Swap::SwapV3Initialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::AlphaSqrtPrice` (r:1 w:0) - /// Proof: `Swap::AlphaSqrtPrice` (`max_values`: None, `max_size`: Some(26), added: 2501, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn transfer_stake() -> Weight { - // Proof Size summary in bytes: - // Measured: `2174` - // Estimated: `8114` - // Minimum execution time: 166_000_000 picoseconds. - Weight::from_parts(258_541_000, 7994) - .saturating_add(RocksDbWeight::get().reads(18_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) - } /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -3781,8 +3745,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) @@ -3845,12 +3807,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2951` - // Estimated: `11366` - // Minimum execution time: 633_996_000 picoseconds. - Weight::from_parts(655_699_000, 11366) - .saturating_add(RocksDbWeight::get().reads(54_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) + // Measured: `2916` + // Estimated: `11331` + // Minimum execution time: 370_000_000 picoseconds. + Weight::from_parts(382_000_000, 11331) + .saturating_add(RocksDbWeight::get().reads(53_u64)) + .saturating_add(RocksDbWeight::get().writes(25_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4248,8 +4210,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) @@ -4300,9 +4260,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2642` // Estimated: `11306` - // Minimum execution time: 583_803_000 picoseconds. - Weight::from_parts(599_485_000, 11306) - .saturating_add(RocksDbWeight::get().reads(50_u64)) + // Minimum execution time: 371_000_000 picoseconds. + Weight::from_parts(380_000_000, 11306) + .saturating_add(RocksDbWeight::get().reads(49_u64)) .saturating_add(RocksDbWeight::get().writes(27_u64)) } /// Storage: `SubtensorModule::Alpha` (r:1 w:0) @@ -4335,8 +4295,6 @@ impl WeightInfo for () { /// Proof: `Swap::CurrentLiquidity` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:1 w:0) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -4363,11 +4321,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2598` - // Estimated: `11013` - // Minimum execution time: 497_956_000 picoseconds. - Weight::from_parts(503_033_000, 11013) - .saturating_add(RocksDbWeight::get().reads(34_u64)) + // Measured: `2583` + // Estimated: `10998` + // Minimum execution time: 295_000_000 picoseconds. + Weight::from_parts(297_000_000, 10998) + .saturating_add(RocksDbWeight::get().reads(33_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } /// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:0) @@ -4760,18 +4718,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MaturityRate` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `AlphaAssets::AlphaBurned` (r:1 w:1) /// Proof: `AlphaAssets::AlphaBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingOperationRateLimiter` (r:0 w:1) - /// Proof: `SubtensorModule::StakingOperationRateLimiter` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_stake_burn() -> Weight { // Proof Size summary in bytes: // Measured: `2636` // Estimated: `8727` - // Minimum execution time: 630_852_000 picoseconds. - Weight::from_parts(646_565_000, 8727) + // Minimum execution time: 383_000_000 picoseconds. + Weight::from_parts(405_000_000, 8727) .saturating_add(RocksDbWeight::get().reads(39_u64)) - .saturating_add(RocksDbWeight::get().writes(19_u64)) + .saturating_add(RocksDbWeight::get().writes(18_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) diff --git a/pallets/transaction-fee/src/tests/mock.rs b/pallets/transaction-fee/src/tests/mock.rs index 343decb8a8..67ca8dd835 100644 --- a/pallets/transaction-fee/src/tests/mock.rs +++ b/pallets/transaction-fee/src/tests/mock.rs @@ -822,10 +822,6 @@ pub fn setup_subnets(sncount: u16, neurons: u16) -> TestSetup { } } -pub(crate) fn remove_stake_rate_limit_for_tests(hotkey: &U256, coldkey: &U256, netuid: NetUid) { - StakingOperationRateLimiter::::remove((hotkey, coldkey, netuid)); -} - #[allow(dead_code)] pub fn setup_stake( netuid: subtensor_runtime_common::NetUid, @@ -845,7 +841,6 @@ pub fn setup_stake( netuid, stake_amount.into(), )); - remove_stake_rate_limit_for_tests(hotkey, coldkey, netuid); } pub(crate) fn quote_remove_stake_after_alpha_fee( diff --git a/pallets/transaction-fee/src/tests/mod.rs b/pallets/transaction-fee/src/tests/mod.rs index 8203070d76..e40c042f9a 100644 --- a/pallets/transaction-fee/src/tests/mod.rs +++ b/pallets/transaction-fee/src/tests/mod.rs @@ -1540,7 +1540,6 @@ fn test_add_stake_fees_go_to_block_builder() { let (_, swap_fee) = mock::swap_tao_to_alpha(sn.subnets[0].netuid, stake_amount.into()); add_balance_to_coldkey_account(&sn.coldkey, (stake_amount * 10).into()); - remove_stake_rate_limit_for_tests(&sn.hotkeys[0], &sn.coldkey, sn.subnets[0].netuid); // Stake let balance_before = Balances::free_balance(sn.coldkey); diff --git a/precompiles/src/staking.rs b/precompiles/src/staking.rs index 28e043f07b..f13619058c 100644 --- a/precompiles/src/staking.rs +++ b/precompiles/src/staking.rs @@ -1070,11 +1070,6 @@ mod tests { fund_account(&source_account, COLDKEY_BALANCE); add_stake_v2(source, &hotkey, TEST_NETUID_U16, INITIAL_STAKE_RAO); - pallet_subtensor::StakingOperationRateLimiter::::remove(( - hotkey.clone(), - source_account.clone(), - netuid, - )); ( netuid, @@ -1269,11 +1264,6 @@ mod tests { fund_account(&caller_account, COLDKEY_BALANCE); add_stake_v1(caller, &hotkey, TEST_NETUID_U16, INITIAL_STAKE_RAO); - pallet_subtensor::StakingOperationRateLimiter::::remove(( - hotkey.clone(), - caller_account.clone(), - netuid, - )); let precompiles = precompiles::>(); let precompile_addr = addr_from_index(StakingPrecompile::::INDEX); @@ -1309,11 +1299,6 @@ mod tests { fund_account(&caller_account, COLDKEY_BALANCE); add_stake_v2(caller, &hotkey, TEST_NETUID_U16, INITIAL_STAKE_RAO); - pallet_subtensor::StakingOperationRateLimiter::::remove(( - hotkey.clone(), - caller_account.clone(), - netuid, - )); let precompiles = precompiles::>(); let precompile_addr = addr_from_index(StakingPrecompileV2::::INDEX); @@ -1402,11 +1387,6 @@ mod tests { ), ) .execute_returns(()); - pallet_subtensor::StakingOperationRateLimiter::::remove(( - hotkey.clone(), - caller_account.clone(), - netuid, - )); let stake_before = stake_for(&hotkey, &caller_account, netuid); precompiles @@ -1458,11 +1438,6 @@ mod tests { ), ) .execute_returns(()); - pallet_subtensor::StakingOperationRateLimiter::::remove(( - hotkey.clone(), - caller_account.clone(), - netuid, - )); assert!(stake_for(&hotkey, &caller_account, netuid) > 0); precompiles @@ -1512,11 +1487,6 @@ mod tests { ), ) .execute_returns(()); - pallet_subtensor::StakingOperationRateLimiter::::remove(( - hotkey.clone(), - caller_account.clone(), - netuid, - )); assert!(stake_for(&hotkey, &caller_account, netuid) > 0); precompiles diff --git a/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts b/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts index bbd9820cba..c8bc53419e 100644 --- a/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts +++ b/ts-tests/suites/dev/subtensor/staking/test-transfer-stake-rate-limit.ts @@ -77,7 +77,7 @@ async function devGetAlphaStake( describeSuite({ id: "DEV_SUB_STAKING_TRANSFER_RATE_LIMIT", - title: "staking rate limiter — add_stake then transfer_stake in one block", + title: "staking — same-block add_stake / transfer_stake (no per-block rate limiter)", foundationMethods: "dev", testCases: ({ it, context }) => { let polkadotJs: ApiPromise; @@ -109,7 +109,7 @@ describeSuite({ it({ id: "T01", - title: "add_stake + same-subnet transfer_stake in one block now BOTH succeed (rate limiter skipped for same-subnet)", + title: "add_stake + same-subnet transfer_stake in one block both succeed", test: async () => { // Both extrinsics are signed by alice, so use explicit incrementing // nonces to land them in the same block in submission order. @@ -136,9 +136,9 @@ describeSuite({ it({ id: "T02", - title: "the same add_stake and transfer_stake across SEPARATE blocks both succeed — only the block boundary matters", + title: "add_stake then transfer_stake across SEPARATE blocks both succeed", test: async () => { - // add in its own block — limiter is set then drained on_finalize + // add in its own block const { result: [addAttempt2], } = await context.createBlock([ @@ -152,7 +152,7 @@ describeSuite({ const transferAmount = alphaStaked / 2n; expect(transferAmount > 0n).toEqual(true); - // transfer in the NEXT block — same triple, limiter cleared, succeeds + // transfer in the NEXT block — same triple, succeeds const { result: [transferAttempt2], } = await context.createBlock([ @@ -166,7 +166,7 @@ describeSuite({ it({ id: "T03", - title: "two add_stake on the IDENTICAL (coldkey, hotkey, netuid) in the SAME block both succeed — add_stake sets the limiter but never checks it", + title: "two add_stake on the IDENTICAL (coldkey, hotkey, netuid) in the SAME block both succeed", test: async () => { const aliceNonce = ((await polkadotJs.query.system.account(alice.address)) as any).nonce.toNumber(); @@ -188,7 +188,7 @@ describeSuite({ it({ id: "T04", - title: "remove_stake then transfer_stake on the IDENTICAL (coldkey, hotkey, netuid) in the SAME block both succeed — neither SETS the limiter, both only CHECK it", + title: "remove_stake then transfer_stake on the IDENTICAL (coldkey, hotkey, netuid) in the SAME block both succeed", test: async () => { const { result: [seedAdd], @@ -225,7 +225,7 @@ describeSuite({ it({ id: "T05", - title: "add_stake + CROSS-subnet transfer_stake in one block STILL reverts with StakingOperationRateLimitExceeded", + title: "add_stake + CROSS-subnet transfer_stake in one block is no longer rate-limited (limiter removed) — it now falls through to the normal amount check", test: async () => { const netuid2 = await devRegisterSubnet(polkadotJs, context, alice, aliceHotKey); await devEnableSubtoken(polkadotJs, context, alice, netuid2); @@ -236,9 +236,6 @@ describeSuite({ .addStake(aliceHotKey.address, netuid, tao(100)) .signAsync(alice, { nonce: aliceNonce }); - // A tiny amount is fine: the rate-limit check runs before the - // min-amount / liquidity checks on the cross-subnet path, so the failure - // is unambiguously the limiter. const transferTx = await polkadotJs.tx.subtensorModule .transferStake(destinationColdkey.address, aliceHotKey.address, netuid, netuid2, 1000n) .signAsync(alice, { nonce: aliceNonce + 1 }); @@ -248,7 +245,8 @@ describeSuite({ expect(addAttempt.successful).toEqual(true); expect(transferAttempt.successful).toEqual(false); - expect(transferAttempt.error.name).toEqual("StakingOperationRateLimitExceeded"); + expect(transferAttempt.error.name).not.toEqual("StakingOperationRateLimitExceeded"); + expect(transferAttempt.error.name).toEqual("AmountTooLow"); }, }); }, From cf93d824266b942b470df58fc4f522da4a54433a Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 4 Jun 2026 13:49:44 +0200 Subject: [PATCH 9/9] Update pallet-subtensor weights (reference hardware) --- pallets/subtensor/src/weights.rs | 470 +++++++++++++++---------------- 1 file changed, 235 insertions(+), 235 deletions(-) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 57eed14d35..e6e1d497de 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-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-06-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm3jyl0`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervm3jyl0`, 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.iVvhDcFf4i +// --output=/tmp/tmp.EnvT98PcDe // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -195,8 +195,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1716` // Estimated: `13600` - // Minimum execution time: 374_002_000 picoseconds. - Weight::from_parts(380_312_000, 13600) + // Minimum execution time: 363_680_000 picoseconds. + Weight::from_parts(374_160_000, 13600) .saturating_add(T::DbWeight::get().reads(48_u64)) .saturating_add(T::DbWeight::get().writes(40_u64)) } @@ -238,8 +238,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `188792` // Estimated: `10327382` - // Minimum execution time: 16_598_698_000 picoseconds. - Weight::from_parts(16_897_861_000, 10327382) + // Minimum execution time: 15_190_876_000 picoseconds. + Weight::from_parts(15_522_617_000, 10327382) .saturating_add(T::DbWeight::get().reads(4112_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -315,8 +315,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 273_000_000 picoseconds. - Weight::from_parts(277_000_000, 8727) + // Minimum execution time: 437_578_000 picoseconds. + Weight::from_parts(458_737_000, 8727) .saturating_add(T::DbWeight::get().reads(38_u64)) .saturating_add(T::DbWeight::get().writes(17_u64)) } @@ -330,8 +330,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `801` // Estimated: `6741` - // Minimum execution time: 32_538_000 picoseconds. - Weight::from_parts(33_289_000, 6741) + // Minimum execution time: 33_833_000 picoseconds. + Weight::from_parts(34_976_000, 6741) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -345,8 +345,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `774` // Estimated: `6714` - // Minimum execution time: 29_163_000 picoseconds. - Weight::from_parts(29_784_000, 6714) + // Minimum execution time: 29_875_000 picoseconds. + Weight::from_parts(31_930_000, 6714) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -448,8 +448,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1649` // Estimated: `13600` - // Minimum execution time: 362_295_000 picoseconds. - Weight::from_parts(368_123_000, 13600) + // Minimum execution time: 357_528_000 picoseconds. + Weight::from_parts(360_885_000, 13600) .saturating_add(T::DbWeight::get().reads(48_u64)) .saturating_add(T::DbWeight::get().writes(40_u64)) } @@ -501,8 +501,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1445` // Estimated: `4910` - // Minimum execution time: 102_751_000 picoseconds. - Weight::from_parts(104_294_000, 4910) + // Minimum execution time: 101_440_000 picoseconds. + Weight::from_parts(103_043_000, 4910) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -624,8 +624,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1459` // Estimated: `9874` - // Minimum execution time: 277_470_000 picoseconds. - Weight::from_parts(282_297_000, 9874) + // Minimum execution time: 270_165_000 picoseconds. + Weight::from_parts(274_934_000, 9874) .saturating_add(T::DbWeight::get().reads(42_u64)) .saturating_add(T::DbWeight::get().writes(49_u64)) } @@ -653,8 +653,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1071` // Estimated: `4536` - // Minimum execution time: 60_340_000 picoseconds. - Weight::from_parts(61_421_000, 4536) + // Minimum execution time: 60_243_000 picoseconds. + Weight::from_parts(61_195_000, 4536) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -698,8 +698,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1589` // Estimated: `7529` - // Minimum execution time: 108_541_000 picoseconds. - Weight::from_parts(110_183_000, 7529) + // Minimum execution time: 107_501_000 picoseconds. + Weight::from_parts(108_663_000, 7529) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -709,8 +709,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_076_000 picoseconds. - Weight::from_parts(4_647_000, 0) + // Minimum execution time: 5_139_000 picoseconds. + Weight::from_parts(5_470_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -731,8 +731,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `999` // Estimated: `4464` - // Minimum execution time: 52_278_000 picoseconds. - Weight::from_parts(53_209_000, 4464) + // Minimum execution time: 52_248_000 picoseconds. + Weight::from_parts(53_440_000, 4464) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -748,8 +748,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 43_995_000 picoseconds. - Weight::from_parts(45_167_000, 4159) + // Minimum execution time: 44_954_000 picoseconds. + Weight::from_parts(46_127_000, 4159) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -793,8 +793,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2175` // Estimated: `13065` - // Minimum execution time: 286_653_000 picoseconds. - Weight::from_parts(294_536_000, 13065) + // Minimum execution time: 273_361_000 picoseconds. + Weight::from_parts(278_030_000, 13065) .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -842,8 +842,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2231` // Estimated: `13121` - // Minimum execution time: 310_339_000 picoseconds. - Weight::from_parts(313_503_000, 13121) + // Minimum execution time: 294_661_000 picoseconds. + Weight::from_parts(298_628_000, 13121) .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(19_u64)) } @@ -855,8 +855,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 20_290_000 picoseconds. - Weight::from_parts(21_452_000, 4130) + // Minimum execution time: 21_981_000 picoseconds. + Weight::from_parts(22_843_000, 4130) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -868,8 +868,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 16_995_000 picoseconds. - Weight::from_parts(17_505_000, 4078) + // Minimum execution time: 18_465_000 picoseconds. + Weight::from_parts(18_975_000, 4078) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -881,8 +881,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_830_000 picoseconds. - Weight::from_parts(7_271_000, 0) + // Minimum execution time: 8_335_000 picoseconds. + Weight::from_parts(8_636_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -925,8 +925,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2094` // Estimated: `8034` - // Minimum execution time: 429_484_000 picoseconds. - Weight::from_parts(443_415_000, 8034) + // Minimum execution time: 396_982_000 picoseconds. + Weight::from_parts(417_570_000, 8034) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -960,8 +960,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1873` // Estimated: `5338` - // Minimum execution time: 176_220_000 picoseconds. - Weight::from_parts(178_253_000, 5338) + // Minimum execution time: 168_114_000 picoseconds. + Weight::from_parts(171_129_000, 5338) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -993,8 +993,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1873` // Estimated: `5338` - // Minimum execution time: 172_335_000 picoseconds. - Weight::from_parts(174_197_000, 5338) + // Minimum execution time: 163_966_000 picoseconds. + Weight::from_parts(166_412_000, 5338) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -1014,8 +1014,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 37_836_000 picoseconds. - Weight::from_parts(38_907_000, 4583) + // Minimum execution time: 38_862_000 picoseconds. + Weight::from_parts(39_724_000, 4583) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1091,8 +1091,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 328_000_000 picoseconds. - Weight::from_parts(385_000_000, 8727) + // Minimum execution time: 469_117_000 picoseconds. + Weight::from_parts(488_654_000, 8727) .saturating_add(T::DbWeight::get().reads(38_u64)) .saturating_add(T::DbWeight::get().writes(17_u64)) } @@ -1126,8 +1126,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2045` // Estimated: `7985` - // Minimum execution time: 129_000_000 picoseconds. - Weight::from_parts(130_000_000, 7985) + // Minimum execution time: 204_843_000 picoseconds. + Weight::from_parts(208_730_000, 7985) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -1191,8 +1191,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2549` // Estimated: `10964` - // Minimum execution time: 261_000_000 picoseconds. - Weight::from_parts(262_000_000, 10964) + // Minimum execution time: 413_202_000 picoseconds. + Weight::from_parts(432_628_000, 10964) .saturating_add(T::DbWeight::get().reads(34_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -1254,8 +1254,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2583` // Estimated: `10998` - // Minimum execution time: 277_000_000 picoseconds. - Weight::from_parts(280_000_000, 10998) + // Minimum execution time: 450_393_000 picoseconds. + Weight::from_parts(454_079_000, 10998) .saturating_add(T::DbWeight::get().reads(33_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -1333,8 +1333,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `3073` // Estimated: `11488` - // Minimum execution time: 404_000_000 picoseconds. - Weight::from_parts(410_000_000, 11488) + // Minimum execution time: 646_919_000 picoseconds. + Weight::from_parts(671_776_000, 11488) .saturating_add(T::DbWeight::get().reads(53_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } @@ -1372,8 +1372,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2054` // Estimated: `7994` - // Minimum execution time: 161_000_000 picoseconds. - Weight::from_parts(164_000_000, 7994) + // Minimum execution time: 239_368_000 picoseconds. + Weight::from_parts(242_704_000, 7994) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -1451,8 +1451,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2916` // Estimated: `11331` - // Minimum execution time: 370_000_000 picoseconds. - Weight::from_parts(382_000_000, 11331) + // Minimum execution time: 591_385_000 picoseconds. + Weight::from_parts(613_016_000, 11331) .saturating_add(T::DbWeight::get().reads(53_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } @@ -1482,8 +1482,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1122` // Estimated: `4587` - // Minimum execution time: 127_058_000 picoseconds. - Weight::from_parts(129_030_000, 4587) + // Minimum execution time: 123_450_000 picoseconds. + Weight::from_parts(125_074_000, 4587) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1523,8 +1523,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1426` // Estimated: `7366` - // Minimum execution time: 101_319_000 picoseconds. - Weight::from_parts(102_992_000, 7366) + // Minimum execution time: 99_767_000 picoseconds. + Weight::from_parts(100_828_000, 7366) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1540,8 +1540,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `793` // Estimated: `4258` - // Minimum execution time: 25_969_000 picoseconds. - Weight::from_parts(27_160_000, 4258) + // Minimum execution time: 27_882_000 picoseconds. + Weight::from_parts(28_253_000, 4258) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1559,8 +1559,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `886` // Estimated: `4351` - // Minimum execution time: 33_360_000 picoseconds. - Weight::from_parts(34_381_000, 4351) + // Minimum execution time: 34_765_000 picoseconds. + Weight::from_parts(36_018_000, 4351) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1682,8 +1682,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1343` // Estimated: `9758` - // Minimum execution time: 271_161_000 picoseconds. - Weight::from_parts(278_281_000, 9758) + // Minimum execution time: 266_478_000 picoseconds. + Weight::from_parts(274_533_000, 9758) .saturating_add(T::DbWeight::get().reads(41_u64)) .saturating_add(T::DbWeight::get().writes(48_u64)) } @@ -1697,8 +1697,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `772` // Estimated: `6712` - // Minimum execution time: 31_877_000 picoseconds. - Weight::from_parts(32_949_000, 6712) + // Minimum execution time: 33_142_000 picoseconds. + Weight::from_parts(34_264_000, 6712) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1712,8 +1712,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `852` // Estimated: `6792` - // Minimum execution time: 28_833_000 picoseconds. - Weight::from_parts(29_874_000, 6792) + // Minimum execution time: 30_347_000 picoseconds. + Weight::from_parts(31_128_000, 6792) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1725,8 +1725,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `595` // Estimated: `4060` - // Minimum execution time: 15_502_000 picoseconds. - Weight::from_parts(16_184_000, 4060) + // Minimum execution time: 17_382_000 picoseconds. + Weight::from_parts(18_063_000, 4060) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1802,8 +1802,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `3026` // Estimated: `28766` - // Minimum execution time: 1_201_334_000 picoseconds. - Weight::from_parts(1_208_365_000, 28766) + // Minimum execution time: 1_165_089_000 picoseconds. + Weight::from_parts(1_174_326_000, 28766) .saturating_add(T::DbWeight::get().reads(171_u64)) .saturating_add(T::DbWeight::get().writes(95_u64)) } @@ -1817,8 +1817,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `745` // Estimated: `4210` - // Minimum execution time: 22_373_000 picoseconds. - Weight::from_parts(23_134_000, 4210) + // Minimum execution time: 23_924_000 picoseconds. + Weight::from_parts(24_445_000, 4210) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1832,8 +1832,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `740` // Estimated: `9155` - // Minimum execution time: 25_017_000 picoseconds. - Weight::from_parts(25_658_000, 9155) + // Minimum execution time: 26_739_000 picoseconds. + Weight::from_parts(27_562_000, 9155) .saturating_add(T::DbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -1902,8 +1902,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2642` // Estimated: `11306` - // Minimum execution time: 371_000_000 picoseconds. - Weight::from_parts(380_000_000, 11306) + // Minimum execution time: 572_260_000 picoseconds. + Weight::from_parts(578_381_000, 11306) .saturating_add(T::DbWeight::get().reads(49_u64)) .saturating_add(T::DbWeight::get().writes(27_u64)) } @@ -1965,8 +1965,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2583` // Estimated: `10998` - // Minimum execution time: 295_000_000 picoseconds. - Weight::from_parts(297_000_000, 10998) + // Minimum execution time: 472_042_000 picoseconds. + Weight::from_parts(486_249_000, 10998) .saturating_add(T::DbWeight::get().reads(33_u64)) .saturating_add(T::DbWeight::get().writes(15_u64)) } @@ -2107,10 +2107,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1762 + k * (44 ±0)` // Estimated: `10183 + k * (2579 ±0)` - // Minimum execution time: 488_121_000 picoseconds. - Weight::from_parts(306_068_429, 10183) - // Standard Error: 24_263 - .saturating_add(Weight::from_parts(48_393_644, 0).saturating_mul(k.into())) + // Minimum execution time: 474_417_000 picoseconds. + Weight::from_parts(328_475_253, 10183) + // Standard Error: 23_250 + .saturating_add(Weight::from_parts(45_082_115, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(51_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(54_u64)) @@ -2140,10 +2140,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1468 + k * (53 ±0)` // Estimated: `6148 + k * (2514 ±0)` - // Minimum execution time: 91_385_000 picoseconds. - Weight::from_parts(96_646_996, 6148) - // Standard Error: 5_309 - .saturating_add(Weight::from_parts(1_570_386, 0).saturating_mul(k.into())) + // Minimum execution time: 93_826_000 picoseconds. + Weight::from_parts(79_282_492, 6148) + // Standard Error: 8_893 + .saturating_add(Weight::from_parts(1_590_919, 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)) @@ -2158,8 +2158,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `659` // Estimated: `9074` - // Minimum execution time: 24_486_000 picoseconds. - Weight::from_parts(25_798_000, 9074) + // Minimum execution time: 27_282_000 picoseconds. + Weight::from_parts(28_413_000, 9074) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2187,8 +2187,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1070` // Estimated: `4535` - // Minimum execution time: 72_186_000 picoseconds. - Weight::from_parts(73_359_000, 4535) + // Minimum execution time: 73_367_000 picoseconds. + Weight::from_parts(76_262_000, 4535) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2204,8 +2204,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 31_566_000 picoseconds. - Weight::from_parts(32_979_000, 4274) + // Minimum execution time: 33_021_000 picoseconds. + Weight::from_parts(33_643_000, 4274) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2221,8 +2221,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 15_613_000 picoseconds. - Weight::from_parts(16_064_000, 3941) + // Minimum execution time: 17_273_000 picoseconds. + Weight::from_parts(17_854_000, 3941) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2252,8 +2252,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1929` // Estimated: `7869` - // Minimum execution time: 140_608_000 picoseconds. - Weight::from_parts(142_310_000, 7869) + // Minimum execution time: 135_884_000 picoseconds. + Weight::from_parts(138_449_000, 7869) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2263,8 +2263,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_883_000 picoseconds. - Weight::from_parts(2_083_000, 0) + // Minimum execution time: 2_806_000 picoseconds. + Weight::from_parts(2_985_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) @@ -2273,8 +2273,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_136_000 picoseconds. - Weight::from_parts(4_747_000, 0) + // Minimum execution time: 5_150_000 picoseconds. + Weight::from_parts(5_460_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2287,8 +2287,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `862` // Estimated: `4327` - // Minimum execution time: 23_675_000 picoseconds. - Weight::from_parts(25_277_000, 4327) + // Minimum execution time: 25_978_000 picoseconds. + Weight::from_parts(26_921_000, 4327) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2366,8 +2366,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2636` // Estimated: `8727` - // Minimum execution time: 383_000_000 picoseconds. - Weight::from_parts(405_000_000, 8727) + // Minimum execution time: 587_829_000 picoseconds. + Weight::from_parts(608_638_000, 8727) .saturating_add(T::DbWeight::get().reads(39_u64)) .saturating_add(T::DbWeight::get().writes(18_u64)) } @@ -2377,8 +2377,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_963_000 picoseconds. - Weight::from_parts(2_083_000, 0) + // Minimum execution time: 2_696_000 picoseconds. + Weight::from_parts(2_885_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2417,8 +2417,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1644` // Estimated: `7584` - // Minimum execution time: 111_775_000 picoseconds. - Weight::from_parts(114_028_000, 7584) + // Minimum execution time: 109_755_000 picoseconds. + Weight::from_parts(111_419_000, 7584) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2446,8 +2446,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1366` // Estimated: `7306` - // Minimum execution time: 146_897_000 picoseconds. - Weight::from_parts(148_699_000, 7306) + // Minimum execution time: 139_441_000 picoseconds. + Weight::from_parts(140_653_000, 7306) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2553,8 +2553,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1716` // Estimated: `13600` - // Minimum execution time: 374_002_000 picoseconds. - Weight::from_parts(380_312_000, 13600) + // Minimum execution time: 363_680_000 picoseconds. + Weight::from_parts(374_160_000, 13600) .saturating_add(RocksDbWeight::get().reads(48_u64)) .saturating_add(RocksDbWeight::get().writes(40_u64)) } @@ -2596,8 +2596,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `188792` // Estimated: `10327382` - // Minimum execution time: 16_598_698_000 picoseconds. - Weight::from_parts(16_897_861_000, 10327382) + // Minimum execution time: 15_190_876_000 picoseconds. + Weight::from_parts(15_522_617_000, 10327382) .saturating_add(RocksDbWeight::get().reads(4112_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2673,8 +2673,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 273_000_000 picoseconds. - Weight::from_parts(277_000_000, 8727) + // Minimum execution time: 437_578_000 picoseconds. + Weight::from_parts(458_737_000, 8727) .saturating_add(RocksDbWeight::get().reads(38_u64)) .saturating_add(RocksDbWeight::get().writes(17_u64)) } @@ -2688,8 +2688,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `801` // Estimated: `6741` - // Minimum execution time: 32_538_000 picoseconds. - Weight::from_parts(33_289_000, 6741) + // Minimum execution time: 33_833_000 picoseconds. + Weight::from_parts(34_976_000, 6741) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2703,8 +2703,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `774` // Estimated: `6714` - // Minimum execution time: 29_163_000 picoseconds. - Weight::from_parts(29_784_000, 6714) + // Minimum execution time: 29_875_000 picoseconds. + Weight::from_parts(31_930_000, 6714) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2806,8 +2806,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1649` // Estimated: `13600` - // Minimum execution time: 362_295_000 picoseconds. - Weight::from_parts(368_123_000, 13600) + // Minimum execution time: 357_528_000 picoseconds. + Weight::from_parts(360_885_000, 13600) .saturating_add(RocksDbWeight::get().reads(48_u64)) .saturating_add(RocksDbWeight::get().writes(40_u64)) } @@ -2859,8 +2859,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1445` // Estimated: `4910` - // Minimum execution time: 102_751_000 picoseconds. - Weight::from_parts(104_294_000, 4910) + // Minimum execution time: 101_440_000 picoseconds. + Weight::from_parts(103_043_000, 4910) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -2982,8 +2982,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1459` // Estimated: `9874` - // Minimum execution time: 277_470_000 picoseconds. - Weight::from_parts(282_297_000, 9874) + // Minimum execution time: 270_165_000 picoseconds. + Weight::from_parts(274_934_000, 9874) .saturating_add(RocksDbWeight::get().reads(42_u64)) .saturating_add(RocksDbWeight::get().writes(49_u64)) } @@ -3011,8 +3011,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1071` // Estimated: `4536` - // Minimum execution time: 60_340_000 picoseconds. - Weight::from_parts(61_421_000, 4536) + // Minimum execution time: 60_243_000 picoseconds. + Weight::from_parts(61_195_000, 4536) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3056,8 +3056,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1589` // Estimated: `7529` - // Minimum execution time: 108_541_000 picoseconds. - Weight::from_parts(110_183_000, 7529) + // Minimum execution time: 107_501_000 picoseconds. + Weight::from_parts(108_663_000, 7529) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3067,8 +3067,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_076_000 picoseconds. - Weight::from_parts(4_647_000, 0) + // Minimum execution time: 5_139_000 picoseconds. + Weight::from_parts(5_470_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -3089,8 +3089,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `999` // Estimated: `4464` - // Minimum execution time: 52_278_000 picoseconds. - Weight::from_parts(53_209_000, 4464) + // Minimum execution time: 52_248_000 picoseconds. + Weight::from_parts(53_440_000, 4464) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3106,8 +3106,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 43_995_000 picoseconds. - Weight::from_parts(45_167_000, 4159) + // Minimum execution time: 44_954_000 picoseconds. + Weight::from_parts(46_127_000, 4159) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3151,8 +3151,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2175` // Estimated: `13065` - // Minimum execution time: 286_653_000 picoseconds. - Weight::from_parts(294_536_000, 13065) + // Minimum execution time: 273_361_000 picoseconds. + Weight::from_parts(278_030_000, 13065) .saturating_add(RocksDbWeight::get().reads(35_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -3200,8 +3200,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2231` // Estimated: `13121` - // Minimum execution time: 310_339_000 picoseconds. - Weight::from_parts(313_503_000, 13121) + // Minimum execution time: 294_661_000 picoseconds. + Weight::from_parts(298_628_000, 13121) .saturating_add(RocksDbWeight::get().reads(35_u64)) .saturating_add(RocksDbWeight::get().writes(19_u64)) } @@ -3213,8 +3213,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 20_290_000 picoseconds. - Weight::from_parts(21_452_000, 4130) + // Minimum execution time: 21_981_000 picoseconds. + Weight::from_parts(22_843_000, 4130) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3226,8 +3226,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 16_995_000 picoseconds. - Weight::from_parts(17_505_000, 4078) + // Minimum execution time: 18_465_000 picoseconds. + Weight::from_parts(18_975_000, 4078) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3239,8 +3239,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_830_000 picoseconds. - Weight::from_parts(7_271_000, 0) + // Minimum execution time: 8_335_000 picoseconds. + Weight::from_parts(8_636_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3283,8 +3283,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2094` // Estimated: `8034` - // Minimum execution time: 429_484_000 picoseconds. - Weight::from_parts(443_415_000, 8034) + // Minimum execution time: 396_982_000 picoseconds. + Weight::from_parts(417_570_000, 8034) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3318,8 +3318,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1873` // Estimated: `5338` - // Minimum execution time: 176_220_000 picoseconds. - Weight::from_parts(178_253_000, 5338) + // Minimum execution time: 168_114_000 picoseconds. + Weight::from_parts(171_129_000, 5338) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -3351,8 +3351,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1873` // Estimated: `5338` - // Minimum execution time: 172_335_000 picoseconds. - Weight::from_parts(174_197_000, 5338) + // Minimum execution time: 163_966_000 picoseconds. + Weight::from_parts(166_412_000, 5338) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -3372,8 +3372,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 37_836_000 picoseconds. - Weight::from_parts(38_907_000, 4583) + // Minimum execution time: 38_862_000 picoseconds. + Weight::from_parts(39_724_000, 4583) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3449,8 +3449,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2633` // Estimated: `8727` - // Minimum execution time: 328_000_000 picoseconds. - Weight::from_parts(385_000_000, 8727) + // Minimum execution time: 469_117_000 picoseconds. + Weight::from_parts(488_654_000, 8727) .saturating_add(RocksDbWeight::get().reads(38_u64)) .saturating_add(RocksDbWeight::get().writes(17_u64)) } @@ -3484,8 +3484,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2045` // Estimated: `7985` - // Minimum execution time: 129_000_000 picoseconds. - Weight::from_parts(130_000_000, 7985) + // Minimum execution time: 204_843_000 picoseconds. + Weight::from_parts(208_730_000, 7985) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -3549,8 +3549,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2549` // Estimated: `10964` - // Minimum execution time: 261_000_000 picoseconds. - Weight::from_parts(262_000_000, 10964) + // Minimum execution time: 413_202_000 picoseconds. + Weight::from_parts(432_628_000, 10964) .saturating_add(RocksDbWeight::get().reads(34_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -3612,8 +3612,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2583` // Estimated: `10998` - // Minimum execution time: 277_000_000 picoseconds. - Weight::from_parts(280_000_000, 10998) + // Minimum execution time: 450_393_000 picoseconds. + Weight::from_parts(454_079_000, 10998) .saturating_add(RocksDbWeight::get().reads(33_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -3691,8 +3691,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `3073` // Estimated: `11488` - // Minimum execution time: 404_000_000 picoseconds. - Weight::from_parts(410_000_000, 11488) + // Minimum execution time: 646_919_000 picoseconds. + Weight::from_parts(671_776_000, 11488) .saturating_add(RocksDbWeight::get().reads(53_u64)) .saturating_add(RocksDbWeight::get().writes(25_u64)) } @@ -3730,8 +3730,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2054` // Estimated: `7994` - // Minimum execution time: 161_000_000 picoseconds. - Weight::from_parts(164_000_000, 7994) + // Minimum execution time: 239_368_000 picoseconds. + Weight::from_parts(242_704_000, 7994) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -3809,8 +3809,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2916` // Estimated: `11331` - // Minimum execution time: 370_000_000 picoseconds. - Weight::from_parts(382_000_000, 11331) + // Minimum execution time: 591_385_000 picoseconds. + Weight::from_parts(613_016_000, 11331) .saturating_add(RocksDbWeight::get().reads(53_u64)) .saturating_add(RocksDbWeight::get().writes(25_u64)) } @@ -3840,8 +3840,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1122` // Estimated: `4587` - // Minimum execution time: 127_058_000 picoseconds. - Weight::from_parts(129_030_000, 4587) + // Minimum execution time: 123_450_000 picoseconds. + Weight::from_parts(125_074_000, 4587) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3881,8 +3881,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1426` // Estimated: `7366` - // Minimum execution time: 101_319_000 picoseconds. - Weight::from_parts(102_992_000, 7366) + // Minimum execution time: 99_767_000 picoseconds. + Weight::from_parts(100_828_000, 7366) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3898,8 +3898,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `793` // Estimated: `4258` - // Minimum execution time: 25_969_000 picoseconds. - Weight::from_parts(27_160_000, 4258) + // Minimum execution time: 27_882_000 picoseconds. + Weight::from_parts(28_253_000, 4258) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3917,8 +3917,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `886` // Estimated: `4351` - // Minimum execution time: 33_360_000 picoseconds. - Weight::from_parts(34_381_000, 4351) + // Minimum execution time: 34_765_000 picoseconds. + Weight::from_parts(36_018_000, 4351) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4040,8 +4040,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1343` // Estimated: `9758` - // Minimum execution time: 271_161_000 picoseconds. - Weight::from_parts(278_281_000, 9758) + // Minimum execution time: 266_478_000 picoseconds. + Weight::from_parts(274_533_000, 9758) .saturating_add(RocksDbWeight::get().reads(41_u64)) .saturating_add(RocksDbWeight::get().writes(48_u64)) } @@ -4055,8 +4055,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `772` // Estimated: `6712` - // Minimum execution time: 31_877_000 picoseconds. - Weight::from_parts(32_949_000, 6712) + // Minimum execution time: 33_142_000 picoseconds. + Weight::from_parts(34_264_000, 6712) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4070,8 +4070,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `852` // Estimated: `6792` - // Minimum execution time: 28_833_000 picoseconds. - Weight::from_parts(29_874_000, 6792) + // Minimum execution time: 30_347_000 picoseconds. + Weight::from_parts(31_128_000, 6792) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4083,8 +4083,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `595` // Estimated: `4060` - // Minimum execution time: 15_502_000 picoseconds. - Weight::from_parts(16_184_000, 4060) + // Minimum execution time: 17_382_000 picoseconds. + Weight::from_parts(18_063_000, 4060) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4160,8 +4160,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `3026` // Estimated: `28766` - // Minimum execution time: 1_201_334_000 picoseconds. - Weight::from_parts(1_208_365_000, 28766) + // Minimum execution time: 1_165_089_000 picoseconds. + Weight::from_parts(1_174_326_000, 28766) .saturating_add(RocksDbWeight::get().reads(171_u64)) .saturating_add(RocksDbWeight::get().writes(95_u64)) } @@ -4175,8 +4175,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `745` // Estimated: `4210` - // Minimum execution time: 22_373_000 picoseconds. - Weight::from_parts(23_134_000, 4210) + // Minimum execution time: 23_924_000 picoseconds. + Weight::from_parts(24_445_000, 4210) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -4190,8 +4190,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `740` // Estimated: `9155` - // Minimum execution time: 25_017_000 picoseconds. - Weight::from_parts(25_658_000, 9155) + // Minimum execution time: 26_739_000 picoseconds. + Weight::from_parts(27_562_000, 9155) .saturating_add(RocksDbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4260,8 +4260,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2642` // Estimated: `11306` - // Minimum execution time: 371_000_000 picoseconds. - Weight::from_parts(380_000_000, 11306) + // Minimum execution time: 572_260_000 picoseconds. + Weight::from_parts(578_381_000, 11306) .saturating_add(RocksDbWeight::get().reads(49_u64)) .saturating_add(RocksDbWeight::get().writes(27_u64)) } @@ -4323,8 +4323,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2583` // Estimated: `10998` - // Minimum execution time: 295_000_000 picoseconds. - Weight::from_parts(297_000_000, 10998) + // Minimum execution time: 472_042_000 picoseconds. + Weight::from_parts(486_249_000, 10998) .saturating_add(RocksDbWeight::get().reads(33_u64)) .saturating_add(RocksDbWeight::get().writes(15_u64)) } @@ -4465,10 +4465,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1762 + k * (44 ±0)` // Estimated: `10183 + k * (2579 ±0)` - // Minimum execution time: 488_121_000 picoseconds. - Weight::from_parts(306_068_429, 10183) - // Standard Error: 24_263 - .saturating_add(Weight::from_parts(48_393_644, 0).saturating_mul(k.into())) + // Minimum execution time: 474_417_000 picoseconds. + Weight::from_parts(328_475_253, 10183) + // Standard Error: 23_250 + .saturating_add(Weight::from_parts(45_082_115, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(51_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(54_u64)) @@ -4498,10 +4498,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1468 + k * (53 ±0)` // Estimated: `6148 + k * (2514 ±0)` - // Minimum execution time: 91_385_000 picoseconds. - Weight::from_parts(96_646_996, 6148) - // Standard Error: 5_309 - .saturating_add(Weight::from_parts(1_570_386, 0).saturating_mul(k.into())) + // Minimum execution time: 93_826_000 picoseconds. + Weight::from_parts(79_282_492, 6148) + // Standard Error: 8_893 + .saturating_add(Weight::from_parts(1_590_919, 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)) @@ -4516,8 +4516,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `659` // Estimated: `9074` - // Minimum execution time: 24_486_000 picoseconds. - Weight::from_parts(25_798_000, 9074) + // Minimum execution time: 27_282_000 picoseconds. + Weight::from_parts(28_413_000, 9074) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4545,8 +4545,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1070` // Estimated: `4535` - // Minimum execution time: 72_186_000 picoseconds. - Weight::from_parts(73_359_000, 4535) + // Minimum execution time: 73_367_000 picoseconds. + Weight::from_parts(76_262_000, 4535) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4562,8 +4562,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 31_566_000 picoseconds. - Weight::from_parts(32_979_000, 4274) + // Minimum execution time: 33_021_000 picoseconds. + Weight::from_parts(33_643_000, 4274) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4579,8 +4579,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 15_613_000 picoseconds. - Weight::from_parts(16_064_000, 3941) + // Minimum execution time: 17_273_000 picoseconds. + Weight::from_parts(17_854_000, 3941) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4610,8 +4610,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1929` // Estimated: `7869` - // Minimum execution time: 140_608_000 picoseconds. - Weight::from_parts(142_310_000, 7869) + // Minimum execution time: 135_884_000 picoseconds. + Weight::from_parts(138_449_000, 7869) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4621,8 +4621,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_883_000 picoseconds. - Weight::from_parts(2_083_000, 0) + // Minimum execution time: 2_806_000 picoseconds. + Weight::from_parts(2_985_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) @@ -4631,8 +4631,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_136_000 picoseconds. - Weight::from_parts(4_747_000, 0) + // Minimum execution time: 5_150_000 picoseconds. + Weight::from_parts(5_460_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4645,8 +4645,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `862` // Estimated: `4327` - // Minimum execution time: 23_675_000 picoseconds. - Weight::from_parts(25_277_000, 4327) + // Minimum execution time: 25_978_000 picoseconds. + Weight::from_parts(26_921_000, 4327) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4724,8 +4724,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2636` // Estimated: `8727` - // Minimum execution time: 383_000_000 picoseconds. - Weight::from_parts(405_000_000, 8727) + // Minimum execution time: 587_829_000 picoseconds. + Weight::from_parts(608_638_000, 8727) .saturating_add(RocksDbWeight::get().reads(39_u64)) .saturating_add(RocksDbWeight::get().writes(18_u64)) } @@ -4735,8 +4735,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_963_000 picoseconds. - Weight::from_parts(2_083_000, 0) + // Minimum execution time: 2_696_000 picoseconds. + Weight::from_parts(2_885_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4775,8 +4775,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1644` // Estimated: `7584` - // Minimum execution time: 111_775_000 picoseconds. - Weight::from_parts(114_028_000, 7584) + // Minimum execution time: 109_755_000 picoseconds. + Weight::from_parts(111_419_000, 7584) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4804,8 +4804,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1366` // Estimated: `7306` - // Minimum execution time: 146_897_000 picoseconds. - Weight::from_parts(148_699_000, 7306) + // Minimum execution time: 139_441_000 picoseconds. + Weight::from_parts(140_653_000, 7306) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) }