From f8ff769a45395d2de7ec26110d0001aa1ff2e9ec Mon Sep 17 00:00:00 2001 From: UnArbosSix Date: Tue, 11 Aug 2026 09:41:18 -0700 Subject: [PATCH 01/14] Restore miner-burn emission scaling --- docs/concepts/emissions.mdx | 36 +- docs/migration.mdx | 11 +- .../subtensor/src/coinbase/run_coinbase.rs | 7 +- .../src/coinbase/subnet_emissions.rs | 41 +- .../subtensor/src/tests/subnet_emissions.rs | 95 ++- .../public/catalog/emission-snapshot.json | 659 +++++++++++------- .../scripts/fetch-emission-snapshot.py | 56 +- .../(pages-without-footer)/releases/page.tsx | 6 +- .../releases/v444-upgrade/page.tsx | 92 +-- .../docs/emission-network-snapshot.tsx | 4 +- .../docs/subnet-emission-share-chart.tsx | 40 +- .../src/lib/emission-math.ts | 21 +- .../src/lib/emission-snapshot.ts | 5 +- 13 files changed, 645 insertions(+), 428 deletions(-) diff --git a/docs/concepts/emissions.mdx b/docs/concepts/emissions.mdx index 2c3e6ef9ce..5c0e2061c7 100644 --- a/docs/concepts/emissions.mdx +++ b/docs/concepts/emissions.mdx @@ -71,27 +71,37 @@ protocol-owned alpha. ## Subnet emission shares -Each block's TAO emission is divided in two clear steps. First, the chain turns -each eligible subnet's **EMA price** into a share of total demand: +Each block's TAO emission is divided in three steps. First, the chain turns each +eligible subnet's **EMA price** into a share of total demand: ``` demand_share_i = price_ema_i / Σ price_ema ``` -`MinerBurned` does not change this cross-subnet share. It still records what -happened to miner incentive inside the subnet, but one subnet's local burn or -recycle choice does not change another subnet's emission. +Next, the chain scales that price share by `1 − MinerBurned` and renormalizes: -Second, the **emission gate** reduces weak demand before the final shares are -normalized. The gate has a midpoint called `theta`. By default, `theta` is the -32nd-highest positive demand share. It is normally recalculated every 360 -blocks and stays fixed between updates. A subnet at the midpoint passes half -of its demand weight. Subnets well above it pass almost all; subnets well below -it pass much less: +``` +burn_adjusted_share_i = demand_share_i × (1 − miner_burned_i) + / Σ(demand_share × (1 − miner_burned)) +``` + +`MinerBurned` is the proportion of the last tempo's miner incentive withheld +because it was directed to subnet-owner hotkeys. Withheld incentive counts +whether it is recycled or burned, so changing `RecycleOrBurn` cannot bypass the +scaling. If every adjusted weight is zero, the runtime restores the unadjusted +price shares so emission is not stranded. + +Finally, the **emission gate** reduces weak burn-adjusted shares before the final +shares are normalized. The gate has a midpoint called `theta`. By default, +`theta` is the 32nd-highest positive adjusted share. It is normally recalculated +every 360 blocks and stays fixed between updates. A subnet at the midpoint +passes half of its adjusted weight. Subnets well above it pass almost all; +subnets well below it pass much less: ``` -gate_i = 1 / (1 + (theta / demand_share_i)^h) -final_share_i = demand_share_i × gate_i / Σ(demand_share × gate) +gate_i = 1 / (1 + (theta / burn_adjusted_share_i)^h) +final_share_i = burn_adjusted_share_i × gate_i + / Σ(burn_adjusted_share × gate) ``` The default exponent `h` is 3. This makes the gate gradual rather than a hard diff --git a/docs/migration.mdx b/docs/migration.mdx index 7600537c53..c147a98973 100644 --- a/docs/migration.mdx +++ b/docs/migration.mdx @@ -521,12 +521,11 @@ the upgrade. See the release notes for to the highest-conviction hotkey when total conviction reaches 10% of `SubnetAlphaOut`. Existing conviction counts toward this threshold. See [Conviction](/docs/guides/conviction). -- **Cross-subnet emissions.** V444 allocation uses each subnet's EMA price, - followed by the emission gate. `MinerBurned` no longer changes a subnet's - cross-network share. [`root_proportion`](/code/pallets/subtensor/src/coinbase/block_step.rs#L74-L84) - is also not part of the inter-subnet split; it still applies inside each - subnet for injection caps and root dividends. Update emission calculations - and forecasts. See [Emissions](/docs/concepts/emissions). +- **Cross-subnet emissions.** Allocation continues to use each subnet's EMA + price scaled by `1 − MinerBurned`, followed by the emission gate. + [`root_proportion`](/code/pallets/subtensor/src/coinbase/block_step.rs#L74-L84) + is not part of the inter-subnet split; it still applies inside each subnet + for injection caps and root dividends. See [Emissions](/docs/concepts/emissions). ### Proxies and coldkeys diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 1421d37e0f..644c36a489 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -737,10 +737,9 @@ impl Pallet { "incentives: hotkey: {hotkey:?} is SN owner hotkey or associated hotkey, skipping {incentive:?}" ); // Miner emission directed to an owner (immune) hotkey is withheld from - // miners whether it is recycled or burned. Count both toward the recorded - // withheld proportion so the metric is independent of the subnet's - // RecycleOrBurn configuration. The proportion is informational only and - // does not affect the subnet's emission share. + // miners whether it is recycled or burned. Count both toward the withheld + // proportion so the emission penalty cannot be dodged by choosing Recycle + // and an unset RecycleOrBurn config is not uniquely penalized. withheld_incentive = withheld_incentive.saturating_add(incentive); // Check if we should recycle or burn the incentive match RecycleOrBurn::::try_get(netuid) { diff --git a/pallets/subtensor/src/coinbase/subnet_emissions.rs b/pallets/subtensor/src/coinbase/subnet_emissions.rs index 8fc77e52db..618614a86e 100644 --- a/pallets/subtensor/src/coinbase/subnet_emissions.rs +++ b/pallets/subtensor/src/coinbase/subnet_emissions.rs @@ -347,13 +347,42 @@ impl Pallet { offset_flows } - // Price-based emission shares: each subnet's share is its EMA price normalized - // by the sum of EMA prices, passed through the emission gate. Emit-disabled - // subnets are zeroed and their share redistributed to enabled subnets in - // `get_subnet_block_emissions`, so the effective emission is - // e_i = gate(s_i) * s_i / sum(gate(s_j) * s_j) over emit-enabled subnets. + // Price-based emission shares: normalize EMA prices, reweight each share by + // (1 - MinerBurned), renormalize, then pass the result through the emission + // gate. Emit-disabled subnets are zeroed and their share redistributed to + // enabled subnets in `get_subnet_block_emissions`. pub(crate) fn get_shares(subnets_to_emit_to: &[NetUid]) -> BTreeMap { - let mut shares = Self::get_shares_price_ema(subnets_to_emit_to); + let price_shares = Self::get_shares_price_ema(subnets_to_emit_to); + + // Reallocate emission away from subnets that withhold miner emission. + // The effective pre-gate weight is price_i * (1 - miner_burned_i). + let zero = U64F64::saturating_from_num(0); + let one = U64F64::saturating_from_num(1); + let weighted: BTreeMap = price_shares + .iter() + .map(|(netuid, share)| { + let burned = U64F64::saturating_from_num(MinerBurned::::get(netuid)).min(one); + let factor = one.saturating_sub(burned); + + (*netuid, share.saturating_mul(factor)) + }) + .collect(); + + let total_weight = weighted + .values() + .copied() + .fold(zero, |acc, weight| acc.saturating_add(weight)); + + let mut shares = if total_weight > zero { + weighted + .into_iter() + .map(|(netuid, weight)| (netuid, weight.safe_div(total_weight))) + .collect() + } else { + // If every weight is zero (for example, every eligible subnet has + // MinerBurned == 1), restore the price shares so emission is not stranded. + price_shares + }; Self::maybe_update_emission_gate_bar(&shares); Self::apply_emission_gate(&mut shares); diff --git a/pallets/subtensor/src/tests/subnet_emissions.rs b/pallets/subtensor/src/tests/subnet_emissions.rs index 756bfbe8c0..b0d3d6efd1 100644 --- a/pallets/subtensor/src/tests/subnet_emissions.rs +++ b/pallets/subtensor/src/tests/subnet_emissions.rs @@ -192,36 +192,73 @@ fn get_shares_ignores_root_prop_storage_when_prices_and_burns_match() { }); } -/// Regression: `get_shares` must be independent of `MinerBurned`. The removed -/// formula weighted each price share by (1 - miner_burned) and renormalized, -/// so under it a burn split of 0 : 1 yields shares 1 : 0 and a split of -/// 0.25 : 0.75 yields 0.75 : 0.25. This test fails if that weighting is -/// reintroduced. +/// Miner-burn scaling is applied before the emission gate. Equal EMA prices +/// with burns 0.25 : 0.75 produce pre-gate shares 0.75 : 0.25. With the +/// default h=3 gate and theta=0.25, the final shares are 81/95 : 14/95. #[test] -fn get_shares_independent_of_miner_burned() { - // (burn_n1, burn_n2): boundary values and a non-boundary split. - for (burn_n1, burn_n2) in [(0.0, 1.0), (1.0, 0.0), (0.25, 0.75)] { - new_test_ext(1).execute_with(|| { - let owner_hotkey = U256::from(90); - let owner_coldkey = U256::from(91); - let n1 = add_dynamic_network(&owner_hotkey, &owner_coldkey); - let n2 = add_dynamic_network(&owner_hotkey, &owner_coldkey); - - // Equal prices; only the miner-burn values differ. - SubnetMovingPrice::::insert(n1, i96f32(1.0)); - SubnetMovingPrice::::insert(n2, i96f32(1.0)); - MinerBurned::::insert(n1, U96F32::saturating_from_num(burn_n1)); - MinerBurned::::insert(n2, U96F32::saturating_from_num(burn_n2)); - - let shares = SubtensorModule::get_shares(&[n1, n2]); - let s1 = shares.get(&n1).copied().unwrap().to_num::(); - let s2 = shares.get(&n2).copied().unwrap().to_num::(); - - assert_abs_diff_eq!(s1, 0.5_f64, epsilon = 1e-9); - assert_abs_diff_eq!(s2, 0.5_f64, epsilon = 1e-9); - assert_abs_diff_eq!(s1 + s2, 1.0_f64, epsilon = 1e-9); - }); - } +fn get_shares_scales_by_miner_burn_before_gate() { + new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(90); + let owner_coldkey = U256::from(91); + let n1 = add_dynamic_network(&owner_hotkey, &owner_coldkey); + let n2 = add_dynamic_network(&owner_hotkey, &owner_coldkey); + + SubnetMovingPrice::::insert(n1, i96f32(1.0)); + SubnetMovingPrice::::insert(n2, i96f32(1.0)); + MinerBurned::::insert(n1, U96F32::saturating_from_num(0.25)); + MinerBurned::::insert(n2, U96F32::saturating_from_num(0.75)); + + let shares = SubtensorModule::get_shares(&[n1, n2]); + let s1 = shares.get(&n1).copied().unwrap().to_num::(); + let s2 = shares.get(&n2).copied().unwrap().to_num::(); + + assert_abs_diff_eq!( + EmissionGateBar::::get().to_num::(), + 0.25, + epsilon = 1e-9 + ); + assert_abs_diff_eq!(s1, 81.0 / 95.0, epsilon = 1e-6); + assert_abs_diff_eq!(s2, 14.0 / 95.0, epsilon = 1e-6); + assert_abs_diff_eq!(s1 + s2, 1.0, epsilon = 1e-9); + }); +} + +#[test] +fn get_shares_full_miner_burn_gets_zero() { + new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(92); + let owner_coldkey = U256::from(93); + let n1 = add_dynamic_network(&owner_hotkey, &owner_coldkey); + let n2 = add_dynamic_network(&owner_hotkey, &owner_coldkey); + + SubnetMovingPrice::::insert(n1, i96f32(1.0)); + SubnetMovingPrice::::insert(n2, i96f32(1.0)); + MinerBurned::::insert(n1, U96F32::saturating_from_num(1.0)); + MinerBurned::::insert(n2, U96F32::saturating_from_num(0.0)); + + let shares = SubtensorModule::get_shares(&[n1, n2]); + assert_abs_diff_eq!(shares[&n1].to_num::(), 0.0, epsilon = 1e-9); + assert_abs_diff_eq!(shares[&n2].to_num::(), 1.0, epsilon = 1e-9); + }); +} + +#[test] +fn get_shares_all_full_miner_burn_falls_back_to_price_shares() { + new_test_ext(1).execute_with(|| { + let owner_hotkey = U256::from(94); + let owner_coldkey = U256::from(95); + let n1 = add_dynamic_network(&owner_hotkey, &owner_coldkey); + let n2 = add_dynamic_network(&owner_hotkey, &owner_coldkey); + + SubnetMovingPrice::::insert(n1, i96f32(1.0)); + SubnetMovingPrice::::insert(n2, i96f32(1.0)); + MinerBurned::::insert(n1, U96F32::saturating_from_num(1.0)); + MinerBurned::::insert(n2, U96F32::saturating_from_num(1.0)); + + let shares = SubtensorModule::get_shares(&[n1, n2]); + assert_abs_diff_eq!(shares[&n1].to_num::(), 0.5, epsilon = 1e-9); + assert_abs_diff_eq!(shares[&n2].to_num::(), 0.5, epsilon = 1e-9); + }); } /// Empty candidate set: no panic, empty map, bar stays unset. diff --git a/website/apps/bittensor-website/public/catalog/emission-snapshot.json b/website/apps/bittensor-website/public/catalog/emission-snapshot.json index 680c5a28cd..62460d197c 100644 --- a/website/apps/bittensor-website/public/catalog/emission-snapshot.json +++ b/website/apps/bittensor-website/public/catalog/emission-snapshot.json @@ -1,8 +1,8 @@ { - "fetchedAt": "2026-08-10T19:50:58.619291Z", + "fetchedAt": "2026-08-11T16:37:11.729288Z", "network": "finney", "chainSpecVersion": 443, - "emissionMode": "v444_price_ema_hill_gate", + "emissionMode": "price_ema_miner_burn_hill_gate", "emissionGateSource": "v444_defaults_recomputed", "dataSource": { "subnets": "taomarketcap.com", @@ -10,835 +10,988 @@ "tmcEndpoint": "https://api.taomarketcap.com/public/v1/subnets/" }, "blockEmissionTao": 0.5, - "totalIssuanceTao": 11219409.114, - "totalIssuanceRao": 11219409114200811, - "rootTao": 5413546.52, - "emaPriceSum": 1.3084, + "totalIssuanceTao": 11222524.602, + "totalIssuanceRao": 11222524602355523, + "rootTao": 5411665.86, + "emaPriceSum": 1.3036, "rootDividendGateOpen": true, "taoWeight": 0.18, "emissionGateRank": 32, "emissionGateQuantile": 0.61, "emissionGateExponent": 3.0, - "emissionGateBar": 0.00733118, + "emissionGateBar": 0.00794042, "emissionInputs": [ { "netuid": 1, - "emaPrice": 0.008054, + "emaPrice": 0.008041, + "minerBurned": 0.52743466, "emissionEnabled": true }, { "netuid": 2, - "emaPrice": 0.004216, + "emaPrice": 0.004181, + "minerBurned": 0.82661404, "emissionEnabled": true }, { "netuid": 3, - "emaPrice": 0.02563, + "emaPrice": 0.025466, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 4, - "emaPrice": 0.057038, + "emaPrice": 0.056618, + "minerBurned": 0.07230859, "emissionEnabled": true }, { "netuid": 5, - "emaPrice": 0.013702, + "emaPrice": 0.013659, + "minerBurned": 0.42237093, "emissionEnabled": true }, { "netuid": 6, - "emaPrice": 0.002964, + "emaPrice": 0.003066, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 7, - "emaPrice": 0.003321, + "emaPrice": 0.003367, + "minerBurned": 0.90417399, "emissionEnabled": true }, { "netuid": 8, - "emaPrice": 0.029832, + "emaPrice": 0.029893, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 9, - "emaPrice": 0.033401, + "emaPrice": 0.033205, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 10, - "emaPrice": 0.006398, + "emaPrice": 0.006447, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 11, - "emaPrice": 0.007657, + "emaPrice": 0.007319, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 12, - "emaPrice": 0.004999, + "emaPrice": 0.004997, + "minerBurned": 0.99407092, "emissionEnabled": false }, { "netuid": 13, - "emaPrice": 0.006294, + "emaPrice": 0.006284, + "minerBurned": 0.70894014, "emissionEnabled": true }, { "netuid": 14, - "emaPrice": 0.010195, + "emaPrice": 0.010257, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 15, - "emaPrice": 0.021038, + "emaPrice": 0.022328, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 16, - "emaPrice": 0.003094, + "emaPrice": 0.002972, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 17, - "emaPrice": 0.009592, + "emaPrice": 0.009435, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 18, - "emaPrice": 0.00515, + "emaPrice": 0.005063, + "minerBurned": 0.04716244, "emissionEnabled": true }, { "netuid": 19, - "emaPrice": 0.010228, + "emaPrice": 0.010212, + "minerBurned": 0.38279278, "emissionEnabled": true }, { "netuid": 20, - "emaPrice": 0.002892, + "emaPrice": 0.002888, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 21, - "emaPrice": 0.003186, + "emaPrice": 0.00317, + "minerBurned": 0.45150375, "emissionEnabled": true }, { "netuid": 22, - "emaPrice": 0.003353, + "emaPrice": 0.003352, + "minerBurned": 0.52455545, "emissionEnabled": true }, { "netuid": 23, - "emaPrice": 0.004562, + "emaPrice": 0.00455, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 24, - "emaPrice": 0.004405, + "emaPrice": 0.004442, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 25, - "emaPrice": 0.010332, + "emaPrice": 0.010057, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 26, - "emaPrice": 0.004317, + "emaPrice": 0.004172, + "minerBurned": 0.5016723, "emissionEnabled": false }, { "netuid": 27, - "emaPrice": 0.002477, + "emaPrice": 0.002441, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 28, - "emaPrice": 0.016706, + "emaPrice": 0.016987, + "minerBurned": 0.10477993, "emissionEnabled": true }, { "netuid": 29, "emaPrice": 0.003131, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 30, - "emaPrice": 0.004021, + "emaPrice": 0.004025, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 31, - "emaPrice": 0.005064, + "emaPrice": 0.004764, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 32, - "emaPrice": 0.003187, + "emaPrice": 0.003171, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 33, - "emaPrice": 0.005635, + "emaPrice": 0.005672, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 34, "emaPrice": 0.012238, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 35, - "emaPrice": 0.002785, + "emaPrice": 0.002724, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 36, - "emaPrice": 0.00167, + "emaPrice": 0.001521, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 37, - "emaPrice": 0.003596, + "emaPrice": 0.00366, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 38, - "emaPrice": 0.011619, + "emaPrice": 0.011583, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 39, - "emaPrice": 0.006459, + "emaPrice": 0.006456, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 40, - "emaPrice": 0.006692, + "emaPrice": 0.006581, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 41, - "emaPrice": 0.005026, + "emaPrice": 0.005016, + "minerBurned": 0.72833058, "emissionEnabled": true }, { "netuid": 42, - "emaPrice": 0.002774, + "emaPrice": 0.002767, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 43, - "emaPrice": 0.005369, + "emaPrice": 0.005353, + "minerBurned": 0.79643628, "emissionEnabled": false }, { "netuid": 44, - "emaPrice": 0.042633, + "emaPrice": 0.041827, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 45, - "emaPrice": 0.002634, + "emaPrice": 0.002625, + "minerBurned": 0.68900336, "emissionEnabled": false }, { "netuid": 46, - "emaPrice": 0.004547, + "emaPrice": 0.004772, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 47, - "emaPrice": 0.002858, + "emaPrice": 0.002951, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 48, - "emaPrice": 0.004478, + "emaPrice": 0.004481, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 49, - "emaPrice": 0.007034, + "emaPrice": 0.00701, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 50, - "emaPrice": 0.004823, + "emaPrice": 0.004831, + "minerBurned": 1.08e-06, "emissionEnabled": true }, { "netuid": 51, - "emaPrice": 0.073255, + "emaPrice": 0.073811, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 52, - "emaPrice": 0.00678, + "emaPrice": 0.00676, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 53, - "emaPrice": 0.03318, + "emaPrice": 0.031652, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 54, - "emaPrice": 0.004743, + "emaPrice": 0.004638, + "minerBurned": 0.30939764, "emissionEnabled": true }, { "netuid": 55, - "emaPrice": 0.002857, + "emaPrice": 0.002796, + "minerBurned": 0.02000552, "emissionEnabled": true }, { "netuid": 56, - "emaPrice": 0.016981, + "emaPrice": 0.017013, + "minerBurned": 0.72379724, "emissionEnabled": true }, { "netuid": 57, - "emaPrice": 0.005359, + "emaPrice": 0.005288, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 58, - "emaPrice": 0.008788, + "emaPrice": 0.008798, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 59, - "emaPrice": 0.002019, + "emaPrice": 0.001975, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 60, - "emaPrice": 0.004075, + "emaPrice": 0.003998, + "minerBurned": 0.5, "emissionEnabled": true }, { "netuid": 61, - "emaPrice": 0.008461, + "emaPrice": 0.008466, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 62, - "emaPrice": 0.012264, + "emaPrice": 0.012144, + "minerBurned": 0.13338149, "emissionEnabled": true }, { "netuid": 63, - "emaPrice": 0.008203, + "emaPrice": 0.008208, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 64, - "emaPrice": 0.086481, + "emaPrice": 0.086255, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 65, - "emaPrice": 0.002534, + "emaPrice": 0.00251, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 66, - "emaPrice": 0.003033, + "emaPrice": 0.002983, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 67, - "emaPrice": 0.006518, + "emaPrice": 0.006471, + "minerBurned": 0.03652611, "emissionEnabled": true }, { "netuid": 68, - "emaPrice": 0.024419, + "emaPrice": 0.024017, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 69, - "emaPrice": 0.009912, + "emaPrice": 0.009892, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 70, - "emaPrice": 0.001371, + "emaPrice": 0.00134, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 71, - "emaPrice": 0.003849, + "emaPrice": 0.0038, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 72, - "emaPrice": 0.002701, + "emaPrice": 0.002626, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 73, - "emaPrice": 0.003274, + "emaPrice": 0.003278, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 74, - "emaPrice": 0.003809, + "emaPrice": 0.003794, + "minerBurned": 0.62999936, "emissionEnabled": true }, { "netuid": 75, - "emaPrice": 0.019342, + "emaPrice": 0.018814, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 76, - "emaPrice": 0.002632, + "emaPrice": 0.00261, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 77, - "emaPrice": 0.006135, + "emaPrice": 0.00612, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 78, - "emaPrice": 0.002605, + "emaPrice": 0.002534, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 79, - "emaPrice": 0.007527, + "emaPrice": 0.007579, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 80, - "emaPrice": 0.014918, + "emaPrice": 0.014729, + "minerBurned": 0.90650646, "emissionEnabled": true }, { "netuid": 81, - "emaPrice": 0.007893, + "emaPrice": 0.007889, + "minerBurned": 0.01844684, "emissionEnabled": true }, { "netuid": 82, - "emaPrice": 0.004499, + "emaPrice": 0.004648, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 83, - "emaPrice": 0.010613, + "emaPrice": 0.010587, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 84, - "emaPrice": 0.002521, + "emaPrice": 0.002544, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 85, - "emaPrice": 0.005342, + "emaPrice": 0.005324, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 87, - "emaPrice": 0.003704, + "emaPrice": 0.00365, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 88, - "emaPrice": 0.004539, + "emaPrice": 0.005168, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 89, - "emaPrice": 0.003664, + "emaPrice": 0.003655, + "minerBurned": 0.2, "emissionEnabled": true }, { "netuid": 90, - "emaPrice": 0.025303, + "emaPrice": 0.025993, + "minerBurned": 0.86008526, "emissionEnabled": false }, { "netuid": 91, - "emaPrice": 0.009309, + "emaPrice": 0.009029, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 92, - "emaPrice": 0.003914, + "emaPrice": 0.003814, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 93, - "emaPrice": 0.00976, + "emaPrice": 0.009616, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 94, - "emaPrice": 0.00375, + "emaPrice": 0.003652, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 95, - "emaPrice": 0.057053, + "emaPrice": 0.057009, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 96, - "emaPrice": 0.008541, + "emaPrice": 0.008529, + "minerBurned": 0.41741, "emissionEnabled": true }, { "netuid": 97, - "emaPrice": 0.025306, + "emaPrice": 0.024897, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 98, - "emaPrice": 0.002965, + "emaPrice": 0.002966, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 99, - "emaPrice": 0.004781, + "emaPrice": 0.004726, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 100, - "emaPrice": 0.005732, + "emaPrice": 0.006412, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 101, - "emaPrice": 0.004636, + "emaPrice": 0.004631, + "minerBurned": 0.90102437, "emissionEnabled": true }, { "netuid": 102, - "emaPrice": 0.008691, + "emaPrice": 0.00926, + "minerBurned": 0.25060051, "emissionEnabled": true }, { "netuid": 103, - "emaPrice": 0.009532, + "emaPrice": 0.009905, + "minerBurned": 0.0, "emissionEnabled": false }, { "netuid": 104, - "emaPrice": 0.004384, + "emaPrice": 0.004367, + "minerBurned": 0.9639356, "emissionEnabled": false }, { "netuid": 105, - "emaPrice": 0.007274, + "emaPrice": 0.007393, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 106, - "emaPrice": 0.003108, + "emaPrice": 0.003041, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 107, - "emaPrice": 0.06158, + "emaPrice": 0.060843, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 108, - "emaPrice": 0.004023, + "emaPrice": 0.003638, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 109, - "emaPrice": 0.003304, + "emaPrice": 0.003345, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 110, - "emaPrice": 0.00737, + "emaPrice": 0.007125, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 111, - "emaPrice": 0.004958, + "emaPrice": 0.00529, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 112, - "emaPrice": 0.002535, + "emaPrice": 0.002502, + "minerBurned": 0.80094412, "emissionEnabled": true }, { "netuid": 113, - "emaPrice": 0.00273, + "emaPrice": 0.002727, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 114, - "emaPrice": 0.011642, + "emaPrice": 0.011322, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 115, - "emaPrice": 0.003533, + "emaPrice": 0.003086, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 116, - "emaPrice": 0.007126, + "emaPrice": 0.006622, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 117, - "emaPrice": 0.002574, + "emaPrice": 0.002566, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 118, - "emaPrice": 0.009272, + "emaPrice": 0.009178, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 119, "emaPrice": 0.003091, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 120, - "emaPrice": 0.059987, + "emaPrice": 0.060463, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 121, - "emaPrice": 0.004739, + "emaPrice": 0.004741, + "minerBurned": 1.0, "emissionEnabled": true }, { "netuid": 122, - "emaPrice": 0.004685, + "emaPrice": 0.004615, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 123, - "emaPrice": 0.002703, + "emaPrice": 0.002672, + "minerBurned": 0.41245638, "emissionEnabled": true }, { "netuid": 124, - "emaPrice": 0.010121, + "emaPrice": 0.010072, + "minerBurned": 0.0, "emissionEnabled": true }, { "netuid": 125, - "emaPrice": 0.00328, + "emaPrice": 0.003267, + "minerBurned": 1.0, "emissionEnabled": false }, { "netuid": 126, - "emaPrice": 0.005165, + "emaPrice": 0.005009, + "minerBurned": 0.3047695, "emissionEnabled": true }, { "netuid": 127, - "emaPrice": 0.002883, + "emaPrice": 0.002904, + "minerBurned": 0.70639378, "emissionEnabled": true }, { "netuid": 128, - "emaPrice": 0.002938, + "emaPrice": 0.002916, + "minerBurned": 0.0, "emissionEnabled": false } ], "featuredSubnet": { "netuid": 4, "name": "Targon", - "spotPrice": 0.056784, - "emaPrice": 0.057038, + "spotPrice": 0.056624, + "emaPrice": 0.056618, + "minerBurned": 0.07230859, "emissionEnabled": true, - "taoIn": 136777.6, - "alphaIn": 2408742.63, - "alphaOut": 3498348.62, - "demandShare": 0.04359424, - "gateFactor": 0.99526659, - "taoShare": 0.07641434, - "taoPerBlock": 0.03820717 + "taoIn": 136634.82, + "alphaIn": 2413022.19, + "alphaOut": 3501181.98, + "demandShare": 0.04343117, + "burnAdjustedShare": 0.05698358, + "gateFactor": 0.99730159, + "taoShare": 0.07542274, + "taoPerBlock": 0.03771137 }, "topSubnets": [ { "netuid": 64, "name": "Chutes", - "spotPrice": 0.085869, - "emaPrice": 0.086481, + "spotPrice": 0.085763, + "emaPrice": 0.086255, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 220039.08, - "alphaIn": 2562495.19, - "alphaOut": 3327621.07, - "demandShare": 0.06609757, - "gateFactor": 0.99863738, - "taoShare": 0.11625179, - "taoPerBlock": 0.0581259 + "taoIn": 219979.27, + "alphaIn": 2564964.24, + "alphaOut": 3332267.14, + "demandShare": 0.06616545, + "burnAdjustedShare": 0.09357848, + "gateFactor": 0.99938943, + "taoShare": 0.12411856, + "taoPerBlock": 0.06205928 }, { "netuid": 51, "name": "lium.io", - "spotPrice": 0.073558, - "emaPrice": 0.073255, + "spotPrice": 0.074515, + "emaPrice": 0.073811, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 140987.41, - "alphaIn": 1916689.46, - "alphaOut": 3668935.54, - "demandShare": 0.05598891, - "gateFactor": 0.99776003, - "taoShare": 0.09838627, - "taoPerBlock": 0.04919314 + "taoIn": 141970.5, + "alphaIn": 1905258.42, + "alphaOut": 3687515.95, + "demandShare": 0.05661977, + "burnAdjustedShare": 0.08007792, + "gateFactor": 0.99902598, + "taoShare": 0.10617336, + "taoPerBlock": 0.05308668 }, { "netuid": 107, "name": "Minos", - "spotPrice": 0.061349, - "emaPrice": 0.06158, + "spotPrice": 0.060403, + "emaPrice": 0.060843, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 19184.4, - "alphaIn": 312709.51, - "alphaOut": 1406061.78, - "demandShare": 0.04706569, - "gateFactor": 0.99623495, - "taoShare": 0.08257957, - "taoPerBlock": 0.04128978 + "taoIn": 19172.35, + "alphaIn": 317408.35, + "alphaOut": 1409812.54, + "demandShare": 0.04667213, + "burnAdjustedShare": 0.06600887, + "gateFactor": 0.99826233, + "taoShare": 0.08745266, + "taoPerBlock": 0.04372633 }, { "netuid": 120, "name": "Affine", - "spotPrice": 0.060743, - "emaPrice": 0.059987, + "spotPrice": 0.059335, + "emaPrice": 0.060463, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 84377.64, - "alphaIn": 1389096.16, - "alphaOut": 2556991.84, - "demandShare": 0.04584816, - "gateFactor": 0.99592822, - "taoShare": 0.08041856, - "taoPerBlock": 0.04020928 + "taoIn": 83468.17, + "alphaIn": 1406725.51, + "alphaOut": 2546641.18, + "demandShare": 0.04638063, + "burnAdjustedShare": 0.06559661, + "gateFactor": 0.99822942, + "taoShare": 0.0869036, + "taoPerBlock": 0.0434518 }, { "netuid": 4, "name": "Targon", - "spotPrice": 0.056784, - "emaPrice": 0.057038, + "spotPrice": 0.056624, + "emaPrice": 0.056618, + "minerBurned": 0.07230859, "emissionEnabled": true, - "taoIn": 136777.6, - "alphaIn": 2408742.63, - "alphaOut": 3498348.62, - "demandShare": 0.04359424, - "gateFactor": 0.99526659, - "taoShare": 0.07641434, - "taoPerBlock": 0.03820717 + "taoIn": 136634.82, + "alphaIn": 2413022.19, + "alphaOut": 3501181.98, + "demandShare": 0.04343117, + "burnAdjustedShare": 0.05698358, + "gateFactor": 0.99730159, + "taoShare": 0.07542274, + "taoPerBlock": 0.03771137 }, { "netuid": 44, "name": "Score", - "spotPrice": 0.042135, - "emaPrice": 0.042633, - "emissionEnabled": true, - "taoIn": 69596.55, - "alphaIn": 1651741.69, - "alphaOut": 3998290.27, - "demandShare": 0.03258447, - "gateFactor": 0.98873914, - "taoShare": 0.05674123, - "taoPerBlock": 0.02837062 - }, - { - "netuid": 9, - "name": "iota", - "spotPrice": 0.03345, - "emaPrice": 0.033401, + "spotPrice": 0.042201, + "emaPrice": 0.041827, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 60926.17, - "alphaIn": 1821422.27, - "alphaOut": 3951121.46, - "demandShare": 0.02552844, - "gateFactor": 0.97686426, - "taoShare": 0.04392025, - "taoPerBlock": 0.02196013 + "taoIn": 69689.46, + "alphaIn": 1651357.73, + "alphaOut": 4005821.33, + "demandShare": 0.03208512, + "burnAdjustedShare": 0.04537832, + "gateFactor": 0.99467077, + "taoShare": 0.05990372, + "taoPerBlock": 0.02995186 }, { "netuid": 53, "name": "engy", - "spotPrice": 0.032, - "emaPrice": 0.03318, + "spotPrice": 0.033562, + "emaPrice": 0.031652, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 35107.27, - "alphaIn": 1097096.66, - "alphaOut": 4580364.57, - "demandShare": 0.02535953, - "gateFactor": 0.97640986, - "taoShare": 0.04360936, - "taoPerBlock": 0.02180468 + "taoIn": 35983.37, + "alphaIn": 1072141.54, + "alphaOut": 4612463.02, + "demandShare": 0.02427997, + "burnAdjustedShare": 0.03433941, + "gateFactor": 0.9877872, + "taoShare": 0.04501759, + "taoPerBlock": 0.0225088 }, { "netuid": 8, "name": "Vanta", - "spotPrice": 0.029842, - "emaPrice": 0.029832, + "spotPrice": 0.029939, + "emaPrice": 0.029893, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 81218.94, - "alphaIn": 2721615.73, - "alphaOut": 3019607.15, - "demandShare": 0.02280065, - "gateFactor": 0.96782796, - "taoShare": 0.03886437, - "taoPerBlock": 0.01943219 + "taoIn": 81377.2, + "alphaIn": 2718128.48, + "alphaOut": 3030229.05, + "demandShare": 0.02293066, + "burnAdjustedShare": 0.03243107, + "gateFactor": 0.98553499, + "taoShare": 0.04241889, + "taoPerBlock": 0.02120944 }, { "netuid": 3, "name": "deprecated", - "spotPrice": 0.025426, - "emaPrice": 0.02563, + "spotPrice": 0.025225, + "emaPrice": 0.025466, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 74149.25, - "alphaIn": 2916243.4, - "alphaOut": 2819141.61, - "demandShare": 0.01958905, - "gateFactor": 0.95019266, - "taoShare": 0.0327817, - "taoPerBlock": 0.01639085 + "taoIn": 73878.81, + "alphaIn": 2928735.47, + "alphaOut": 2813772.82, + "demandShare": 0.01953474, + "burnAdjustedShare": 0.02762819, + "gateFactor": 0.97681092, + "taoShare": 0.03581698, + "taoPerBlock": 0.01790849 }, { "netuid": 97, "name": "Albedo", - "spotPrice": 0.024872, - "emaPrice": 0.025306, + "spotPrice": 0.024758, + "emaPrice": 0.024897, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 11057.13, - "alphaIn": 444567.2, - "alphaOut": 932144.63, - "demandShare": 0.01934142, - "gateFactor": 0.94835504, - "taoShare": 0.03230469, - "taoPerBlock": 0.01615235 + "taoIn": 11095.78, + "alphaIn": 448165.46, + "alphaOut": 936842.91, + "demandShare": 0.01909827, + "burnAdjustedShare": 0.02701088, + "gateFactor": 0.9752247, + "taoShare": 0.03495984, + "taoPerBlock": 0.01747992 }, { "netuid": 68, "name": "NOVA", - "spotPrice": 0.02442, - "emaPrice": 0.024419, + "spotPrice": 0.023941, + "emaPrice": 0.024017, + "minerBurned": 0.0, + "emissionEnabled": true, + "taoIn": 45722.1, + "alphaIn": 1909747.31, + "alphaOut": 3596531.4, + "demandShare": 0.01842323, + "burnAdjustedShare": 0.02605616, + "gateFactor": 0.97247808, + "taoShare": 0.03362918, + "taoPerBlock": 0.01681459 + }, + { + "netuid": 15, + "name": "ORO", + "spotPrice": 0.02277, + "emaPrice": 0.022328, + "minerBurned": 0.0, "emissionEnabled": true, - "taoIn": 46153.92, - "alphaIn": 1890019.99, - "alphaOut": 3609349.49, - "demandShare": 0.01866348, - "gateFactor": 0.94285369, - "taoShare": 0.03099155, - "taoPerBlock": 0.01549578 + "taoIn": 10754.4, + "alphaIn": 472315.91, + "alphaOut": 1283562.57, + "demandShare": 0.01712761, + "burnAdjustedShare": 0.02422376, + "gateFactor": 0.965977, + "taoShare": 0.0310552, + "taoPerBlock": 0.0155276 } ] } diff --git a/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py b/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py index 502703e4ca..538e5bb747 100644 --- a/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py +++ b/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py @@ -1,12 +1,12 @@ """Refresh public/catalog/emission-snapshot.json from TaoMarketCap + Finney. Subnet prices and EMA sums use TMC's public API. Eligibility, emission-enabled -flags, total issuance, and root pool TAO come from Finney storage. The output -models the v444 pure-price EMA allocation and Hill gate. On spec 444 or later, -the gate settings and cadence-held midpoint come from chain storage. Before the -upgrade, the output previews the first v444 calculation with the upgrade -defaults. It does not use the deprecated ``BlockEmission`` or ``MinerBurned`` -storage items. +flags, MinerBurned proportions, total issuance, and root pool TAO come from +Finney storage. The output models price EMA with miner-burn scaling and the +Hill gate. On spec 444 or later, the gate settings and cadence-held midpoint +come from chain storage. Before the upgrade, the output previews the v444 gate +settings while retaining miner-burn scaling. It does not use the deprecated +``BlockEmission`` storage item. Usage (from bittensor-website/, with the bittensor SDK venv active): @@ -47,6 +47,15 @@ def fixed_u64f64_num(value) -> float: return float(value) +def fixed_u96f32_num(value) -> float: + """Convert the SDK's U96F32 representation to a float.""" + if isinstance(value, dict) and "bits" in value: + return int(value["bits"]) / 2**32 + if isinstance(value, int): + return value / 2**32 + return float(value) + + def tmc_num(val) -> float: if val is None: return 0.0 @@ -99,7 +108,7 @@ def subnet_name(row: dict) -> str: return identities.get("subnetName") or f"SN{row['netuid']}" -def row_from_tmc(row: dict, emission_enabled: bool) -> dict: +def row_from_tmc(row: dict, emission_enabled: bool, miner_burned: float) -> dict: snap = row.get("latest_snapshot") or {} netuid = int(row["netuid"]) spot = tmc_num(snap.get("price")) @@ -112,6 +121,7 @@ def row_from_tmc(row: dict, emission_enabled: bool) -> dict: "name": subnet_name(row), "spotPrice": round(spot, 6), "emaPrice": round(ema, 6), + "minerBurned": round(min(max(miner_burned, 0.0), 1.0), 8), "emissionEnabled": emission_enabled, "taoIn": round(tao_in, 2), "alphaIn": round(alpha_in, 2), @@ -140,17 +150,19 @@ async def chain_fields(client: bt.Client, netuids: list[int]) -> dict: root_tao = int(await view.query(st.SubtensorModule.SubnetTAO, [0])) tao_weight_raw = int(await view.query(st.SubtensorModule.TaoWeight)) - async def subnet_flags(netuid: int) -> tuple[int, dict[str, bool]]: + async def subnet_flags(netuid: int) -> tuple[int, dict[str, bool | float]]: ( first_emission, subtoken_enabled, registration_allowed, emission_enabled, + miner_burned, ) = await asyncio.gather( view.query(st.SubtensorModule.FirstEmissionBlockNumber, [netuid]), view.query(st.SubtensorModule.SubtokenEnabled, [netuid]), view.query(st.SubtensorModule.NetworkRegistrationAllowed, [netuid]), view.query(st.SubtensorModule.SubnetEmissionEnabled, [netuid]), + view.query(st.SubtensorModule.MinerBurned, [netuid]), ) return netuid, { "eligible": ( @@ -159,6 +171,7 @@ async def subnet_flags(netuid: int) -> tuple[int, dict[str, bool]]: and bool(registration_allowed) ), "emissionEnabled": bool(emission_enabled), + "minerBurned": fixed_u96f32_num(miner_burned), } flags = dict(await asyncio.gather(*(subnet_flags(netuid) for netuid in netuids))) @@ -219,18 +232,28 @@ def apply_shares( gate_bar: float | None = None, gate_exponent: float = DEFAULT_EMISSION_GATE_EXPONENT, ) -> float: - """Apply v444 pure-price demand shares, the Hill gate, and enable flags.""" + """Apply price shares, miner-burn scaling, the Hill gate, and enable flags.""" price_sum = sum(max(subnet["emaPrice"], 0.0) for subnet in subnets) demand_shares = [ max(subnet["emaPrice"], 0.0) / price_sum if price_sum > 0 else 0.0 for subnet in subnets ] + burn_weights = [ + share * (1.0 - min(max(subnet["minerBurned"], 0.0), 1.0)) + for subnet, share in zip(subnets, demand_shares) + ] + burn_weight_sum = sum(burn_weights) + burn_adjusted_shares = ( + [weight / burn_weight_sum for weight in burn_weights] + if burn_weight_sum > 0 + else demand_shares + ) if gate_bar is None: - gate_bar = select_emission_gate_bar(demand_shares) + gate_bar = select_emission_gate_bar(burn_adjusted_shares) gate_factors = [] gated_weights = [] - for share in demand_shares: + for share in burn_adjusted_shares: gate = ( 1.0 / (1.0 + (gate_bar / share) ** gate_exponent) if share > 0 and gate_bar > 0 @@ -240,15 +263,15 @@ def apply_shares( gated_weights.append(share * gate) if sum(gated_weights) == 0: - gated_weights = demand_shares + gated_weights = burn_adjusted_shares enabled_total = sum( weight for subnet, weight in zip(subnets, gated_weights) if subnet["emissionEnabled"] ) - for subnet, demand_share, gate, weight in zip( - subnets, demand_shares, gate_factors, gated_weights + for subnet, demand_share, burn_adjusted_share, gate, weight in zip( + subnets, demand_shares, burn_adjusted_shares, gate_factors, gated_weights ): share = ( weight / enabled_total @@ -256,6 +279,7 @@ def apply_shares( else 0.0 ) subnet["demandShare"] = round(demand_share, 8) + subnet["burnAdjustedShare"] = round(burn_adjusted_share, 8) subnet["gateFactor"] = round(gate, 8) subnet["taoShare"] = round(share, 8) subnet["taoPerBlock"] = round(block_emission * share, 8) @@ -283,6 +307,7 @@ async def build_snapshot() -> dict: row_from_tmc( row, chain["subnetFlags"][int(row["netuid"])]["emissionEnabled"], + chain["subnetFlags"][int(row["netuid"])]["minerBurned"], ) for row in eligible_rows ] @@ -312,7 +337,7 @@ async def build_snapshot() -> dict: "fetchedAt": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"), "network": "finney", "chainSpecVersion": chain["specVersion"], - "emissionMode": "v444_price_ema_hill_gate", + "emissionMode": "price_ema_miner_burn_hill_gate", "emissionGateSource": gate["source"], "dataSource": { "subnets": "taomarketcap.com", @@ -334,6 +359,7 @@ async def build_snapshot() -> dict: { "netuid": subnet["netuid"], "emaPrice": subnet["emaPrice"], + "minerBurned": subnet["minerBurned"], "emissionEnabled": subnet["emissionEnabled"], } for subnet in subnets diff --git a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx index 019c139935..a8789d2792 100644 --- a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx +++ b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx @@ -25,10 +25,10 @@ const releases: Release[] = [ { tag: 'v444', date: 'August 2026', - title: 'Pure Price Emissions', + title: 'EVM, btcli, and Reliability', summary: - 'Subnet emission returns to pure price EMA through the gate. The release also completes ' + - 'the typed EVM surface, makes multisigs first-class btcli wallets, adds human-readable ' + + 'This release completes the typed EVM surface, makes multisigs first-class btcli wallets, ' + + 'recycles transaction fees, adds human-readable ' + 'Ledger orders, and lands a broad reliability pass.', href: '/releases/v444-upgrade', }, diff --git a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx index 089af21603..04435afcea 100644 --- a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx +++ b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx @@ -6,10 +6,9 @@ import {Suspense} from 'react'; import styles from '../v436-upgrade/page.module.css'; export const metadata: Metadata = { - title: 'The V444 Upgrade — Pure Price Emissions', + title: 'The V444 Upgrade — EVM, btcli, and Reliability', description: - 'Subnet emission returns to pure price EMA through the emission gate, while v444 ' + - 'completes the EVM surface, makes btcli safer for multisigs and automation, adds ' + + 'V444 completes the EVM surface, makes btcli safer for multisigs and automation, adds ' + 'human-readable Ledger orders, and lands a broad reliability pass.', alternates: {canonical: '/releases/v444-upgrade'}, }; @@ -27,85 +26,21 @@ const page = () => {

The V444 Upgrade

- Pure Price Emissions · August 2026 + EVM, btcli, and Reliability · August 2026

Introduction

- The market signal becomes simple again in spec 444: a subnet's - share of network emission is determined by its moving price, passed through the emission - gate. The share is no longer reduced when a subnet directs miner incentive to an owner - or burn hotkey. Recycling and burning still do exactly what the subnet chose locally; - they no longer change its standing against every other subnet. -

-

- The release also makes the chain substantially easier to use from every external - surface. Solidity contracts gain 31 functions across five new Bittensor precompiles, - plus 135 additions to existing interfaces. A saved multisig now behaves like a wallet - throughout btcli. Automated dry runs carry enough information to approve - and replay a transaction safely. Ledger users can read the actual fields of a limit - order before signing it. Underneath those interfaces, v444 corrects transaction-pool - validation, proxy charging, commitment cleanup, storage growth, and GRANDPA finality. -

-
- -
-

Price is the signal

-

- The emission gate introduced in v440{' '} - starts with each subnet's share of price EMA, then suppresses emission below the - market-set bar. A second factor had been applied before that gate:{' '} - 1 − MinerBurned. That meant two subnets with the same demand could receive - different cross-network emission solely because one withheld miner incentive for - recycling or burning. -

- -

- V444 removes that extra multiplier. The on-chain value remains as an informational - measure called MinerBurned. The miner-incentive path still recycles or - burns according to the subnet's configuration. What changes is the boundary between - local token policy and network allocation: demand determines how much emission a subnet - earns; the subnet determines what it does with the miner portion after that. -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Miner incentive policyEffect on subnet's network share in v444Local effect
Paid to minersPrice EMA through the gateMiner alpha is distributed
Withheld and recycledPrice EMA through the gateValue returns through the recycle path
Withheld and burnedPrice EMA through the gateValue is removed by the burn path
-

- Subnet teams do not need to change a setting. Forecasting software should remove the - miner-burn factor from cross-subnet share calculations and retain it only where it - describes the subnet's own incentive accounting. + Spec 444 makes the chain substantially easier to use from every + external surface. Solidity contracts gain 31 functions across five new Bittensor + precompiles, plus 135 additions to existing interfaces. A saved multisig now behaves + like a wallet throughout btcli. Automated dry runs carry enough information + to approve and replay a transaction safely. Ledger users can read the actual fields of a + limit order before signing it. Underneath those interfaces, v444 recycles transaction + fees and corrects transaction-pool validation, proxy charging, commitment cleanup, + storage growth, and GRANDPA finality.

@@ -378,11 +313,6 @@ partial fills , signer `}

What to do

    -
  • - Subnet teams and analysts: remove 1 − MinerBurned from - cross-subnet emission forecasts. The emission gate remains active and miner recycling - or burning remains a local policy. -
  • EVM integrators: refresh the complete canonical ABI set before using v444 selectors. Add 0x…080f through 0x…0813 only from the diff --git a/website/apps/bittensor-website/src/components/docs/emission-network-snapshot.tsx b/website/apps/bittensor-website/src/components/docs/emission-network-snapshot.tsx index 55fb849a0a..61364612d0 100644 --- a/website/apps/bittensor-website/src/components/docs/emission-network-snapshot.tsx +++ b/website/apps/bittensor-website/src/components/docs/emission-network-snapshot.tsx @@ -48,8 +48,8 @@ export function EmissionNetworkSnapshot() {

    This preview starts with each eligible subnet's{' '} SubnetMovingPrice (EMA of spot alpha price, - capped at 1.0), turns it into a share of the total, then applies the emission gate.{' '} - MinerBurned is not part of this cross-subnet allocation. Top modeled recipient:{' '} + capped at 1.0), scales it by 1 − MinerBurned, then applies the emission gate. + Top modeled recipient:{' '} SN{snapshot.topSubnets[0]?.netuid} {snapshot.topSubnets[0]?.name} {' '} diff --git a/website/apps/bittensor-website/src/components/docs/subnet-emission-share-chart.tsx b/website/apps/bittensor-website/src/components/docs/subnet-emission-share-chart.tsx index f6143e7915..b7e2008648 100644 --- a/website/apps/bittensor-website/src/components/docs/subnet-emission-share-chart.tsx +++ b/website/apps/bittensor-website/src/components/docs/subnet-emission-share-chart.tsx @@ -34,6 +34,7 @@ export function SubnetEmissionShareChart() { const {snapshot, loading} = useEmissionSnapshot(); const [selectedIdx, setSelectedIdx] = useState(2); const [whatIfEma, setWhatIfEma] = useState(null); + const [whatIfBurn, setWhatIfBurn] = useState(null); const rows = useMemo(() => snapshot.topSubnets.slice(0, 8), [snapshot.topSubnets]); const selected = rows[selectedIdx] ?? rows[0]; @@ -43,10 +44,13 @@ export function SubnetEmissionShareChart() { ...input, emaPrice: input.netuid === selected?.netuid && whatIfEma !== null ? whatIfEma : input.emaPrice, + minerBurned: + input.netuid === selected?.netuid && whatIfBurn !== null ? whatIfBurn : input.minerBurned, })); const result = subnetEmissionShares( inputs.map((input) => input.emaPrice), { + minerBurned: inputs.map((input) => input.minerBurned), emissionEnabled: inputs.map((input) => input.emissionEnabled), rank: snapshot.emissionGateRank, quantile: snapshot.emissionGateQuantile, @@ -56,8 +60,9 @@ export function SubnetEmissionShareChart() { ); const indexByNetuid = new Map(inputs.map((input, index) => [input.netuid, index])); const priceByNetuid = new Map(inputs.map((input) => [input.netuid, input.emaPrice])); - return {indexByNetuid, priceByNetuid, ...result}; - }, [selected?.netuid, snapshot, whatIfEma]); + const burnByNetuid = new Map(inputs.map((input) => [input.netuid, input.minerBurned])); + return {indexByNetuid, priceByNetuid, burnByNetuid, ...result}; + }, [selected?.netuid, snapshot, whatIfBurn, whatIfEma]); const shares = useMemo( () => rows.map((row) => { @@ -132,6 +137,7 @@ export function SubnetEmissionShareChart() { `${ctx.parsed.x.toFixed(1)}% of ${formatTao(blockEmission)}/block`, `${formatTao(tao, 4)}/block`, `Price EMA ${calculation.priceByNetuid.get(row.netuid)?.toFixed(4) ?? '0.0000'}`, + `MinerBurned ${formatPct(calculation.burnByNetuid.get(row.netuid) ?? 0)}`, ]; }, }, @@ -158,6 +164,7 @@ export function SubnetEmissionShareChart() { if (elements[0]) { setSelectedIdx(elements[0].index); setWhatIfEma(null); + setWhatIfBurn(null); } }, }), @@ -165,16 +172,17 @@ export function SubnetEmissionShareChart() { ); const displayEma = whatIfEma ?? selected?.emaPrice ?? 0; + const displayBurn = whatIfBurn ?? selected?.minerBurned ?? 0; const selectedInputIdx = selected ? calculation.indexByNetuid.get(selected.netuid) : undefined; - const selectedDemandShare = - selectedInputIdx === undefined ? 0 : calculation.demandShares[selectedInputIdx]; + const selectedBurnAdjustedShare = + selectedInputIdx === undefined ? 0 : calculation.burnAdjustedShares[selectedInputIdx]; const selectedGateFactor = selectedInputIdx === undefined ? 0 : calculation.gateFactors[selectedInputIdx]; return (

    {loading ? ( @@ -188,7 +196,7 @@ export function SubnetEmissionShareChart() { {selected && ( <> -
    +
    +
    -
    +
    setWhatIfEma(v)} /> + setWhatIfBurn(v)} + />
    )} diff --git a/website/apps/bittensor-website/src/lib/emission-math.ts b/website/apps/bittensor-website/src/lib/emission-math.ts index baea8d5e4f..18ad5d4924 100644 --- a/website/apps/bittensor-website/src/lib/emission-math.ts +++ b/website/apps/bittensor-website/src/lib/emission-math.ts @@ -47,6 +47,7 @@ export function halvingThresholdsTao(count = 8): number[] { export type SubnetEmissionResult = { demandShares: number[]; + burnAdjustedShares: number[]; gateFactors: number[]; shares: number[]; gateBar: number; @@ -70,10 +71,11 @@ export function selectEmissionGateBar( return positive[positive.length - 1]; } -/** v444 `get_shares` plus emission-enabled redistribution in subnet_emissions.rs */ +/** `get_shares` plus emission-enabled redistribution in subnet_emissions.rs */ export function subnetEmissionShares( prices: number[], options: { + minerBurned?: number[]; emissionEnabled?: boolean[]; rank?: number; quantile?: number; @@ -84,18 +86,25 @@ export function subnetEmissionShares( const safePrices = prices.map((price) => Math.max(price, 0)); const priceSum = safePrices.reduce((sum, price) => sum + price, 0); const demandShares = safePrices.map((price) => (priceSum > 0 ? price / priceSum : 0)); + const minerBurned = options.minerBurned ?? prices.map(() => 0); + const burnWeights = demandShares.map( + (share, index) => share * (1 - Math.min(Math.max(minerBurned[index] ?? 0, 0), 1)), + ); + const burnWeightSum = burnWeights.reduce((sum, weight) => sum + weight, 0); + const burnAdjustedShares = + burnWeightSum > 0 ? burnWeights.map((weight) => weight / burnWeightSum) : demandShares; const gateBar = - options.gateBar ?? selectEmissionGateBar(demandShares, options.rank, options.quantile); + options.gateBar ?? selectEmissionGateBar(burnAdjustedShares, options.rank, options.quantile); const exponent = options.exponent ?? DEFAULT_EMISSION_GATE_EXPONENT; - const gateFactors = demandShares.map((share) => { + const gateFactors = burnAdjustedShares.map((share) => { if (share <= 0) return 0; if (gateBar <= 0) return 1; return 1 / (1 + (gateBar / share) ** exponent); }); - let gatedWeights = demandShares.map((share, index) => share * gateFactors[index]); + let gatedWeights = burnAdjustedShares.map((share, index) => share * gateFactors[index]); if (gatedWeights.reduce((sum, weight) => sum + weight, 0) === 0) { - gatedWeights = demandShares; + gatedWeights = burnAdjustedShares; } const emissionEnabled = options.emissionEnabled ?? prices.map(() => true); @@ -107,7 +116,7 @@ export function subnetEmissionShares( emissionEnabled[index] !== false && enabledTotal > 0 ? weight / enabledTotal : 0, ); - return {demandShares, gateFactors, shares, gateBar}; + return {demandShares, burnAdjustedShares, gateFactors, shares, gateBar}; } /** `update_moving_price` smoothing factor in stake_utils.rs */ diff --git a/website/apps/bittensor-website/src/lib/emission-snapshot.ts b/website/apps/bittensor-website/src/lib/emission-snapshot.ts index 53abdb2b74..cd1d172fdd 100644 --- a/website/apps/bittensor-website/src/lib/emission-snapshot.ts +++ b/website/apps/bittensor-website/src/lib/emission-snapshot.ts @@ -6,11 +6,13 @@ export type SubnetEmissionRow = { name: string; spotPrice: number; emaPrice: number; + minerBurned: number; emissionEnabled: boolean; taoIn: number; alphaIn: number; alphaOut: number; demandShare: number; + burnAdjustedShare: number; gateFactor: number; taoShare: number; taoPerBlock: number; @@ -19,6 +21,7 @@ export type SubnetEmissionRow = { export type EmissionInput = { netuid: number; emaPrice: number; + minerBurned: number; emissionEnabled: boolean; }; @@ -26,7 +29,7 @@ export type EmissionSnapshot = { fetchedAt: string; network: string; chainSpecVersion: number; - emissionMode: 'v444_price_ema_hill_gate' | string; + emissionMode: 'price_ema_miner_burn_hill_gate' | string; emissionGateSource: 'chain_storage' | 'v444_defaults_recomputed'; blockEmissionTao: number; totalIssuanceTao: number; From cf4240219377de035fdfdd8275e999c0f94c0762 Mon Sep 17 00:00:00 2001 From: UnArbosSix Date: Tue, 11 Aug 2026 09:58:39 -0700 Subject: [PATCH 02/14] Refactor miner-burn share scaling --- .../src/coinbase/subnet_emissions.rs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pallets/subtensor/src/coinbase/subnet_emissions.rs b/pallets/subtensor/src/coinbase/subnet_emissions.rs index 618614a86e..f98c23f3fc 100644 --- a/pallets/subtensor/src/coinbase/subnet_emissions.rs +++ b/pallets/subtensor/src/coinbase/subnet_emissions.rs @@ -353,9 +353,19 @@ impl Pallet { // enabled subnets in `get_subnet_block_emissions`. pub(crate) fn get_shares(subnets_to_emit_to: &[NetUid]) -> BTreeMap { let price_shares = Self::get_shares_price_ema(subnets_to_emit_to); + let mut shares = Self::scale_price_shares_by_miner_burn(price_shares); - // Reallocate emission away from subnets that withhold miner emission. - // The effective pre-gate weight is price_i * (1 - miner_burned_i). + Self::maybe_update_emission_gate_bar(&shares); + Self::apply_emission_gate(&mut shares); + shares + } + + /// Scales normalized EMA-price shares by `(1 - MinerBurned)` and + /// renormalizes them. If every resulting weight is zero, returns the + /// original price shares so emission is not stranded. + fn scale_price_shares_by_miner_burn( + price_shares: BTreeMap, + ) -> BTreeMap { let zero = U64F64::saturating_from_num(0); let one = U64F64::saturating_from_num(1); let weighted: BTreeMap = price_shares @@ -373,20 +383,14 @@ impl Pallet { .copied() .fold(zero, |acc, weight| acc.saturating_add(weight)); - let mut shares = if total_weight > zero { + if total_weight > zero { weighted .into_iter() .map(|(netuid, weight)| (netuid, weight.safe_div(total_weight))) .collect() } else { - // If every weight is zero (for example, every eligible subnet has - // MinerBurned == 1), restore the price shares so emission is not stranded. price_shares - }; - - Self::maybe_update_emission_gate_bar(&shares); - Self::apply_emission_gate(&mut shares); - shares + } } /// Blocks between emission gate bar recomputations. Matching the standard From aec9c864823fe0c120c86787bcf329e953395722 Mon Sep 17 00:00:00 2001 From: UnArbosSix Date: Tue, 11 Aug 2026 12:06:20 -0700 Subject: [PATCH 03/14] bump spec and update docs --- docs/guides/evm/precompile-design.mdx | 6 ++--- docs/guides/evm/precompiles/registry.mdx | 4 +-- docs/migration.mdx | 2 +- runtime/src/lib.rs | 2 +- sdk/python/bittensor/_generated/calls.py | 2 +- sdk/python/bittensor/_generated/constants.py | 2 +- sdk/python/bittensor/_generated/errors.py | 2 +- .../bittensor/_generated/runtime_apis.py | 2 +- sdk/python/bittensor/_generated/storage.py | 2 +- .../public/catalog/emission-snapshot.json | 2 +- .../scripts/fetch-emission-snapshot.py | 10 +++---- .../(pages-without-footer)/releases/page.tsx | 4 +-- .../{v444-upgrade => v445-upgrade}/page.tsx | 26 +++++++++---------- .../src/lib/emission-snapshot.ts | 2 +- 14 files changed, 34 insertions(+), 34 deletions(-) rename website/apps/bittensor-website/src/app/(pages-without-footer)/releases/{v444-upgrade => v445-upgrade}/page.tsx (95%) diff --git a/docs/guides/evm/precompile-design.mdx b/docs/guides/evm/precompile-design.mdx index 570b57244e..fafba2ca1b 100644 --- a/docs/guides/evm/precompile-design.mdx +++ b/docs/guides/evm/precompile-design.mdx @@ -336,7 +336,7 @@ interface IPrecompileRegistry { } ``` -In v444, the fields have the following behavior: +In v445, the fields have the following behavior: | Field | Meaning | |---|---| @@ -346,7 +346,7 @@ In v444, the fields have the following behavior: | `newSelector` | Reserved; always `0x00000000`. | | `message` | Reserved; always empty. | -The `selector` parameter is also reserved and is not interpreted in v444. A +The `selector` parameter is also reserved and is not interpreted in v445. A response therefore does not prove that a selector exists or describe its lifecycle. Tooling must use the canonical Solidity interfaces and JSON ABIs to discover supported selectors. @@ -455,6 +455,6 @@ Precompiles are a long-lived contract between Subtensor and deployed EVM code. Keep addresses and released selectors stable, version functions additively, preserve old semantics whenever possible, and replace raw storage access with typed views that insulate callers from storage layouts. Use deprecation to guide -migration and reversible disablement to handle operational risk. The v444 +migration and reversible disablement to handle operational risk. The v445 registry reports whole-precompile disablement; function-level lifecycle status remains a future extension. diff --git a/docs/guides/evm/precompiles/registry.mdx b/docs/guides/evm/precompiles/registry.mdx index 68b9fb0513..d7166136d0 100644 --- a/docs/guides/evm/precompiles/registry.mdx +++ b/docs/guides/evm/precompiles/registry.mdx @@ -10,7 +10,7 @@ description: Registry for precompile availability. | Address | `0x0000000000000000000000000000000000000813` | | Status | Deployed | -In v444, the registry reports the current operational availability of a whole +In v445, the registry reports the current operational availability of a whole precompile through `isDisabled`. It does not report whether an individual selector exists, is deprecated, or has a replacement. @@ -35,7 +35,7 @@ interface IPrecompileRegistry { The `selector` parameter and the `isDeprecated`, `newPrecompile`, `newSelector`, and `message` result fields are reserved for future selector-lifecycle support. -In v444 those fields are not populated, and the selector is not interpreted. +In v445 those fields are not populated, and the selector is not interpreted. Do not use this call to test whether a selector is supported; use the canonical Solidity interfaces and JSON ABIs for selector discovery. diff --git a/docs/migration.mdx b/docs/migration.mdx index c147a98973..80ea04be70 100644 --- a/docs/migration.mdx +++ b/docs/migration.mdx @@ -513,7 +513,7 @@ if not result.success: The v11 package ships against a runtime that also changed behavior. These are not rename mappings — scripts that still "work" can fail or mis-account after the upgrade. See the release notes for -[V431](/releases/v431-upgrade) and [V444](/releases/v444-upgrade). +[V431](/releases/v431-upgrade) and [V445](/releases/v445-upgrade). ### Ownership and emissions diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 81cd941f2a..608621afaf 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -235,7 +235,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: 444, + spec_version: 445, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/sdk/python/bittensor/_generated/calls.py b/sdk/python/bittensor/_generated/calls.py index 0ac4793935..6003448427 100644 --- a/sdk/python/bittensor/_generated/calls.py +++ b/sdk/python/bittensor/_generated/calls.py @@ -1,7 +1,7 @@ """Generated from runtime metadata by codegen. DO NOT EDIT BY HAND. Regenerate with: python -m codegen -Spec version: 444 +Spec version: 445 """ from typing import Any, NamedTuple diff --git a/sdk/python/bittensor/_generated/constants.py b/sdk/python/bittensor/_generated/constants.py index 27276d9970..70c8ad6fd9 100644 --- a/sdk/python/bittensor/_generated/constants.py +++ b/sdk/python/bittensor/_generated/constants.py @@ -1,7 +1,7 @@ """Generated from runtime metadata by codegen. DO NOT EDIT BY HAND. Regenerate with: python -m codegen -Spec version: 444 +Spec version: 445 Pallet constant descriptors: unpack into substrate.constant. """ diff --git a/sdk/python/bittensor/_generated/errors.py b/sdk/python/bittensor/_generated/errors.py index 4417a3fe36..7bde2904e9 100644 --- a/sdk/python/bittensor/_generated/errors.py +++ b/sdk/python/bittensor/_generated/errors.py @@ -1,7 +1,7 @@ """Generated from runtime metadata by codegen. DO NOT EDIT BY HAND. Regenerate with: python -m codegen -Spec version: 444 +Spec version: 445 """ from dataclasses import dataclass diff --git a/sdk/python/bittensor/_generated/runtime_apis.py b/sdk/python/bittensor/_generated/runtime_apis.py index 0408cfabc3..835765baac 100644 --- a/sdk/python/bittensor/_generated/runtime_apis.py +++ b/sdk/python/bittensor/_generated/runtime_apis.py @@ -1,7 +1,7 @@ """Generated from runtime metadata by codegen. DO NOT EDIT BY HAND. Regenerate with: python -m codegen -Spec version: 444 +Spec version: 445 Runtime API method descriptors: unpack into substrate.runtime_call. """ diff --git a/sdk/python/bittensor/_generated/storage.py b/sdk/python/bittensor/_generated/storage.py index a38f662944..b823af6953 100644 --- a/sdk/python/bittensor/_generated/storage.py +++ b/sdk/python/bittensor/_generated/storage.py @@ -1,7 +1,7 @@ """Generated from runtime metadata by codegen. DO NOT EDIT BY HAND. Regenerate with: python -m codegen -Spec version: 444 +Spec version: 445 Storage item descriptors: unpack into substrate.query/query_map. Each carries its VALUE's type identity (value_type_ident) so normalization can key on the runtime's own type names without a node round-trip. """ diff --git a/website/apps/bittensor-website/public/catalog/emission-snapshot.json b/website/apps/bittensor-website/public/catalog/emission-snapshot.json index 62460d197c..bf2afd3503 100644 --- a/website/apps/bittensor-website/public/catalog/emission-snapshot.json +++ b/website/apps/bittensor-website/public/catalog/emission-snapshot.json @@ -3,7 +3,7 @@ "network": "finney", "chainSpecVersion": 443, "emissionMode": "price_ema_miner_burn_hill_gate", - "emissionGateSource": "v444_defaults_recomputed", + "emissionGateSource": "v445_defaults_recomputed", "dataSource": { "subnets": "taomarketcap.com", "chain": "finney", diff --git a/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py b/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py index 538e5bb747..bec55dac86 100644 --- a/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py +++ b/website/apps/bittensor-website/scripts/fetch-emission-snapshot.py @@ -3,8 +3,8 @@ Subnet prices and EMA sums use TMC's public API. Eligibility, emission-enabled flags, MinerBurned proportions, total issuance, and root pool TAO come from Finney storage. The output models price EMA with miner-burn scaling and the -Hill gate. On spec 444 or later, the gate settings and cadence-held midpoint -come from chain storage. Before the upgrade, the output previews the v444 gate +Hill gate. On spec 445 or later, the gate settings and cadence-held midpoint +come from chain storage. Before the upgrade, the output previews the v445 gate settings while retaining miner-burn scaling. It does not use the deprecated ``BlockEmission`` storage item. @@ -177,7 +177,7 @@ async def subnet_flags(netuid: int) -> tuple[int, dict[str, bool | float]]: flags = dict(await asyncio.gather(*(subnet_flags(netuid) for netuid in netuids))) gate = None - if spec_version >= 444: + if spec_version >= 445: rank, quantile, exponent, bar = await asyncio.gather( view.query(st.SubtensorModule.EmissionBarRank), view.query(st.SubtensorModule.EmissionBarQuantile), @@ -210,7 +210,7 @@ def select_emission_gate_bar( rank: int = DEFAULT_EMISSION_BAR_RANK, quantile: float = DEFAULT_EMISSION_BAR_QUANTILE, ) -> float: - """Mirror ``maybe_update_emission_gate_bar`` for the v444 snapshot.""" + """Mirror ``maybe_update_emission_gate_bar`` for the v445 snapshot.""" positive = sorted((share for share in demand_shares if share > 0), reverse=True) if not positive: return 0.0 @@ -316,7 +316,7 @@ async def build_snapshot() -> dict: "quantile": DEFAULT_EMISSION_BAR_QUANTILE, "exponent": DEFAULT_EMISSION_GATE_EXPONENT, "bar": None, - "source": "v444_defaults_recomputed", + "source": "v445_defaults_recomputed", } gate_bar = apply_shares( subnets, diff --git a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx index a8789d2792..1e0aa12c5c 100644 --- a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx +++ b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/page.tsx @@ -23,14 +23,14 @@ type Release = { // Newest first. Add new releases to the top. const releases: Release[] = [ { - tag: 'v444', + tag: 'v445', date: 'August 2026', title: 'EVM, btcli, and Reliability', summary: 'This release completes the typed EVM surface, makes multisigs first-class btcli wallets, ' + 'recycles transaction fees, adds human-readable ' + 'Ledger orders, and lands a broad reliability pass.', - href: '/releases/v444-upgrade', + href: '/releases/v445-upgrade', }, { tag: 'v441', diff --git a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v445-upgrade/page.tsx similarity index 95% rename from website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx rename to website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v445-upgrade/page.tsx index 04435afcea..b9e7816f02 100644 --- a/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v444-upgrade/page.tsx +++ b/website/apps/bittensor-website/src/app/(pages-without-footer)/releases/v445-upgrade/page.tsx @@ -6,11 +6,11 @@ import {Suspense} from 'react'; import styles from '../v436-upgrade/page.module.css'; export const metadata: Metadata = { - title: 'The V444 Upgrade — EVM, btcli, and Reliability', + title: 'The V445 Upgrade — EVM, btcli, and Reliability', description: - 'V444 completes the EVM surface, makes btcli safer for multisigs and automation, adds ' + + 'V445 completes the EVM surface, makes btcli safer for multisigs and automation, adds ' + 'human-readable Ledger orders, and lands a broad reliability pass.', - alternates: {canonical: '/releases/v444-upgrade'}, + alternates: {canonical: '/releases/v445-upgrade'}, }; const DocLink = ({href, children}: {href: string; children: React.ReactNode}) => ( @@ -24,7 +24,7 @@ const page = () => { }>
    -

    The V444 Upgrade

    +

    The V445 Upgrade

    EVM, btcli, and Reliability · August 2026

    @@ -33,12 +33,12 @@ const page = () => {

    Introduction

    - Spec 444 makes the chain substantially easier to use from every + Spec 445 makes the chain substantially easier to use from every external surface. Solidity contracts gain 31 functions across five new Bittensor precompiles, plus 135 additions to existing interfaces. A saved multisig now behaves like a wallet throughout btcli. Automated dry runs carry enough information to approve and replay a transaction safely. Ledger users can read the actual fields of a - limit order before signing it. Underneath those interfaces, v444 recycles transaction + limit order before signing it. Underneath those interfaces, v445 recycles transaction fees and corrects transaction-pool validation, proxy charging, commitment cleanup, storage growth, and GRANDPA finality.

    @@ -132,13 +132,13 @@ IRuntimeConfiguration config = uint256 chainId = config.getEvmChainId();`} />

    - In v444, only the registry's isDisabled field is populated. Its + In v445, only the registry's isDisabled field is populated. Its selector parameter and selector-lifecycle fields are reserved for a future extension and must not be used to infer whether a selector exists.

    Canonical Solidity interfaces, JSON ABIs, generated Python ABI copies, documentation, - gas accounting, and tests ship together. Integrators should use the v444 copies rather + gas accounting, and tests ship together. Integrators should use the v445 copies rather than reconstructing selectors from release notes. The new maintainer documentation also fixes the rules for ABI versioning, state exposure, lifecycle metadata, coverage, and backwards compatibility so later runtime releases can extend this surface without @@ -208,7 +208,7 @@ btcli wallet transfer --dest 5F... --amount-tao 10 -w team-treasury`}

    Read the order before signing it

    V438 let Ledger and compatible signers - authorize limit orders by signing a wrapped order hash. V444 adds an alternative + authorize limit orders by signing a wrapped order hash. V445 adds an alternative clear-signing form: one canonical printable message containing the order type, amount, subnet, limit or trigger price, expiry, hotkey, relayer policy, fee, slippage, chain ID, partial-fill policy, and signer. The hardware wallet displays those fields before @@ -245,7 +245,7 @@ partial fills , signer `} Area - Change in v444 + Change in v445 @@ -315,13 +315,13 @@ partial fills , signer `}

    • EVM integrators: refresh the complete canonical ABI set before using - v444 selectors. Add 0x…080f through 0x…0813 only from the + v445 selectors. Add 0x…080f through 0x…0813 only from the published interfaces, and use the registry to inspect whole-precompile availability. Re-estimate aggregate staking reads and do not rely on fixed gas stipends.
    • SDK and CLI users: older clients that read current chain metadata can - keep using existing commands. To use the new v444 features, upgrade to{' '} + keep using existing commands. To use the new v445 features, upgrade to{' '} bittensor 11.1.0 and bittensor-core 0.1.3 alongside the runtime upgrade. Existing wallet files remain usable, and saved multisigs can now be passed directly as -w. Rebuild any offline signing payload prepared @@ -335,7 +335,7 @@ partial fills , signer `}

    Signers: after the release train proposes, use{' '} - btcli upgrade sign --url <v444 release URL> -w <wallet>. + btcli upgrade sign --url <v445 release URL> -w <wallet>.

    diff --git a/website/apps/bittensor-website/src/lib/emission-snapshot.ts b/website/apps/bittensor-website/src/lib/emission-snapshot.ts index cd1d172fdd..112d7468d8 100644 --- a/website/apps/bittensor-website/src/lib/emission-snapshot.ts +++ b/website/apps/bittensor-website/src/lib/emission-snapshot.ts @@ -30,7 +30,7 @@ export type EmissionSnapshot = { network: string; chainSpecVersion: number; emissionMode: 'price_ema_miner_burn_hill_gate' | string; - emissionGateSource: 'chain_storage' | 'v444_defaults_recomputed'; + emissionGateSource: 'chain_storage' | 'v445_defaults_recomputed'; blockEmissionTao: number; totalIssuanceTao: number; totalIssuanceRao?: number; From 983f2104feaa11e6b725468c37923d2ed81622f0 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 7 Aug 2026 12:31:59 -0400 Subject: [PATCH 04/14] Fix conviction aggregate roll-forward accounting and require takeover challengers to independently meet the 10% conviction threshold. --- pallets/subtensor/src/staking/lock.rs | 205 ++++++++++++++++------- pallets/subtensor/src/tests/locks.rs | 232 +++++++++++++++++++++++++- 2 files changed, 374 insertions(+), 63 deletions(-) diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 6a02d13942..36f8aa4d94 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -204,22 +204,90 @@ impl ConvictionModel { self.individual_lock_dirty = true; } - pub fn roll_forward(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { - let (rolled_individual_lock, roll_delta) = Self::roll_forward_lock( + /// Rolls only the individual lock forward. + /// + /// Use this for read-only individual queries and for operations that update + /// aggregate storage separately. + pub fn roll_forward_individual(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { + self.individual_lock = Self::roll_forward_lock( self.individual_lock.clone(), now, unlock_rate, maturity_rate, self.owner_lock, self.perpetual_lock, + ) + .0; + self.individual_lock_dirty = true; + } + + /// Rolls the individual lock and its aggregate bucket forward together. + /// + /// Individual locks and their aggregate can have different timestamps + /// because aggregate-only operations may advance the bucket without + /// rewriting every member. Before rolling to `now`, reconstruct the + /// individual's contribution at a common anchor, detach it from the + /// aggregate, roll the remaining members and the individual separately, + /// then merge them again. This prevents both skipping sibling evolution + /// and applying an individual's evolution twice. + pub fn roll_forward(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { + let owner_lock = self.owner_lock; + let perpetual_lock = self.perpetual_lock; + let aggregate_last_update = self.aggregate_lock().last_update; + let anchor = aggregate_last_update.max(self.individual_lock.last_update); + + let individual_at_anchor = Self::roll_forward_lock_preserving_dust( + self.individual_lock.clone(), + anchor, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, ); - self.individual_lock = rolled_individual_lock; + let aggregate_at_anchor = Self::roll_forward_lock( + self.aggregate_lock().clone(), + anchor, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, + ) + .0; + let siblings_at_anchor = Self::reduce_lock( + &aggregate_at_anchor, + individual_at_anchor.locked_mass, + individual_at_anchor.conviction, + ); + + // Preserve sub-threshold member contributions in the sibling remainder + // until those members are detached individually. Applying the + // individual dust threshold to the merged remainder would make a + // later member reconstruction subtract value that is no longer in the + // aggregate. + let rolled_siblings = Self::roll_forward_lock_preserving_dust( + siblings_at_anchor, + now, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, + ); + let rolled_individual = Self::roll_forward_lock( + individual_at_anchor, + now, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, + ) + .0; + let rolled_aggregate = Self::merge_lock(&rolled_siblings, &rolled_individual); + + self.individual_lock = rolled_individual; self.individual_lock_dirty = true; - if !roll_delta.is_zero() { - self.apply_roll_delta_to_aggregate(roll_delta, now); - } else { - self.roll_forward_aggregate(now, unlock_rate, maturity_rate); - } + let (aggregate, aggregate_dirty) = self.aggregate_mut(); + *aggregate = rolled_aggregate; + *aggregate_dirty = true; } pub fn roll_forward_aggregate(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { @@ -250,25 +318,6 @@ impl ConvictionModel { *aggregate_dirty = true; } - fn apply_roll_delta_to_aggregate(&mut self, roll_delta: RollDelta, now: u64) { - let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = Self::reduce_lock( - aggregate, - roll_delta.locked_mass_delta, - roll_delta.conviction_decay, - ); - // Conviction matured by the individual lock must be credited to the - // aggregate here: bumping last_update below means the aggregate's own - // roll-forward will never cover this window, so dropping the growth - // (as a saturating decrease-only delta used to) permanently - // understates aggregate conviction. - aggregate.conviction = aggregate - .conviction - .saturating_add(roll_delta.conviction_growth); - aggregate.last_update = now; - *aggregate_dirty = true; - } - pub fn reduce(&mut self, locked_mass: AlphaBalance, conviction: U64F64) { self.individual_lock = Self::reduce_lock(&self.individual_lock, locked_mass, conviction); self.individual_lock_dirty = true; @@ -432,6 +481,42 @@ impl ConvictionModel { ) -> (LockState, RollDelta) { let previous_locked_mass = lock.locked_mass; let previous_conviction = lock.conviction; + let mut rolled = Self::roll_forward_lock_preserving_dust( + lock, + now, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, + ); + + if rolled.is_zero() { + rolled.locked_mass = AlphaBalance::ZERO; + rolled.conviction = U64F64::saturating_from_num(0); + } + + let roll_delta = RollDelta { + locked_mass_delta: previous_locked_mass.saturating_sub(rolled.locked_mass), + conviction_decay: previous_conviction.saturating_sub(rolled.conviction), + conviction_growth: rolled.conviction.saturating_sub(previous_conviction), + }; + + (rolled, roll_delta) + } + + /// Evolves a lock without applying the individual dust threshold. + /// + /// Aggregate synchronization uses this to reconstruct and detach the + /// member's full contribution at the aggregate timestamp. Dust cleanup is + /// applied after the member and the sibling remainder are separated. + fn roll_forward_lock_preserving_dust( + lock: LockState, + now: u64, + unlock_rate: u64, + maturity_rate: u64, + owner_lock: bool, + perpetual_lock: bool, + ) -> LockState { let mut rolled = if now > lock.last_update { let dt = now.saturating_sub(lock.last_update); let (new_locked_mass, new_conviction) = Self::calculate_decayed_mass_and_conviction( @@ -456,18 +541,7 @@ impl ConvictionModel { rolled.conviction = U64F64::saturating_from_num(u64::from(rolled.locked_mass)); } - if rolled.is_zero() { - rolled.locked_mass = AlphaBalance::ZERO; - rolled.conviction = U64F64::saturating_from_num(0); - } - - let roll_delta = RollDelta { - locked_mass_delta: previous_locked_mass.saturating_sub(rolled.locked_mass), - conviction_decay: previous_conviction.saturating_sub(rolled.conviction), - conviction_growth: rolled.conviction.saturating_sub(previous_conviction), - }; - - (rolled, roll_delta) + rolled } } @@ -712,7 +786,11 @@ impl Pallet { let now = Self::get_current_block_as_u64(); Self::read_conviction_model(coldkey, netuid, now) .map(|(_hotkey, mut model)| { - model.roll_forward(now, UnlockRate::::get(), MaturityRate::::get()); + model.roll_forward_individual( + now, + UnlockRate::::get(), + MaturityRate::::get(), + ); model.individual_lock().locked_mass }) .unwrap_or(AlphaBalance::ZERO) @@ -723,7 +801,11 @@ impl Pallet { let now = Self::get_current_block_as_u64(); Self::read_conviction_model(coldkey, netuid, now) .map(|(_hotkey, mut model)| { - model.roll_forward(now, UnlockRate::::get(), MaturityRate::::get()); + model.roll_forward_individual( + now, + UnlockRate::::get(), + MaturityRate::::get(), + ); model.individual_lock().conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)) @@ -733,7 +815,7 @@ impl Pallet { pub fn get_coldkey_lock(coldkey: &T::AccountId, netuid: NetUid) -> Option { let now = Self::get_current_block_as_u64(); Self::read_conviction_model(coldkey, netuid, now).map(|(_hotkey, mut model)| { - model.roll_forward(now, UnlockRate::::get(), MaturityRate::::get()); + model.roll_forward_individual(now, UnlockRate::::get(), MaturityRate::::get()); model.individual_lock().clone() }) } @@ -832,12 +914,14 @@ impl Pallet { ); } - model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); model.add_to_aggregate(&LockState { locked_mass: amount, conviction: U64F64::saturating_from_num(0), last_update: now, }); + // Normalize owner conviction and aggregate dust after the top-up. + // The synchronized roll above already advanced the bucket to `now`, + // so this does not evolve any member for a second time. model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); Self::save_conviction_model(coldkey, netuid, hotkey, model); @@ -857,7 +941,6 @@ impl Pallet { let now = Self::get_current_block_as_u64(); if let Some((hotkey, mut model)) = Self::read_conviction_model(coldkey, netuid, now) { model.roll_forward(now, UnlockRate::::get(), MaturityRate::::get()); - model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); model.force_reduce_individual(amount, now); Self::save_conviction_model(coldkey, netuid, &hotkey, model); } @@ -1157,11 +1240,11 @@ impl Pallet { /// is mature enough and enough conviction has accumulated. /// /// Ownership can change only after the subnet is at least [`ONE_YEAR`] old and the - /// total rolled aggregate conviction on the subnet is at least 10% of `SubnetAlphaOut`. - /// If those gates pass, the hotkey with the highest rolled aggregate conviction - /// becomes the subnet owner hotkey, and that hotkey's owning coldkey becomes the - /// subnet owner coldkey. The new owner hotkey's conviction is then progressed to - /// its current locked mass so the new owner starts with full owner conviction. + /// hotkey with the highest rolled aggregate conviction itself holds at least 10% of + /// `SubnetAlphaOut`. If those gates pass, that hotkey becomes the subnet owner + /// hotkey, and its owning coldkey becomes the subnet owner coldkey. The new owner + /// hotkey's conviction is then progressed to its current locked mass so the new + /// owner starts with full owner conviction. pub fn change_subnet_owner_if_needed(netuid: NetUid) { // No outstanding alpha means there is no meaningful 10% conviction threshold. let subnet_alpha_out = SubnetAlphaOut::::get(netuid); @@ -1176,19 +1259,21 @@ impl Pallet { return; } - // Require total rolled aggregate conviction to be at least 10% of subnet alpha out. - let total_conviction = Self::get_total_conviction(netuid); - if total_conviction.saturating_mul(U64F64::saturating_from_num(10)) - < U64F64::saturating_from_num(u64::from(subnet_alpha_out)) - { - return; - } - // Pick the hotkey with the highest rolled aggregate conviction. let Some(king_hotkey) = Self::subnet_king(netuid) else { return; }; + // The challenger must itself hold at least 10% of subnet alpha out. + // Gating on subnet-wide conviction would let unrelated lockers, + // including the incumbent, supply the challenger's quorum. + let king_conviction = Self::hotkey_conviction(&king_hotkey, netuid); + if king_conviction.saturating_mul(U64F64::saturating_from_num(10)) + < U64F64::saturating_from_num(u64::from(subnet_alpha_out)) + { + return; + } + // The king hotkey must resolve to a real coldkey owner. let new_owner_coldkey = Self::get_owning_coldkey_for_hotkey(&king_hotkey); if new_owner_coldkey == DefaultAccount::::get() { @@ -1762,7 +1847,7 @@ impl Pallet { Some((origin_hotkey, mut model)) => { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - model.roll_forward(now, unlock_rate, maturity_rate); + model.roll_forward_individual(now, unlock_rate, maturity_rate); let mut lock = model.individual_lock().clone(); let removed = lock.clone(); @@ -1866,11 +1951,11 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - source_model.roll_forward(now, unlock_rate, maturity_rate); + source_model.roll_forward_individual(now, unlock_rate, maturity_rate); let mut source_lock = source_model.individual_lock().clone(); let maybe_destination_lock = Self::read_conviction_model(destination_coldkey, netuid, now) .map(|(hotkey, mut model)| { - model.roll_forward(now, unlock_rate, maturity_rate); + model.roll_forward_individual(now, unlock_rate, maturity_rate); (hotkey, model.individual_lock().clone()) }); diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index cbf87a7901..5499d4674c 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -2012,7 +2012,130 @@ fn test_unstake_rolls_forward_existing_lock() { } #[test] -fn test_unstake_roll_forward_collects_decaying_lock_dust_from_hotkey_aggregate() { +fn test_cleanup_rolls_forward_sibling_lock_contributions() { + new_test_ext(1).execute_with(|| { + let coldkey_1 = U256::from(1); + let coldkey_2 = U256::from(3); + let hotkey = U256::from(2); + let netuid = setup_subnet_with_stake(coldkey_1, hotkey, 100_000_000_000); + + add_balance_to_coldkey_account(&coldkey_2, 100_000_000_000u64.into()); + SubtensorModule::stake_into_subnet( + &hotkey, + &coldkey_2, + netuid, + 100_000_000_000u64.into(), + ::SwapInterface::max_price(), + false, + ) + .unwrap(); + DecayingLock::::insert(coldkey_2, netuid, false); + + let lock_1: AlphaBalance = 10_000_000_000u64.into(); + let lock_2: AlphaBalance = 20_000_000_000u64.into(); + assert_ok!(SubtensorModule::do_lock_stake( + &coldkey_1, netuid, &hotkey, lock_1, + )); + assert_ok!(SubtensorModule::do_lock_stake( + &coldkey_2, netuid, &hotkey, lock_2, + )); + + let stored_1 = Lock::::get((coldkey_1, netuid, hotkey)).unwrap(); + let stored_2 = Lock::::get((coldkey_2, netuid, hotkey)).unwrap(); + step_block(100); + let now = SubtensorModule::get_current_block_as_u64(); + let expected_1 = roll_forward_hotkey_lock(stored_1, now); + let expected_2 = roll_forward_hotkey_lock(stored_2, now); + + SubtensorModule::cleanup_lock_if_zero(&coldkey_1, netuid); + + let aggregate = HotkeyLock::::get(netuid, hotkey).expect("aggregate should remain"); + assert_eq!( + aggregate.locked_mass, + expected_1 + .locked_mass + .saturating_add(expected_2.locked_mass) + ); + assert_eq!( + aggregate.conviction, + expected_1.conviction.saturating_add(expected_2.conviction) + ); + assert_eq!(aggregate.last_update, now); + }); +} + +#[test] +fn test_lock_top_up_does_not_double_count_after_aggregate_only_roll() { + new_test_ext(1).execute_with(|| { + let large_coldkey = U256::from(1); + let dummy_coldkey = U256::from(3); + let hotkey = U256::from(2); + let netuid = setup_subnet_with_stake(large_coldkey, hotkey, 100_000_000_000); + + add_balance_to_coldkey_account(&dummy_coldkey, 100_000_000_000u64.into()); + SubtensorModule::stake_into_subnet( + &hotkey, + &dummy_coldkey, + netuid, + 100_000_000_000u64.into(), + ::SwapInterface::max_price(), + false, + ) + .unwrap(); + DecayingLock::::insert(dummy_coldkey, netuid, false); + + let large_lock: AlphaBalance = 10_000_000_000u64.into(); + let dummy_lock: AlphaBalance = 1_000_000_000u64.into(); + let top_up: AlphaBalance = 1_000_000_000u64.into(); + assert_ok!(SubtensorModule::do_lock_stake( + &large_coldkey, + netuid, + &hotkey, + large_lock, + )); + + step_block(100); + + // A new member has a zero individual delta, so adding it rolls the + // pre-existing aggregate (including the large lock) forward. + assert_ok!(SubtensorModule::do_lock_stake( + &dummy_coldkey, + netuid, + &hotkey, + dummy_lock, + )); + let aggregate_before_top_up = + HotkeyLock::::get(netuid, hotkey).expect("aggregate should exist"); + assert!(aggregate_before_top_up.conviction > U64F64::from_num(0)); + + // The large individual row is still older than the aggregate. Its + // already-counted maturation must not be added to the aggregate again. + assert_ok!(SubtensorModule::do_lock_stake( + &large_coldkey, + netuid, + &hotkey, + top_up, + )); + let aggregate_after_top_up = + HotkeyLock::::get(netuid, hotkey).expect("aggregate should remain"); + + assert_eq!( + aggregate_after_top_up.locked_mass, + aggregate_before_top_up.locked_mass.saturating_add(top_up) + ); + assert_eq!( + aggregate_after_top_up.conviction, + aggregate_before_top_up.conviction + ); + assert_eq!( + aggregate_after_top_up.last_update, + SubtensorModule::get_current_block_as_u64() + ); + }); +} + +#[test] +fn test_unstake_roll_forward_collects_decaying_sibling_dust_from_hotkey_aggregate() { new_test_ext(1).execute_with(|| { const ONE_ALPHA: u64 = 1_000_000_000; const DUST_ALPHA: u64 = 100; @@ -2082,6 +2205,11 @@ fn test_unstake_roll_forward_collects_decaying_lock_dust_from_hotkey_aggregate() }, now, ); + let rolled_sibling_dust_mass: AlphaBalance = + ConvictionModel::exp_decay(now.saturating_sub(lock_block), UnlockRate::::get()) + .saturating_mul(U64F64::from_num(DUST_ALPHA)) + .to_num::() + .into(); assert_ok!(SubtensorModule::do_remove_stake( RuntimeOrigin::signed(coldkey_1), @@ -2099,7 +2227,7 @@ fn test_unstake_roll_forward_collects_decaying_lock_dust_from_hotkey_aggregate() .locked_mass, rolled_large_lock .locked_mass - .saturating_add(AlphaBalance::from(DUST_ALPHA)) + .saturating_add(rolled_sibling_dust_mass) ); assert_ok!(SubtensorModule::do_remove_stake( @@ -3197,6 +3325,104 @@ fn test_change_subnet_owner_if_needed_reassigns_to_subnet_king() { }); } +#[test] +fn test_change_subnet_owner_requires_challenger_to_meet_ten_percent_gate() { + new_test_ext(1).execute_with(|| { + let owner_coldkey = U256::from(1); + let owner_hotkey = U256::from(2); + let netuid = setup_subnet_with_stake(owner_coldkey, owner_hotkey, 100_000_000_000); + SubnetOwner::::insert(netuid, owner_coldkey); + SubnetOwnerHotkey::::insert(netuid, owner_hotkey); + + let challenger_coldkey = U256::from(5); + let challenger_hotkey = U256::from(6); + assert_ok!(SubtensorModule::create_account_if_non_existent( + &challenger_coldkey, + &challenger_hotkey + )); + + let now = crate::staking::lock::ONE_YEAR + 1; + System::set_block_number(now); + NetworkRegisteredAt::::insert(netuid, 1); + SubnetAlphaOut::::insert(netuid, AlphaBalance::from(10_000u64)); + + // The challenger is the leader, and subnet-wide conviction exceeds + // 10%, but the challenger itself holds only 9%. The incumbent's 2% + // must not supply the missing takeover quorum. + HotkeyLock::::insert( + netuid, + owner_hotkey, + LockState { + locked_mass: 200u64.into(), + conviction: U64F64::from_num(200), + last_update: now, + }, + ); + HotkeyLock::::insert( + netuid, + challenger_hotkey, + LockState { + locked_mass: 900u64.into(), + conviction: U64F64::from_num(900), + last_update: now, + }, + ); + + SubtensorModule::change_subnet_owner_if_needed(netuid); + + assert_eq!(SubnetOwner::::get(netuid), owner_coldkey); + assert_eq!(SubnetOwnerHotkey::::get(netuid), owner_hotkey); + }); +} + +#[test] +fn test_change_subnet_owner_ignores_unrelated_conviction_for_ten_percent_gate() { + new_test_ext(1).execute_with(|| { + let owner_coldkey = U256::from(1); + let owner_hotkey = U256::from(2); + let netuid = setup_subnet_with_stake(owner_coldkey, owner_hotkey, 100_000_000_000); + SubnetOwner::::insert(netuid, owner_coldkey); + SubnetOwnerHotkey::::insert(netuid, owner_hotkey); + + let challenger_coldkey = U256::from(5); + let challenger_hotkey = U256::from(6); + assert_ok!(SubtensorModule::create_account_if_non_existent( + &challenger_coldkey, + &challenger_hotkey + )); + + let now = crate::staking::lock::ONE_YEAR + 1; + System::set_block_number(now); + NetworkRegisteredAt::::insert(netuid, 1); + SubnetAlphaOut::::insert(netuid, AlphaBalance::from(10_000u64)); + + // Four unrelated buckets total 10.01%, and the challenger is the + // largest at 2.51%. Only conviction in the challenger's bucket should + // count toward its takeover threshold. + for (hotkey, conviction) in [ + (challenger_hotkey, 251u64), + (U256::from(10), 250u64), + (U256::from(11), 250u64), + (U256::from(12), 250u64), + ] { + HotkeyLock::::insert( + netuid, + hotkey, + LockState { + locked_mass: conviction.into(), + conviction: U64F64::from_num(conviction), + last_update: now, + }, + ); + } + + SubtensorModule::change_subnet_owner_if_needed(netuid); + + assert_eq!(SubnetOwner::::get(netuid), owner_coldkey); + assert_eq!(SubnetOwnerHotkey::::get(netuid), owner_hotkey); + }); +} + #[test] fn test_run_coinbase_reassigns_subnet_owner_by_conviction_on_epoch() { new_test_ext(1).execute_with(|| { @@ -3457,7 +3683,7 @@ fn test_change_subnet_owner_if_needed_does_not_reassign_when_required_condition_ }); }; - // Missing condition 1: total conviction is below 10% of SubnetAlphaOut. + // Missing condition 1: challenger conviction is below 10% of SubnetAlphaOut. assert_owner_unchanged(30_000, 1, 500, 1_000); // Missing condition 2: subnet is younger than one year. From f333d637b447b36ad5489ac49bb4d78f91a1f4cc Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 7 Aug 2026 13:45:34 -0400 Subject: [PATCH 05/14] Add lock aggregate rebuilding migration --- pallets/subtensor/src/macros/hooks.rs | 2 + .../migrate_rebuild_conviction_aggregates.rs | 193 +++++++++++++ pallets/subtensor/src/migrations/mod.rs | 1 + pallets/subtensor/src/tests/migration.rs | 268 +++++++++++++++++- 4 files changed, 463 insertions(+), 1 deletion(-) create mode 100644 pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs diff --git a/pallets/subtensor/src/macros/hooks.rs b/pallets/subtensor/src/macros/hooks.rs index f5323e4140..40a7d1d060 100644 --- a/pallets/subtensor/src/macros/hooks.rs +++ b/pallets/subtensor/src/macros/hooks.rs @@ -171,6 +171,8 @@ mod hooks { .saturating_add(migrations::migrate_dynamic_tempo::migrate_dynamic_tempo::()) // Populate locking reverse map. .saturating_add(migrations::migrate_populate_locking_coldkeys::migrate_populate_locking_coldkeys::()) + // Rebuild conviction aggregates corrupted by partial v443 roll-forward updates. + .saturating_add(migrations::migrate_rebuild_conviction_aggregates::migrate_rebuild_conviction_aggregates::()) // Capture the runtime-upgrade block for TAO-in refund cutover. .saturating_add(migrations::migrate_tao_in_refund_deployment_block::migrate_tao_in_refund_deployment_block::()) // Fix lock state left behind by subnet-scoped hotkey swaps. diff --git a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs new file mode 100644 index 0000000000..720450f166 --- /dev/null +++ b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs @@ -0,0 +1,193 @@ +use alloc::{collections::BTreeMap, string::String, vec::Vec}; +use frame_support::{traits::Get, weights::Weight}; + +use crate::{ + Config, DecayingHotkeyLock, DecayingLock, DecayingOwnerLock, HasMigrationRun, HotkeyLock, Lock, + LockingColdkeys, MaturityRate, OwnerLock, Pallet as Subtensor, SubnetOwnerHotkey, UnlockRate, + staking::lock::{ConvictionModel, LockState}, +}; +use subtensor_runtime_common::{NetUid, Token}; + +const MIGRATION_NAME: &[u8] = b"migrate_rebuild_conviction_aggregates"; + +// Mainnet archive scan at block 8_793_919 on 2026-08-07: +// - 352 Lock rows and 352 matching LockingColdkeys rows +// - 193 aggregate rows across the four aggregate maps +// - 125 subnets with locks, with at most 44 Lock rows on any one subnet +// +// This is intentionally a one-shot runtime-upgrade scan of small existing +// state, not an operation placed on a recurring block path. Keep these +// measurements next to the migration so its practical bound and review +// rationale are not lost. +const OBSERVED_MAINNET_LOCK_ROWS: u64 = 352; +const OBSERVED_MAINNET_AGGREGATE_ROWS: u64 = 193; +const OBSERVED_MAINNET_MAX_LOCKS_PER_SUBNET: u64 = 44; +const OBSERVED_MAINNET_BLOCK: u64 = 8_793_919; + +fn merge_lock(lhs: &mut LockState, rhs: &LockState) { + lhs.locked_mass = lhs.locked_mass.saturating_add(rhs.locked_mass); + lhs.conviction = lhs.conviction.saturating_add(rhs.conviction); + lhs.last_update = lhs.last_update.max(rhs.last_update); +} + +fn merge_into(aggregates: &mut BTreeMap, key: K, lock: &LockState) { + if let Some(aggregate) = aggregates.get_mut(&key) { + merge_lock(aggregate, lock); + } else { + aggregates.insert(key, lock.clone()); + } +} + +/// Rebuilds conviction aggregates from canonical individual lock rows. +/// +/// Runtime v443 could advance an aggregate timestamp after applying only one +/// member's roll delta. Once that happened, the aggregate was no longer the +/// sum of its members at its advertised timestamp. There is no safe way to +/// repair such a bucket incrementally, so this migration ignores every stored +/// aggregate and reconstructs all four maps from `Lock`. +/// +/// Each individual is first rolled to the runtime-upgrade block using its +/// current lock mode and owner role. The rolled row is persisted (or removed +/// if it has become dust), then merged into its appropriate new aggregate. +/// This preserves earned conviction while establishing one common timestamp +/// for every individual and aggregate contribution. +pub fn migrate_rebuild_conviction_aggregates() -> Weight { + let mut weight = T::DbWeight::get().reads(1); + + if HasMigrationRun::::get(MIGRATION_NAME) { + log::info!( + "Migration '{}' already executed - skipping", + String::from_utf8_lossy(MIGRATION_NAME) + ); + return weight; + } + + log::info!( + "Running migration '{}'. Mainnet scan at block {} observed {} individual locks, \ + {} aggregate rows, and at most {} locks on one subnet", + String::from_utf8_lossy(MIGRATION_NAME), + OBSERVED_MAINNET_BLOCK, + OBSERVED_MAINNET_LOCK_ROWS, + OBSERVED_MAINNET_AGGREGATE_ROWS, + OBSERVED_MAINNET_MAX_LOCKS_PER_SUBNET, + ); + + let now = Subtensor::::get_current_block_as_u64(); + let unlock_rate = UnlockRate::::get(); + let maturity_rate = MaturityRate::::get(); + weight = weight.saturating_add(T::DbWeight::get().reads(3)); + + // Collect before rewriting Lock so mutation cannot disturb the iterator. + let locks: Vec<_> = Lock::::iter().collect(); + let scanned_count = locks.len() as u64; + weight = weight.saturating_add(T::DbWeight::get().reads(scanned_count)); + + let locking_coldkeys_removal = LockingColdkeys::::clear(u32::MAX, None); + weight = weight.saturating_add(T::DbWeight::get().reads_writes( + locking_coldkeys_removal.loops as u64, + locking_coldkeys_removal.backend as u64, + )); + + let hotkey_removal = HotkeyLock::::clear(u32::MAX, None); + weight = weight.saturating_add( + T::DbWeight::get().reads_writes(hotkey_removal.loops as u64, hotkey_removal.backend as u64), + ); + + let decaying_hotkey_removal = DecayingHotkeyLock::::clear(u32::MAX, None); + weight = weight.saturating_add(T::DbWeight::get().reads_writes( + decaying_hotkey_removal.loops as u64, + decaying_hotkey_removal.backend as u64, + )); + + let owner_removal = OwnerLock::::clear(u32::MAX, None); + weight = weight.saturating_add( + T::DbWeight::get().reads_writes(owner_removal.loops as u64, owner_removal.backend as u64), + ); + + let decaying_owner_removal = DecayingOwnerLock::::clear(u32::MAX, None); + weight = weight.saturating_add(T::DbWeight::get().reads_writes( + decaying_owner_removal.loops as u64, + decaying_owner_removal.backend as u64, + )); + + let mut perpetual_general = BTreeMap::<(NetUid, T::AccountId), LockState>::new(); + let mut decaying_general = BTreeMap::<(NetUid, T::AccountId), LockState>::new(); + let mut perpetual_owner = BTreeMap::::new(); + let mut decaying_owner = BTreeMap::::new(); + let mut retained_count = 0u64; + let mut removed_dust_count = 0u64; + + for ((coldkey, netuid, hotkey), lock) in locks { + let owner_lock = SubnetOwnerHotkey::::get(netuid) == hotkey; + let perpetual_lock = DecayingLock::::get(&coldkey, netuid) == Some(false); + weight = weight.saturating_add(T::DbWeight::get().reads(2)); + + let rolled = ConvictionModel::roll_forward_lock( + lock, + now, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, + ) + .0; + + if rolled.is_zero() { + Lock::::remove((&coldkey, netuid, &hotkey)); + removed_dust_count = removed_dust_count.saturating_add(1); + weight = weight.saturating_add(T::DbWeight::get().writes(1)); + continue; + } + + Lock::::insert((&coldkey, netuid, &hotkey), rolled.clone()); + LockingColdkeys::::insert((netuid, &hotkey, &coldkey), ()); + retained_count = retained_count.saturating_add(1); + weight = weight.saturating_add(T::DbWeight::get().writes(2)); + + match (owner_lock, perpetual_lock) { + (true, true) => merge_into(&mut perpetual_owner, netuid, &rolled), + (true, false) => merge_into(&mut decaying_owner, netuid, &rolled), + (false, true) => { + merge_into(&mut perpetual_general, (netuid, hotkey), &rolled); + } + (false, false) => { + merge_into(&mut decaying_general, (netuid, hotkey), &rolled); + } + } + } + + let aggregate_count = perpetual_general + .len() + .saturating_add(decaying_general.len()) + .saturating_add(perpetual_owner.len()) + .saturating_add(decaying_owner.len()) as u64; + + for ((netuid, hotkey), lock) in perpetual_general { + HotkeyLock::::insert(netuid, hotkey, lock); + } + for ((netuid, hotkey), lock) in decaying_general { + DecayingHotkeyLock::::insert(netuid, hotkey, lock); + } + for (netuid, lock) in perpetual_owner { + OwnerLock::::insert(netuid, lock); + } + for (netuid, lock) in decaying_owner { + DecayingOwnerLock::::insert(netuid, lock); + } + weight = weight.saturating_add(T::DbWeight::get().writes(aggregate_count)); + + HasMigrationRun::::insert(MIGRATION_NAME, true); + weight = weight.saturating_add(T::DbWeight::get().writes(1)); + + log::info!( + "Migration '{}' completed. scanned_entries={}, retained_entries={}, \ + removed_dust_entries={}, rebuilt_aggregate_entries={}", + String::from_utf8_lossy(MIGRATION_NAME), + scanned_count, + retained_count, + removed_dust_count, + aggregate_count, + ); + + weight +} diff --git a/pallets/subtensor/src/migrations/mod.rs b/pallets/subtensor/src/migrations/mod.rs index dfd5714c03..d0afb9fea0 100644 --- a/pallets/subtensor/src/migrations/mod.rs +++ b/pallets/subtensor/src/migrations/mod.rs @@ -44,6 +44,7 @@ pub mod migrate_populate_owned_hotkeys; pub mod migrate_rao; pub mod migrate_rate_limit_keys; pub mod migrate_rate_limiting_last_blocks; +pub mod migrate_rebuild_conviction_aggregates; pub mod migrate_remove_add_stake_burn_rate_limit; pub mod migrate_remove_commitments_rate_limit; pub mod migrate_remove_deprecated_conviction_maps; diff --git a/pallets/subtensor/src/tests/migration.rs b/pallets/subtensor/src/tests/migration.rs index ac15ffb07c..1bb9226396 100644 --- a/pallets/subtensor/src/tests/migration.rs +++ b/pallets/subtensor/src/tests/migration.rs @@ -7,7 +7,7 @@ )] use super::mock::*; -use crate::staking::lock::LockState; +use crate::staking::lock::{ConvictionModel, LockState}; use crate::*; use alloc::collections::BTreeMap; use approx::{assert_abs_diff_eq, assert_relative_eq}; @@ -1619,6 +1619,272 @@ fn test_migrate_populate_locking_coldkeys_removes_dust_from_aggregate() { }); } +#[test] +fn test_migrate_rebuild_conviction_aggregates_from_individual_locks() { + new_test_ext(1).execute_with(|| { + const MIGRATION_NAME: &[u8] = b"migrate_rebuild_conviction_aggregates"; + + let netuid = NetUid::from(72); + let current_owner = U256::from(7200); + let former_owner = U256::from(7201); + let general_hotkey = U256::from(7202); + let orphan_hotkey = U256::from(7299); + let former_owner_coldkey = U256::from(7210); + let owner_perpetual_coldkey = U256::from(7211); + let owner_decaying_coldkey = U256::from(7212); + let general_perpetual_coldkey_1 = U256::from(7213); + let general_perpetual_coldkey_2 = U256::from(7214); + let general_decaying_coldkey = U256::from(7215); + let now = 1_000u64; + let unlock_rate = 200u64; + let maturity_rate = 300u64; + + System::set_block_number(now); + UnlockRate::::put(unlock_rate); + MaturityRate::::put(maturity_rate); + SubnetOwnerHotkey::::insert(netuid, current_owner); + HasMigrationRun::::remove(MIGRATION_NAME); + + // This reproduces the only SN72 row that still spans the ownership + // transition: a former-owner perpetual lock already at conviction == + // locked_mass. That state remains a fixed point after becoming a + // non-owner, so current-role roll-forward is exact without history. + let former_owner_lock = LockState { + locked_mass: AlphaBalance::from(6_000_u64), + conviction: U64F64::from_num(6_000_u64), + last_update: 100, + }; + let owner_perpetual_lock = LockState { + locked_mass: AlphaBalance::from(50_000_u64), + conviction: U64F64::from_num(20_000_u64), + last_update: 800, + }; + let owner_decaying_lock = LockState { + locked_mass: AlphaBalance::from(40_000_u64), + conviction: U64F64::from_num(10_000_u64), + last_update: 800, + }; + let general_perpetual_lock_1 = LockState { + locked_mass: AlphaBalance::from(10_000_u64), + conviction: U64F64::from_num(1_000_u64), + last_update: 700, + }; + let general_perpetual_lock_2 = LockState { + locked_mass: AlphaBalance::from(20_000_u64), + conviction: U64F64::from_num(2_000_u64), + last_update: 750, + }; + let general_decaying_lock = LockState { + locked_mass: AlphaBalance::from(30_000_u64), + conviction: U64F64::from_num(3_000_u64), + last_update: 700, + }; + + for coldkey in [ + former_owner_coldkey, + owner_perpetual_coldkey, + general_perpetual_coldkey_1, + general_perpetual_coldkey_2, + ] { + DecayingLock::::insert(coldkey, netuid, false); + } + + let seeded_locks = [ + ( + former_owner_coldkey, + former_owner, + former_owner_lock.clone(), + false, + true, + ), + ( + owner_perpetual_coldkey, + current_owner, + owner_perpetual_lock.clone(), + true, + true, + ), + ( + owner_decaying_coldkey, + current_owner, + owner_decaying_lock.clone(), + true, + false, + ), + ( + general_perpetual_coldkey_1, + general_hotkey, + general_perpetual_lock_1.clone(), + false, + true, + ), + ( + general_perpetual_coldkey_2, + general_hotkey, + general_perpetual_lock_2.clone(), + false, + true, + ), + ( + general_decaying_coldkey, + general_hotkey, + general_decaying_lock.clone(), + false, + false, + ), + ]; + + for (coldkey, hotkey, lock, _, _) in &seeded_locks { + Lock::::insert((*coldkey, netuid, *hotkey), lock.clone()); + LockingColdkeys::::insert((netuid, *hotkey, *coldkey), ()); + } + + let corrupt = LockState { + locked_mass: AlphaBalance::from(999_999_u64), + conviction: U64F64::from_num(888_888_u64), + last_update: 999, + }; + HotkeyLock::::insert(netuid, former_owner, corrupt.clone()); + HotkeyLock::::insert(netuid, general_hotkey, corrupt.clone()); + HotkeyLock::::insert(netuid, orphan_hotkey, corrupt.clone()); + DecayingHotkeyLock::::insert(netuid, general_hotkey, corrupt.clone()); + OwnerLock::::insert(netuid, corrupt.clone()); + DecayingOwnerLock::::insert(netuid, corrupt); + + let expected: Vec<_> = seeded_locks + .iter() + .map(|(coldkey, hotkey, lock, owner, perpetual)| { + ( + *coldkey, + *hotkey, + ConvictionModel::roll_forward_lock( + lock.clone(), + now, + unlock_rate, + maturity_rate, + *owner, + *perpetual, + ) + .0, + ) + }) + .collect(); + + let weight = crate::migrations::migrate_rebuild_conviction_aggregates:: + migrate_rebuild_conviction_aggregates::(); + + assert!(!weight.is_zero()); + assert!(HasMigrationRun::::get(MIGRATION_NAME)); + assert_eq!(Lock::::iter().count(), seeded_locks.len()); + assert_eq!(LockingColdkeys::::iter().count(), seeded_locks.len()); + + for (coldkey, hotkey, expected_lock) in &expected { + assert_eq!( + Lock::::get((*coldkey, netuid, *hotkey)), + Some(expected_lock.clone()) + ); + assert_eq!(expected_lock.last_update, now); + assert!(LockingColdkeys::::contains_key(( + netuid, *hotkey, *coldkey + ))); + } + + let expected_former_owner = expected[0].2.clone(); + assert_eq!( + expected_former_owner.conviction, + U64F64::from_num(expected_former_owner.locked_mass) + ); + assert_eq!( + HotkeyLock::::get(netuid, former_owner), + Some(expected_former_owner) + ); + + let mut expected_general_perpetual = expected[3].2.clone(); + expected_general_perpetual.locked_mass = expected_general_perpetual + .locked_mass + .saturating_add(expected[4].2.locked_mass); + expected_general_perpetual.conviction = expected_general_perpetual + .conviction + .saturating_add(expected[4].2.conviction); + assert_eq!( + HotkeyLock::::get(netuid, general_hotkey), + Some(expected_general_perpetual) + ); + assert_eq!( + DecayingHotkeyLock::::get(netuid, general_hotkey), + Some(expected[5].2.clone()) + ); + assert_eq!(OwnerLock::::get(netuid), Some(expected[1].2.clone())); + assert_eq!( + DecayingOwnerLock::::get(netuid), + Some(expected[2].2.clone()) + ); + assert!(HotkeyLock::::get(netuid, orphan_hotkey).is_none()); + + let aggregate_snapshot = ( + HotkeyLock::::iter().collect::>(), + DecayingHotkeyLock::::iter().collect::>(), + OwnerLock::::iter().collect::>(), + DecayingOwnerLock::::iter().collect::>(), + ); + let second_weight = crate::migrations::migrate_rebuild_conviction_aggregates:: + migrate_rebuild_conviction_aggregates::(); + assert_eq!( + second_weight, + ::DbWeight::get().reads(1) + ); + assert_eq!( + aggregate_snapshot, + ( + HotkeyLock::::iter().collect::>(), + DecayingHotkeyLock::::iter().collect::>(), + OwnerLock::::iter().collect::>(), + DecayingOwnerLock::::iter().collect::>(), + ) + ); + }); +} + +#[test] +fn test_migrate_rebuild_conviction_aggregates_removes_dust_and_orphan_index_rows() { + new_test_ext(1).execute_with(|| { + const MIGRATION_NAME: &[u8] = b"migrate_rebuild_conviction_aggregates"; + + let netuid = NetUid::from(73); + let coldkey = U256::from(7300); + let orphan_coldkey = U256::from(7301); + let hotkey = U256::from(7310); + let orphan_hotkey = U256::from(7311); + let now = 1_000u64; + + System::set_block_number(now); + UnlockRate::::put(1); + MaturityRate::::put(1); + HasMigrationRun::::remove(MIGRATION_NAME); + + let decayed_to_dust = LockState { + locked_mass: AlphaBalance::from(1_000_u64), + conviction: U64F64::from_num(0), + last_update: 1, + }; + Lock::::insert((coldkey, netuid, hotkey), decayed_to_dust.clone()); + LockingColdkeys::::insert((netuid, hotkey, coldkey), ()); + LockingColdkeys::::insert((netuid, orphan_hotkey, orphan_coldkey), ()); + DecayingHotkeyLock::::insert(netuid, hotkey, decayed_to_dust.clone()); + HotkeyLock::::insert(netuid, orphan_hotkey, decayed_to_dust); + + crate::migrations::migrate_rebuild_conviction_aggregates:: + migrate_rebuild_conviction_aggregates::(); + + assert!(Lock::::get((coldkey, netuid, hotkey)).is_none()); + assert_eq!(LockingColdkeys::::iter().count(), 0); + assert_eq!(HotkeyLock::::iter().count(), 0); + assert_eq!(DecayingHotkeyLock::::iter().count(), 0); + assert_eq!(OwnerLock::::iter().count(), 0); + assert_eq!(DecayingOwnerLock::::iter().count(), 0); + }); +} + #[test] fn test_migrate_fix_staking_hot_keys() { new_test_ext(1).execute_with(|| { From 6e7ed0ea9fba8ac6cfa18649042e306ff95f1022 Mon Sep 17 00:00:00 2001 From: UnArbosFive Date: Fri, 7 Aug 2026 18:57:56 +0200 Subject: [PATCH 06/14] fix: synchronize moved locks with aggregate dust --- pallets/subtensor/src/staking/lock.rs | 129 +++++++++++++------------- pallets/subtensor/src/tests/locks.rs | 101 ++++++++++++++++++++ 2 files changed, 164 insertions(+), 66 deletions(-) diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 36f8aa4d94..94a2fb225b 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -1847,7 +1847,7 @@ impl Pallet { Some((origin_hotkey, mut model)) => { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - model.roll_forward_individual(now, unlock_rate, maturity_rate); + model.roll_forward(now, unlock_rate, maturity_rate); let mut lock = model.individual_lock().clone(); let removed = lock.clone(); @@ -1864,16 +1864,9 @@ impl Pallet { ) .0; - Lock::::remove((coldkey.clone(), netuid, origin_hotkey.clone())); - Self::maybe_remove_locking_coldkey(&origin_hotkey, netuid, coldkey); + model.reduce(removed.locked_mass, removed.conviction); + Self::save_conviction_model(coldkey, netuid, &origin_hotkey, model); Self::insert_lock_state(coldkey, netuid, destination_hotkey, lock.clone()); - Self::reduce_aggregate_lock( - coldkey, - &origin_hotkey, - netuid, - removed.locked_mass, - removed.conviction, - ); Self::add_aggregate_lock(coldkey, destination_hotkey, netuid, lock); Self::deposit_event(Event::LockMoved { @@ -1951,26 +1944,17 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - source_model.roll_forward_individual(now, unlock_rate, maturity_rate); + source_model.roll_forward(now, unlock_rate, maturity_rate); + let source_lock_before = source_model.individual_lock().clone(); let mut source_lock = source_model.individual_lock().clone(); - let maybe_destination_lock = Self::read_conviction_model(destination_coldkey, netuid, now) - .map(|(hotkey, mut model)| { - model.roll_forward_individual(now, unlock_rate, maturity_rate); - (hotkey, model.individual_lock().clone()) - }); + let maybe_destination_hotkey = + Self::read_conviction_model(destination_coldkey, netuid, now) + .map(|(hotkey, _model)| hotkey); - let destination_lock_hotkey = maybe_destination_lock + let destination_lock_hotkey = maybe_destination_hotkey .as_ref() - .map(|(hotkey, _)| hotkey.clone()) + .cloned() .unwrap_or_else(|| destination_hotkey.clone()); - let mut destination_lock = maybe_destination_lock - .as_ref() - .map(|(_, lock)| lock.clone()) - .unwrap_or(LockState { - locked_mass: AlphaBalance::ZERO, - conviction: U64F64::saturating_from_num(0), - last_update: now, - }); // Calculate available stake by subtracting locked_mass from total alpha. let unavailable = source_lock.locked_mass; @@ -1987,10 +1971,9 @@ impl Pallet { // same amount, reduce conviction on the source coldkey proportionally, and increase conviction // on the destination coldkey proportionally. let mut locked_transfer = AlphaBalance::ZERO; - let mut conviction_transfer = U64F64::saturating_from_num(0); let mut received_conviction = U64F64::saturating_from_num(0); if !remaining_to_transfer.is_zero() { - if let Some((existing_hotkey, _)) = maybe_destination_lock.as_ref() { + if let Some(existing_hotkey) = maybe_destination_hotkey.as_ref() { ensure!( existing_hotkey == destination_hotkey, Error::::LockHotkeyMismatch @@ -1998,7 +1981,8 @@ impl Pallet { } locked_transfer = remaining_to_transfer.min(source_lock.locked_mass); - conviction_transfer = if locked_transfer.is_zero() || source_lock.locked_mass.is_zero() + let conviction_transfer = if locked_transfer.is_zero() + || source_lock.locked_mass.is_zero() { U64F64::saturating_from_num(0) } else { @@ -2024,11 +2008,6 @@ impl Pallet { source_lock.locked_mass = source_lock.locked_mass.saturating_sub(locked_transfer); source_lock.conviction = source_lock.conviction.saturating_sub(conviction_transfer); - destination_lock.locked_mass = - destination_lock.locked_mass.saturating_add(locked_transfer); - destination_lock.conviction = destination_lock - .conviction - .saturating_add(received_conviction); } Self::ensure_can_receive_locked_alpha(destination_coldkey, locked_transfer)?; @@ -2041,42 +2020,60 @@ impl Pallet { Self::is_perpetual_lock(origin_coldkey, netuid), ) .0; - destination_lock = ConvictionModel::roll_forward_lock( - destination_lock, - now, - unlock_rate, - maturity_rate, - Self::is_subnet_owner_hotkey(netuid, &destination_lock_hotkey), - Self::is_perpetual_lock(destination_coldkey, netuid), - ) - .0; - - // Upsert updated locks (only once per this fn) even if there were no updates because - // of roll-forward - Self::insert_lock_state(origin_coldkey, netuid, &source_hotkey, source_lock); - Self::insert_lock_state( - destination_coldkey, - netuid, - &destination_lock_hotkey, - destination_lock, - ); - if !locked_transfer.is_zero() { - Self::reduce_aggregate_lock( - origin_coldkey, - &source_hotkey, + let removed_locked_mass = source_lock_before + .locked_mass + .saturating_sub(source_lock.locked_mass); + let removed_conviction = source_lock_before + .conviction + .saturating_sub(source_lock.conviction); + source_model.set_individual_lock(source_lock); + source_model.reduce_aggregate(removed_locked_mass, removed_conviction); + Self::save_conviction_model(origin_coldkey, netuid, &source_hotkey, source_model); + + if !locked_transfer.is_zero() || maybe_destination_hotkey.is_some() { + // Re-read after saving the source model. Source and destination can share an + // aggregate bucket, so retaining the earlier aggregate snapshot would restore + // the source contribution that was just removed. + let mut destination_model = Self::read_conviction_model_for_hotkey( + destination_coldkey, netuid, - locked_transfer, - conviction_transfer, + &destination_lock_hotkey, + now, ); - Self::add_aggregate_lock( + destination_model.roll_forward(now, unlock_rate, maturity_rate); + let destination_lock_before = destination_model.individual_lock().clone(); + let mut destination_lock = destination_lock_before.clone(); + destination_lock.locked_mass = + destination_lock.locked_mass.saturating_add(locked_transfer); + destination_lock.conviction = destination_lock + .conviction + .saturating_add(received_conviction); + destination_lock = ConvictionModel::roll_forward_lock( + destination_lock, + now, + unlock_rate, + maturity_rate, + Self::is_subnet_owner_hotkey(netuid, &destination_lock_hotkey), + Self::is_perpetual_lock(destination_coldkey, netuid), + ) + .0; + + let added = LockState { + locked_mass: destination_lock + .locked_mass + .saturating_sub(destination_lock_before.locked_mass), + conviction: destination_lock + .conviction + .saturating_sub(destination_lock_before.conviction), + last_update: now, + }; + destination_model.set_individual_lock(destination_lock); + destination_model.add_to_aggregate(&added); + Self::save_conviction_model( destination_coldkey, - &destination_lock_hotkey, netuid, - LockState { - locked_mass: locked_transfer, - conviction: received_conviction, - last_update: now, - }, + &destination_lock_hotkey, + destination_model, ); } diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index 5499d4674c..08bc75d140 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -4887,6 +4887,107 @@ fn test_neuron_replacement_does_not_affect_lock() { // GROUP 19: Moving lock // ========================================================================= +#[test] +fn test_move_lock_removes_dusted_member_from_aggregate() { + new_test_ext(1).execute_with(|| { + let moving_coldkey = U256::from(1); + let sibling_coldkey = U256::from(4); + let origin_hotkey = U256::from(2); + let destination_hotkey = U256::from(3); + let netuid = setup_subnet_with_stake(moving_coldkey, origin_hotkey, 100_000_000_000); + assert_ok!(SubtensorModule::create_account_if_non_existent( + &moving_coldkey, + &destination_hotkey, + )); + DecayingLock::::insert(sibling_coldkey, netuid, false); + + let now = SubtensorModule::get_current_block_as_u64(); + let dust = LockState { + locked_mass: 99u64.into(), + conviction: U64F64::from_num(99), + last_update: now, + }; + let sibling = LockState { + locked_mass: 1_000u64.into(), + conviction: U64F64::from_num(1_000), + last_update: now, + }; + Lock::::insert((moving_coldkey, netuid, origin_hotkey), dust.clone()); + Lock::::insert((sibling_coldkey, netuid, origin_hotkey), sibling.clone()); + HotkeyLock::::insert( + netuid, + origin_hotkey, + LockState { + locked_mass: dust.locked_mass.saturating_add(sibling.locked_mass), + conviction: dust.conviction.saturating_add(sibling.conviction), + last_update: now, + }, + ); + + assert_ok!(SubtensorModule::do_move_lock( + &moving_coldkey, + &destination_hotkey, + netuid, + )); + + assert!(Lock::::get((moving_coldkey, netuid, origin_hotkey)).is_none()); + assert!(Lock::::get((moving_coldkey, netuid, destination_hotkey)).is_none()); + assert_eq!( + HotkeyLock::::get(netuid, origin_hotkey), + Some(sibling) + ); + assert!(HotkeyLock::::get(netuid, destination_hotkey).is_none()); + }); +} + +#[test] +fn test_transfer_lock_removes_dusted_source_from_aggregate() { + new_test_ext(1).execute_with(|| { + let sender_coldkey = U256::from(1); + let receiver_coldkey = U256::from(5); + let sibling_coldkey = U256::from(4); + let hotkey = U256::from(2); + let netuid = setup_subnet_with_stake(sender_coldkey, hotkey, 100_000_000_000); + DecayingLock::::insert(sibling_coldkey, netuid, false); + + let now = SubtensorModule::get_current_block_as_u64(); + let dust = LockState { + locked_mass: 99u64.into(), + conviction: U64F64::from_num(99), + last_update: now, + }; + let sibling = LockState { + locked_mass: 1_000u64.into(), + conviction: U64F64::from_num(1_000), + last_update: now, + }; + Lock::::insert((sender_coldkey, netuid, hotkey), dust.clone()); + Lock::::insert((sibling_coldkey, netuid, hotkey), sibling.clone()); + HotkeyLock::::insert( + netuid, + hotkey, + LockState { + locked_mass: dust.locked_mass.saturating_add(sibling.locked_mass), + conviction: dust.conviction.saturating_add(sibling.conviction), + last_update: now, + }, + ); + + let total_alpha = SubtensorModule::total_coldkey_alpha_on_subnet(&sender_coldkey, netuid); + assert_ok!(SubtensorModule::transfer_lock( + &sender_coldkey, + &receiver_coldkey, + &hotkey, + netuid, + total_alpha, + )); + + assert!(Lock::::get((sender_coldkey, netuid, hotkey)).is_none()); + assert!(Lock::::get((receiver_coldkey, netuid, hotkey)).is_none()); + assert_eq!(HotkeyLock::::get(netuid, hotkey), Some(sibling)); + }); +} + #[test] fn test_moving_lock() { new_test_ext(1).execute_with(|| { From 081650b31ef74b3a3af034c906394d8efadca057 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 7 Aug 2026 14:21:11 -0400 Subject: [PATCH 07/14] make conviction lock mutations atomic and merge move destinations --- .../migrate_rebuild_conviction_aggregates.rs | 3 +- pallets/subtensor/src/staking/lock.rs | 414 ++++++++---------- pallets/subtensor/src/tests/locks.rs | 120 ++++- pallets/subtensor/src/tests/migration.rs | 3 +- 4 files changed, 301 insertions(+), 239 deletions(-) diff --git a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs index 720450f166..2c4ef96ba8 100644 --- a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs +++ b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs @@ -129,8 +129,7 @@ pub fn migrate_rebuild_conviction_aggregates() -> Weight { maturity_rate, owner_lock, perpetual_lock, - ) - .0; + ); if rolled.is_zero() { Lock::::remove((&coldkey, netuid, &hotkey)); diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 94a2fb225b..79cbe2c975 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -31,31 +31,19 @@ impl LockState { } } -/// Change produced by rolling a lock forward. Locked mass only ever -/// decreases, but conviction can move either way (it matures upward from -/// locked mass and decays downward once the mass is gone), so its change is -/// carried as separate unsigned growth/decay components. -#[derive(Clone, PartialEq, Eq, Debug)] -pub struct RollDelta { - pub locked_mass_delta: AlphaBalance, - pub conviction_decay: U64F64, - pub conviction_growth: U64F64, +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +struct LockContribution { + locked_mass: AlphaBalance, + conviction: U64F64, } -impl RollDelta { - pub fn zero() -> Self { +impl From<&LockState> for LockContribution { + fn from(lock: &LockState) -> Self { Self { - locked_mass_delta: AlphaBalance::ZERO, - conviction_decay: U64F64::saturating_from_num(0), - conviction_growth: U64F64::saturating_from_num(0), + locked_mass: lock.locked_mass, + conviction: lock.conviction, } } - - pub fn is_zero(&self) -> bool { - self.locked_mass_delta.is_zero() - && self.conviction_decay == U64F64::saturating_from_num(0) - && self.conviction_growth == U64F64::saturating_from_num(0) - } } /// A struct that incapsulates Lock primitives such as adding, removing, @@ -180,36 +168,33 @@ impl ConvictionModel { self.agg_decaying_owner_dirty = true; } - pub fn set_individual_lock(&mut self, lock: LockState) { - self.individual_lock = lock; - self.individual_lock_dirty = true; - } - - pub fn set_rolled_individual_lock( + /// Adds locked mass while keeping the individual and aggregate + /// contributions synchronized. + fn add_locked_mass( &mut self, - lock: LockState, + amount: AlphaBalance, now: u64, unlock_rate: u64, maturity_rate: u64, ) { - self.individual_lock = Self::roll_forward_lock( + let mut lock = self.detach_individual(); + lock.locked_mass = lock.locked_mass.saturating_add(amount); + lock = Self::roll_forward_lock( lock, now, unlock_rate, maturity_rate, self.owner_lock, self.perpetual_lock, - ) - .0; - self.individual_lock_dirty = true; + ); + self.attach_to_detached_individual(lock); + self.roll_forward_aggregate(now, unlock_rate, maturity_rate); } - /// Rolls only the individual lock forward. - /// - /// Use this for read-only individual queries and for operations that update - /// aggregate storage separately. - pub fn roll_forward_individual(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { - self.individual_lock = Self::roll_forward_lock( + /// Returns the individual lock rolled to `now` without changing model + /// state or dirty flags. + pub fn rolled_individual(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> LockState { + Self::roll_forward_lock( self.individual_lock.clone(), now, unlock_rate, @@ -217,8 +202,30 @@ impl ConvictionModel { self.owner_lock, self.perpetual_lock, ) - .0; + } + + /// Removes the complete canonical individual contribution from this model + /// and its aggregate bucket. + fn detach_individual(&mut self) -> LockState { + let detached = self.individual_lock.clone(); + let contribution = LockContribution::from(&detached); + self.individual_lock = Self::reduce_lock( + &self.individual_lock, + contribution.locked_mass, + contribution.conviction, + ); self.individual_lock_dirty = true; + self.reduce_aggregate(contribution); + detached + } + + /// Adds one canonical individual contribution after the previous + /// contribution has been detached from this model and its aggregate. + fn attach_to_detached_individual(&mut self, lock: LockState) { + let contribution = LockContribution::from(&lock); + self.individual_lock = lock; + self.individual_lock_dirty = true; + self.add_to_aggregate(contribution); } /// Rolls the individual lock and its aggregate bucket forward together. @@ -251,8 +258,7 @@ impl ConvictionModel { maturity_rate, owner_lock, perpetual_lock, - ) - .0; + ); let siblings_at_anchor = Self::reduce_lock( &aggregate_at_anchor, individual_at_anchor.locked_mass, @@ -279,8 +285,7 @@ impl ConvictionModel { maturity_rate, owner_lock, perpetual_lock, - ) - .0; + ); let rolled_aggregate = Self::merge_lock(&rolled_siblings, &rolled_individual); self.individual_lock = rolled_individual; @@ -290,7 +295,7 @@ impl ConvictionModel { *aggregate_dirty = true; } - pub fn roll_forward_aggregate(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { + fn roll_forward_aggregate(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { let owner_lock = self.owner_lock; let perpetual_lock = self.perpetual_lock; let (aggregate, aggregate_dirty) = self.aggregate_mut(); @@ -301,33 +306,24 @@ impl ConvictionModel { maturity_rate, owner_lock, perpetual_lock, - ) - .0; + ); *aggregate_dirty = true; } - pub fn add_to_aggregate(&mut self, added: &LockState) { + fn add_to_aggregate(&mut self, added: LockContribution) { let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = Self::merge_lock(aggregate, added); + aggregate.locked_mass = aggregate.locked_mass.saturating_add(added.locked_mass); + aggregate.conviction = aggregate.conviction.saturating_add(added.conviction); *aggregate_dirty = true; } - pub fn reduce_aggregate(&mut self, locked_mass: AlphaBalance, conviction: U64F64) { + fn reduce_aggregate(&mut self, removed: LockContribution) { let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = Self::reduce_lock(aggregate, locked_mass, conviction); + *aggregate = Self::reduce_lock(aggregate, removed.locked_mass, removed.conviction); *aggregate_dirty = true; } - pub fn reduce(&mut self, locked_mass: AlphaBalance, conviction: U64F64) { - self.individual_lock = Self::reduce_lock(&self.individual_lock, locked_mass, conviction); - self.individual_lock_dirty = true; - - let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = Self::reduce_lock(aggregate, locked_mass, conviction); - *aggregate_dirty = true; - } - - pub fn force_reduce_individual(&mut self, amount: AlphaBalance, now: u64) { + fn force_reduce_individual(&mut self, amount: AlphaBalance, now: u64) { let rolled = self.individual_lock.clone(); let new_locked_mass = rolled.locked_mass.saturating_sub(amount); let locked_mass_diff = rolled.locked_mass.saturating_sub(new_locked_mass); @@ -354,7 +350,10 @@ impl ConvictionModel { }; self.individual_lock_dirty = true; - self.reduce_aggregate(locked_mass_diff, conviction_diff); + self.reduce_aggregate(LockContribution { + locked_mass: locked_mass_diff, + conviction: conviction_diff, + }); } fn aggregate_mut(&mut self) -> (&mut LockState, &mut bool) { @@ -478,9 +477,7 @@ impl ConvictionModel { maturity_rate: u64, owner_lock: bool, perpetual_lock: bool, - ) -> (LockState, RollDelta) { - let previous_locked_mass = lock.locked_mass; - let previous_conviction = lock.conviction; + ) -> LockState { let mut rolled = Self::roll_forward_lock_preserving_dust( lock, now, @@ -495,13 +492,7 @@ impl ConvictionModel { rolled.conviction = U64F64::saturating_from_num(0); } - let roll_delta = RollDelta { - locked_mass_delta: previous_locked_mass.saturating_sub(rolled.locked_mass), - conviction_decay: previous_conviction.saturating_sub(rolled.conviction), - conviction_growth: rolled.conviction.saturating_sub(previous_conviction), - }; - - (rolled, roll_delta) + rolled } /// Evolves a lock without applying the individual dust threshold. @@ -785,13 +776,10 @@ impl Pallet { pub fn get_current_locked(coldkey: &T::AccountId, netuid: NetUid) -> AlphaBalance { let now = Self::get_current_block_as_u64(); Self::read_conviction_model(coldkey, netuid, now) - .map(|(_hotkey, mut model)| { - model.roll_forward_individual( - now, - UnlockRate::::get(), - MaturityRate::::get(), - ); - model.individual_lock().locked_mass + .map(|(_hotkey, model)| { + model + .rolled_individual(now, UnlockRate::::get(), MaturityRate::::get()) + .locked_mass }) .unwrap_or(AlphaBalance::ZERO) } @@ -800,13 +788,10 @@ impl Pallet { pub fn get_conviction(coldkey: &T::AccountId, netuid: NetUid) -> U64F64 { let now = Self::get_current_block_as_u64(); Self::read_conviction_model(coldkey, netuid, now) - .map(|(_hotkey, mut model)| { - model.roll_forward_individual( - now, - UnlockRate::::get(), - MaturityRate::::get(), - ); - model.individual_lock().conviction + .map(|(_hotkey, model)| { + model + .rolled_individual(now, UnlockRate::::get(), MaturityRate::::get()) + .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)) } @@ -814,9 +799,8 @@ impl Pallet { /// Returns the current lock for a coldkey on a subnet, rolled forward to now. pub fn get_coldkey_lock(coldkey: &T::AccountId, netuid: NetUid) -> Option { let now = Self::get_current_block_as_u64(); - Self::read_conviction_model(coldkey, netuid, now).map(|(_hotkey, mut model)| { - model.roll_forward_individual(now, UnlockRate::::get(), MaturityRate::::get()); - model.individual_lock().clone() + Self::read_conviction_model(coldkey, netuid, now).map(|(_hotkey, model)| { + model.rolled_individual(now, UnlockRate::::get(), MaturityRate::::get()) }) } @@ -888,41 +872,19 @@ impl Pallet { && model.individual_lock().conviction == U64F64::saturating_from_num(0) { ensure!(total >= amount, Error::::InsufficientStakeForLock); - - model.set_rolled_individual_lock( - LockState { - locked_mass: amount, - conviction: U64F64::saturating_from_num(0), - last_update: now, - }, - now, - UnlockRate::::get(), - MaturityRate::::get(), - ); } else { - let mut lock = model.individual_lock().clone(); - lock.locked_mass = lock.locked_mass.saturating_add(amount); ensure!( - total >= lock.locked_mass, + total >= model.individual_lock().locked_mass.saturating_add(amount), Error::::InsufficientStakeForLock ); - model.set_rolled_individual_lock( - lock, - now, - UnlockRate::::get(), - MaturityRate::::get(), - ); } - model.add_to_aggregate(&LockState { - locked_mass: amount, - conviction: U64F64::saturating_from_num(0), - last_update: now, - }); - // Normalize owner conviction and aggregate dust after the top-up. - // The synchronized roll above already advanced the bucket to `now`, - // so this does not evolve any member for a second time. - model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); + model.add_locked_mass( + amount, + now, + UnlockRate::::get(), + MaturityRate::::get(), + ); Self::save_conviction_model(coldkey, netuid, hotkey, model); Self::deposit_event(Event::StakeLocked { @@ -1000,7 +962,7 @@ impl Pallet { let now = Self::get_current_block_as_u64(); let mut model = Self::read_conviction_model_for_hotkey(coldkey, netuid, hotkey, now); model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); - model.add_to_aggregate(&added); + model.add_to_aggregate(LockContribution::from(&added)); model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); Self::save_conviction_model(coldkey, netuid, hotkey, model); } @@ -1016,7 +978,10 @@ impl Pallet { let now = Self::get_current_block_as_u64(); let mut model = Self::read_conviction_model_for_hotkey(coldkey, netuid, hotkey, now); model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); - model.reduce_aggregate(amount, conviction); + model.reduce_aggregate(LockContribution { + locked_mass: amount, + conviction, + }); Self::save_conviction_model(coldkey, netuid, hotkey, model); } @@ -1036,7 +1001,6 @@ impl Pallet { false, true, ) - .0 .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1050,7 +1014,6 @@ impl Pallet { false, false, ) - .0 .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1066,7 +1029,6 @@ impl Pallet { true, true, ) - .0 .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1080,7 +1042,6 @@ impl Pallet { true, false, ) - .0 .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1107,7 +1068,6 @@ impl Pallet { false, true, ) - .0 .conviction }) .fold(U64F64::saturating_from_num(0), |acc, conviction| { @@ -1123,7 +1083,6 @@ impl Pallet { false, false, ) - .0 .conviction }) .fold(U64F64::saturating_from_num(0), |acc, conviction| { @@ -1139,7 +1098,6 @@ impl Pallet { true, true, ) - .0 .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1153,7 +1111,6 @@ impl Pallet { true, false, ) - .0 .conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1183,7 +1140,7 @@ impl Pallet { let entry = scores .entry(hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); - *entry = entry.saturating_add(rolled.0.conviction); + *entry = entry.saturating_add(rolled.conviction); }); DecayingHotkeyLock::::iter_prefix(netuid).for_each(|(hotkey, lock)| { let rolled = ConvictionModel::roll_forward_lock( @@ -1197,7 +1154,7 @@ impl Pallet { let entry = scores .entry(hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); - *entry = entry.saturating_add(rolled.0.conviction); + *entry = entry.saturating_add(rolled.conviction); }); if let Some(lock) = OwnerLock::::get(netuid) { let owner_hotkey = SubnetOwnerHotkey::::get(netuid); @@ -1212,7 +1169,7 @@ impl Pallet { let entry = scores .entry(owner_hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); - *entry = entry.saturating_add(rolled.0.conviction); + *entry = entry.saturating_add(rolled.conviction); } if let Some(lock) = DecayingOwnerLock::::get(netuid) { let owner_hotkey = SubnetOwnerHotkey::::get(netuid); @@ -1227,7 +1184,7 @@ impl Pallet { let entry = scores .entry(owner_hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); - *entry = entry.saturating_add(rolled.0.conviction); + *entry = entry.saturating_add(rolled.conviction); } scores @@ -1316,7 +1273,6 @@ impl Pallet { false, true, ) - .0 }) .unwrap_or_else(|| Self::empty_lock(now)); Self::insert_hotkey_lock_state( @@ -1325,10 +1281,10 @@ impl Pallet { LockState { locked_mass: current .locked_mass - .saturating_add(moved_owner_lock.0.locked_mass), + .saturating_add(moved_owner_lock.locked_mass), conviction: current .conviction - .saturating_add(moved_owner_lock.0.conviction), + .saturating_add(moved_owner_lock.conviction), last_update: now, }, ); @@ -1352,7 +1308,6 @@ impl Pallet { false, false, ) - .0 }) .unwrap_or_else(|| Self::empty_lock(now)); Self::insert_decaying_hotkey_lock_state( @@ -1361,10 +1316,10 @@ impl Pallet { LockState { locked_mass: current .locked_mass - .saturating_add(moved_owner_lock.0.locked_mass), + .saturating_add(moved_owner_lock.locked_mass), conviction: current .conviction - .saturating_add(moved_owner_lock.0.conviction), + .saturating_add(moved_owner_lock.conviction), last_update: now, }, ); @@ -1388,7 +1343,6 @@ impl Pallet { true, true, ) - .0 }) .unwrap_or_else(|| Self::empty_lock(now)); Self::insert_owner_lock_state( @@ -1397,10 +1351,10 @@ impl Pallet { LockState { locked_mass: current .locked_mass - .saturating_add(moved_king_lock.0.locked_mass), + .saturating_add(moved_king_lock.locked_mass), conviction: current .conviction - .saturating_add(moved_king_lock.0.conviction), + .saturating_add(moved_king_lock.conviction), last_update: now, }, now, @@ -1408,8 +1362,7 @@ impl Pallet { maturity_rate, true, true, - ) - .0, + ), ); } if let Some(king_lock) = DecayingHotkeyLock::::take(netuid, &king_hotkey) { @@ -1431,7 +1384,6 @@ impl Pallet { true, false, ) - .0 }) .unwrap_or_else(|| Self::empty_lock(now)); Self::insert_decaying_owner_lock_state( @@ -1440,10 +1392,10 @@ impl Pallet { LockState { locked_mass: current .locked_mass - .saturating_add(moved_king_lock.0.locked_mass), + .saturating_add(moved_king_lock.locked_mass), conviction: current .conviction - .saturating_add(moved_king_lock.0.conviction), + .saturating_add(moved_king_lock.conviction), last_update: now, }, now, @@ -1451,8 +1403,7 @@ impl Pallet { maturity_rate, true, false, - ) - .0, + ), ); } @@ -1481,7 +1432,7 @@ impl Pallet { Self::is_subnet_owner_hotkey(netuid, &hotkey), Self::is_perpetual_lock(coldkey, netuid), ); - if rolled.0.locked_mass > AlphaBalance::ZERO { + if rolled.locked_mass > AlphaBalance::ZERO { return Err(Error::::ActiveLockExists); } } @@ -1521,7 +1472,7 @@ impl Pallet { let perpetual_lock = decaying_locks_to_transfer .iter() .any(|(decaying_netuid, decaying)| *decaying_netuid == netuid && !*decaying); - let (old_lock, _) = ConvictionModel::roll_forward_lock( + let old_lock = ConvictionModel::roll_forward_lock( lock, now, unlock_rate, @@ -1574,8 +1525,7 @@ impl Pallet { maturity_rate, Self::is_subnet_owner_hotkey(netuid, &hotkey), perpetual_lock, - ) - .0; + ); Self::insert_lock_state(new_coldkey, netuid, &hotkey, new_lock.clone()); Self::add_aggregate_lock(new_coldkey, &hotkey, netuid, new_lock); } @@ -1675,8 +1625,7 @@ impl Pallet { maturity_rate, old_owner_lock, perpetual_lock, - ) - .0; + ); let moved = ConvictionModel::roll_forward_lock( rolled, now, @@ -1684,8 +1633,7 @@ impl Pallet { maturity_rate, new_owner_lock, perpetual_lock, - ) - .0; + ); Lock::::remove((coldkey.clone(), netuid, old_hotkey.clone())); Self::maybe_remove_locking_coldkey(old_hotkey, netuid, &coldkey); Self::insert_lock_state(&coldkey, netuid, new_hotkey, moved); @@ -1706,7 +1654,6 @@ impl Pallet { true, true, ) - .0 }) } else { HotkeyLock::::take(netuid, old_hotkey).map(|lock| { @@ -1718,7 +1665,6 @@ impl Pallet { false, true, ) - .0 }) }; let moved_decaying_lock = if old_was_owner { @@ -1731,7 +1677,6 @@ impl Pallet { true, false, ) - .0 }) } else { DecayingHotkeyLock::::take(netuid, old_hotkey).map(|lock| { @@ -1743,7 +1688,6 @@ impl Pallet { false, false, ) - .0 }) }; @@ -1758,8 +1702,7 @@ impl Pallet { maturity_rate, true, true, - ) - .0, + ), ); } else { Self::insert_hotkey_lock_state( @@ -1772,8 +1715,7 @@ impl Pallet { maturity_rate, false, true, - ) - .0, + ), ); } } @@ -1788,8 +1730,7 @@ impl Pallet { maturity_rate, true, false, - ) - .0, + ), ); } else { Self::insert_decaying_hotkey_lock_state( @@ -1802,8 +1743,7 @@ impl Pallet { maturity_rate, false, false, - ) - .0, + ), ); } } @@ -1823,6 +1763,44 @@ impl Pallet { == Self::get_owning_coldkey_for_hotkey(destination_hotkey) } + /// Saves a synchronized source model before re-reading and mutating the + /// destination model. + /// + /// Source and destination can share an aggregate bucket. Re-reading after + /// the source save prevents a stale destination snapshot from restoring a + /// contribution that the source mutation just removed. + fn save_source_then_update_destination( + source_coldkey: &T::AccountId, + source_hotkey: &T::AccountId, + source_model: ConvictionModel, + destination_coldkey: &T::AccountId, + destination_hotkey: &T::AccountId, + netuid: NetUid, + now: u64, + unlock_rate: u64, + maturity_rate: u64, + update_destination: F, + ) where + F: FnOnce(&mut ConvictionModel), + { + Self::save_conviction_model(source_coldkey, netuid, source_hotkey, source_model); + + let mut destination_model = Self::read_conviction_model_for_hotkey( + destination_coldkey, + netuid, + destination_hotkey, + now, + ); + destination_model.roll_forward(now, unlock_rate, maturity_rate); + update_destination(&mut destination_model); + Self::save_conviction_model( + destination_coldkey, + netuid, + destination_hotkey, + destination_model, + ); + } + /// Moves lock from one hotkey to another and clears conviction /// /// The lock is rolled forward to the current block before switching the @@ -1848,8 +1826,7 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); model.roll_forward(now, unlock_rate, maturity_rate); - let mut lock = model.individual_lock().clone(); - let removed = lock.clone(); + let mut lock = model.detach_individual(); if !Self::conviction_survives_hotkey_change(&origin_hotkey, destination_hotkey) { lock.conviction = U64F64::saturating_from_num(0); @@ -1861,13 +1838,24 @@ impl Pallet { maturity_rate, Self::is_subnet_owner_hotkey(netuid, destination_hotkey), Self::is_perpetual_lock(coldkey, netuid), - ) - .0; + ); - model.reduce(removed.locked_mass, removed.conviction); - Self::save_conviction_model(coldkey, netuid, &origin_hotkey, model); - Self::insert_lock_state(coldkey, netuid, destination_hotkey, lock.clone()); - Self::add_aggregate_lock(coldkey, destination_hotkey, netuid, lock); + Self::save_source_then_update_destination( + coldkey, + &origin_hotkey, + model, + coldkey, + destination_hotkey, + netuid, + now, + unlock_rate, + maturity_rate, + move |destination_model| { + let existing = destination_model.detach_individual(); + let combined = ConvictionModel::merge_lock(&existing, &lock); + destination_model.attach_to_detached_individual(combined); + }, + ); Self::deposit_event(Event::LockMoved { coldkey: coldkey.clone(), @@ -1945,7 +1933,6 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); source_model.roll_forward(now, unlock_rate, maturity_rate); - let source_lock_before = source_model.individual_lock().clone(); let mut source_lock = source_model.individual_lock().clone(); let maybe_destination_hotkey = Self::read_conviction_model(destination_coldkey, netuid, now) @@ -2018,63 +2005,42 @@ impl Pallet { maturity_rate, Self::is_subnet_owner_hotkey(netuid, &source_hotkey), Self::is_perpetual_lock(origin_coldkey, netuid), - ) - .0; - let removed_locked_mass = source_lock_before - .locked_mass - .saturating_sub(source_lock.locked_mass); - let removed_conviction = source_lock_before - .conviction - .saturating_sub(source_lock.conviction); - source_model.set_individual_lock(source_lock); - source_model.reduce_aggregate(removed_locked_mass, removed_conviction); - Self::save_conviction_model(origin_coldkey, netuid, &source_hotkey, source_model); + ); + source_model.detach_individual(); + source_model.attach_to_detached_individual(source_lock); if !locked_transfer.is_zero() || maybe_destination_hotkey.is_some() { - // Re-read after saving the source model. Source and destination can share an - // aggregate bucket, so retaining the earlier aggregate snapshot would restore - // the source contribution that was just removed. - let mut destination_model = Self::read_conviction_model_for_hotkey( + let destination_owner_hotkey = destination_lock_hotkey.clone(); + Self::save_source_then_update_destination( + origin_coldkey, + &source_hotkey, + source_model, destination_coldkey, - netuid, &destination_lock_hotkey, - now, - ); - destination_model.roll_forward(now, unlock_rate, maturity_rate); - let destination_lock_before = destination_model.individual_lock().clone(); - let mut destination_lock = destination_lock_before.clone(); - destination_lock.locked_mass = - destination_lock.locked_mass.saturating_add(locked_transfer); - destination_lock.conviction = destination_lock - .conviction - .saturating_add(received_conviction); - destination_lock = ConvictionModel::roll_forward_lock( - destination_lock, + netuid, now, unlock_rate, maturity_rate, - Self::is_subnet_owner_hotkey(netuid, &destination_lock_hotkey), - Self::is_perpetual_lock(destination_coldkey, netuid), - ) - .0; - - let added = LockState { - locked_mass: destination_lock - .locked_mass - .saturating_sub(destination_lock_before.locked_mass), - conviction: destination_lock - .conviction - .saturating_sub(destination_lock_before.conviction), - last_update: now, - }; - destination_model.set_individual_lock(destination_lock); - destination_model.add_to_aggregate(&added); - Self::save_conviction_model( - destination_coldkey, - netuid, - &destination_lock_hotkey, - destination_model, + move |destination_model| { + let mut destination_lock = destination_model.detach_individual(); + destination_lock.locked_mass = + destination_lock.locked_mass.saturating_add(locked_transfer); + destination_lock.conviction = destination_lock + .conviction + .saturating_add(received_conviction); + destination_lock = ConvictionModel::roll_forward_lock( + destination_lock, + now, + unlock_rate, + maturity_rate, + Self::is_subnet_owner_hotkey(netuid, &destination_owner_hotkey), + Self::is_perpetual_lock(destination_coldkey, netuid), + ); + destination_model.attach_to_detached_individual(destination_lock); + }, ); + } else { + Self::save_conviction_model(origin_coldkey, netuid, &source_hotkey, source_model); } Ok(()) diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index 08bc75d140..d531e853ca 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -79,7 +79,6 @@ fn roll_forward_lock( owner_lock, perpetual_lock, ) - .0 } fn roll_forward_individual_lock( @@ -1554,13 +1553,53 @@ fn test_roll_forward_individual_lock_uses_lock_owner_and_decay_mode() { MaturityRate::::get(), true, false, - ) - .0; + ); assert_eq!(rolled, expected); }); } +#[test] +fn test_rolled_individual_is_a_pure_view() { + new_test_ext(1).execute_with(|| { + let individual = LockState { + locked_mass: 10_000u64.into(), + conviction: U64F64::from_num(0), + last_update: 0, + }; + let aggregate = individual.clone(); + let empty = LockState { + locked_mass: AlphaBalance::ZERO, + conviction: U64F64::from_num(0), + last_update: 0, + }; + let model = ConvictionModel::new( + false, + true, + individual.clone(), + aggregate.clone(), + empty.clone(), + empty.clone(), + empty, + ); + + let rolled = model.rolled_individual( + 1_000, + UnlockRate::::get(), + MaturityRate::::get(), + ); + + assert!(rolled.conviction > individual.conviction); + assert_eq!(model.individual_lock(), &individual); + assert_eq!(model.agg_perpetual_general(), &aggregate); + assert!(!model.individual_lock_dirty()); + assert!(!model.agg_perpetual_general_dirty()); + assert!(!model.agg_decaying_general_dirty()); + assert!(!model.agg_perpetual_owner_dirty()); + assert!(!model.agg_decaying_owner_dirty()); + }); +} + #[test] fn test_roll_forward_hotkey_lock_uses_perpetual_general_mode() { new_test_ext(1).execute_with(|| { @@ -1579,8 +1618,7 @@ fn test_roll_forward_hotkey_lock_uses_perpetual_general_mode() { MaturityRate::::get(), false, true, - ) - .0; + ); assert_eq!(rolled, expected); }); @@ -1604,8 +1642,7 @@ fn test_roll_forward_decaying_hotkey_lock_uses_decaying_general_mode() { MaturityRate::::get(), false, false, - ) - .0; + ); assert_eq!(rolled, expected); }); @@ -2369,10 +2406,7 @@ fn test_do_transfer_stake_same_subnet_transfers_lock_to_destination_coldkey() { false, true, ); - assert_eq!( - hotkey_lock_after.locked_mass, - expected_hotkey_lock.locked_mass - ); + assert_eq!(hotkey_lock_after, expected_hotkey_lock); }); } @@ -5040,6 +5074,70 @@ fn test_moving_lock() { }); } +#[test] +fn test_moving_lock_merges_preexisting_destination_individual_and_aggregate() { + new_test_ext(1).execute_with(|| { + let coldkey = U256::from(1); + let hotkey_a = U256::from(2); + let hotkey_b = U256::from(3); + let netuid = setup_subnet_with_stake(coldkey, hotkey_a, 100_000_000_000); + assert_ok!(SubtensorModule::create_account_if_non_existent( + &coldkey, &hotkey_b, + )); + + let now = SubtensorModule::get_current_block_as_u64(); + let lock_a = LockState { + locked_mass: 5_000u64.into(), + conviction: U64F64::from_num(1_000), + last_update: now, + }; + let lock_b = LockState { + locked_mass: 2_000u64.into(), + conviction: U64F64::from_num(300), + last_update: now, + }; + Lock::::insert((coldkey, netuid, hotkey_a), lock_a.clone()); + HotkeyLock::::insert(netuid, hotkey_a, lock_a); + Lock::::insert((coldkey, netuid, hotkey_b), lock_b.clone()); + HotkeyLock::::insert(netuid, hotkey_b, lock_b); + + // Match production's storage-prefix selection instead of assuming a + // numeric hotkey order under the map's hashing scheme. + let (origin_hotkey, origin) = Lock::::iter_prefix((coldkey, netuid)) + .next() + .expect("one source lock should be selected"); + let destination_hotkey = if origin_hotkey == hotkey_a { + hotkey_b + } else { + hotkey_a + }; + let destination = Lock::::get((coldkey, netuid, destination_hotkey)) + .expect("destination lock should exist"); + + assert_ok!(SubtensorModule::do_move_lock( + &coldkey, + &destination_hotkey, + netuid, + )); + + let expected = LockState { + locked_mass: origin.locked_mass.saturating_add(destination.locked_mass), + conviction: origin.conviction.saturating_add(destination.conviction), + last_update: now, + }; + assert!(Lock::::get((coldkey, netuid, origin_hotkey)).is_none()); + assert!(HotkeyLock::::get(netuid, origin_hotkey).is_none()); + assert_eq!( + Lock::::get((coldkey, netuid, destination_hotkey)), + Some(expected.clone()) + ); + assert_eq!( + HotkeyLock::::get(netuid, destination_hotkey), + Some(expected) + ); + }); +} + #[test] fn test_moving_lock_to_subnet_owner_hotkey_gets_owner_conviction_for_non_owner_coldkey() { new_test_ext(1).execute_with(|| { diff --git a/pallets/subtensor/src/tests/migration.rs b/pallets/subtensor/src/tests/migration.rs index 1bb9226396..7c6dc0fdc2 100644 --- a/pallets/subtensor/src/tests/migration.rs +++ b/pallets/subtensor/src/tests/migration.rs @@ -1764,8 +1764,7 @@ fn test_migrate_rebuild_conviction_aggregates_from_individual_locks() { maturity_rate, *owner, *perpetual, - ) - .0, + ), ) }) .collect(); From ebeef5ee5a1c7e91e2cf4351283f7c4b4922aae8 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 7 Aug 2026 15:36:28 -0400 Subject: [PATCH 08/14] Address reviews --- pallets/admin-utils/src/benchmarking.rs | 45 ++- pallets/admin-utils/src/tests/mod.rs | 45 ++- pallets/admin-utils/src/weights.rs | 52 +++- .../subtensor/src/benchmarks/benchmarks.rs | 38 +++ pallets/subtensor/src/macros/hooks.rs | 4 +- .../migrate_fix_subnet_hotkey_lock_swaps.rs | 61 ++-- .../migrate_rebuild_conviction_aggregates.rs | 22 +- pallets/subtensor/src/staking/lock.rs | 285 ++++++++++-------- pallets/subtensor/src/subnets/leasing.rs | 6 + pallets/subtensor/src/subnets/subnet.rs | 9 +- pallets/subtensor/src/tests/leasing.rs | 138 ++++++++- pallets/subtensor/src/tests/migration.rs | 61 ++++ pallets/subtensor/src/weights.rs | 64 ++-- 13 files changed, 616 insertions(+), 214 deletions(-) diff --git a/pallets/admin-utils/src/benchmarking.rs b/pallets/admin-utils/src/benchmarking.rs index 5ae8d3a51a..25c0f56ea5 100644 --- a/pallets/admin-utils/src/benchmarking.rs +++ b/pallets/admin-utils/src/benchmarking.rs @@ -23,6 +23,7 @@ mod benchmarks { use super::*; #[cfg(test)] use crate::tests::mock; + use pallet_subtensor::staking::lock::LockState; use sp_runtime::PerU16; use substrate_fixed::types::{I64F64, U64F64}; use subtensor_runtime_common::{NetUid, TaoBalance}; @@ -622,14 +623,56 @@ mod benchmarks { #[benchmark] fn sudo_set_sn_owner_hotkey() { let netuid = NetUid::from(1); + let old_hotkey: T::AccountId = account("OldOwner", 0, 1); let hotkey: T::AccountId = account("Alice", 0, 1); pallet_subtensor::Pallet::::init_new_network( netuid, 1u16, // tempo ); + pallet_subtensor::SubnetOwnerHotkey::::insert(netuid, &old_hotkey); + let now = pallet_subtensor::Pallet::::get_current_block_as_u64(); + let old_owner_lock = LockState { + locked_mass: 1_000u64.into(), + conviction: U64F64::from_num(1_000), + last_update: now, + }; + let new_owner_lock = LockState { + locked_mass: 2_000u64.into(), + conviction: U64F64::from_num(2_000), + last_update: now, + }; + pallet_subtensor::Pallet::::insert_owner_lock_state(netuid, old_owner_lock.clone()); + pallet_subtensor::Pallet::::insert_decaying_owner_lock_state(netuid, old_owner_lock); + pallet_subtensor::Pallet::::insert_hotkey_lock_state( + netuid, + &hotkey, + new_owner_lock.clone(), + ); + pallet_subtensor::Pallet::::insert_decaying_hotkey_lock_state( + netuid, + &hotkey, + new_owner_lock, + ); #[extrinsic_call] - _(RawOrigin::Root, netuid, hotkey); + _(RawOrigin::Root, netuid, hotkey.clone()); + + assert_eq!( + pallet_subtensor::SubnetOwnerHotkey::::get(netuid), + hotkey + ); + assert!(pallet_subtensor::HotkeyLock::::contains_key( + netuid, + &old_hotkey + )); + assert!(pallet_subtensor::DecayingHotkeyLock::::contains_key( + netuid, + &old_hotkey + )); + assert!(pallet_subtensor::OwnerLock::::contains_key(netuid)); + assert!(pallet_subtensor::DecayingOwnerLock::::contains_key( + netuid + )); } #[benchmark] diff --git a/pallets/admin-utils/src/tests/mod.rs b/pallets/admin-utils/src/tests/mod.rs index a0bf21ed04..55db7407cd 100644 --- a/pallets/admin-utils/src/tests/mod.rs +++ b/pallets/admin-utils/src/tests/mod.rs @@ -8,13 +8,13 @@ use frame_support::{ use frame_system::Config; use pallet_subtensor::{ Error as SubtensorError, Event, MaxRegistrationsPerBlock, SubnetOwner, - TargetRegistrationsPerInterval, Tempo, WeightsVersionKeyRateLimit, + TargetRegistrationsPerInterval, Tempo, WeightsVersionKeyRateLimit, staking::lock::LockState, subnets::mechanism::MAX_MECHANISM_COUNT_PER_SUBNET, utils::rate_limiting::TransactionType, *, }; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{Get, Pair, U256, ed25519}; use sp_runtime::PerU16; -use substrate_fixed::types::I96F32; +use substrate_fixed::types::{I96F32, U64F64}; use subtensor_runtime_common::{MechId, NetUid, TaoBalance, Token}; pub mod mock; use mock::*; @@ -2103,11 +2103,28 @@ fn test_set_sn_owner_hotkey_owner() { fn test_set_sn_owner_hotkey_root() { new_test_ext().execute_with(|| { let netuid = NetUid::from(1); + let old_hotkey = U256::from(2); let hotkey: U256 = U256::from(3); add_network(netuid, 10); let owner = U256::from(10); pallet_subtensor::SubnetOwner::::insert(netuid, owner); + pallet_subtensor::SubnetOwnerHotkey::::insert(netuid, old_hotkey); + let now = SubtensorModule::get_current_block_as_u64(); + let old_owner_lock = LockState { + locked_mass: 1_000u64.into(), + conviction: U64F64::from_num(1_000), + last_update: now, + }; + let new_owner_lock = LockState { + locked_mass: 2_000u64.into(), + conviction: U64F64::from_num(2_000), + last_update: now, + }; + SubtensorModule::insert_owner_lock_state(netuid, old_owner_lock.clone()); + SubtensorModule::insert_decaying_owner_lock_state(netuid, old_owner_lock); + SubtensorModule::insert_hotkey_lock_state(netuid, &hotkey, new_owner_lock.clone()); + SubtensorModule::insert_decaying_hotkey_lock_state(netuid, &hotkey, new_owner_lock); // Root can set the hotkey assert_ok!(AdminUtils::sudo_set_sn_owner_hotkey( @@ -2119,6 +2136,30 @@ fn test_set_sn_owner_hotkey_root() { // Check the value let actual_hotkey = pallet_subtensor::SubnetOwnerHotkey::::get(netuid); assert_eq!(actual_hotkey, hotkey); + assert_eq!( + pallet_subtensor::HotkeyLock::::get(netuid, old_hotkey) + .unwrap() + .locked_mass, + 1_000u64.into() + ); + assert_eq!( + pallet_subtensor::DecayingHotkeyLock::::get(netuid, old_hotkey) + .unwrap() + .locked_mass, + 1_000u64.into() + ); + assert_eq!( + pallet_subtensor::OwnerLock::::get(netuid) + .unwrap() + .locked_mass, + 2_000u64.into() + ); + assert_eq!( + pallet_subtensor::DecayingOwnerLock::::get(netuid) + .unwrap() + .locked_mass, + 2_000u64.into() + ); }); } diff --git a/pallets/admin-utils/src/weights.rs b/pallets/admin-utils/src/weights.rs index 15497f848d..a897dfdb68 100644 --- a/pallets/admin-utils/src/weights.rs +++ b/pallets/admin-utils/src/weights.rs @@ -990,16 +990,28 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:1) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) + /// 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::OwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_sn_owner_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `712` - // Estimated: `4177` - // Minimum execution time: 24_415_000 picoseconds. - Weight::from_parts(25_167_000, 4177) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `1208` + // Estimated: `7148` + // Minimum execution time: 72_000_000 picoseconds. + Weight::from_parts(77_000_000, 7148) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2375,16 +2387,28 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:1) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) + /// 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::OwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_sn_owner_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `712` - // Estimated: `4177` - // Minimum execution time: 24_415_000 picoseconds. - Weight::from_parts(25_167_000, 4177) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Measured: `1208` + // Estimated: `7148` + // Minimum execution time: 72_000_000 picoseconds. + Weight::from_parts(77_000_000, 7148) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().writes(8_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) diff --git a/pallets/subtensor/src/benchmarks/benchmarks.rs b/pallets/subtensor/src/benchmarks/benchmarks.rs index 7e975eb5f6..ee578d868e 100644 --- a/pallets/subtensor/src/benchmarks/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks/benchmarks.rs @@ -1865,6 +1865,22 @@ mod pallet_benchmarks { let lease = SubnetLeases::::get(0).unwrap(); let hotkey = account::("beneficiary_hotkey", 0, 0); let _ = Subtensor::::create_account_if_non_existent(&beneficiary, &hotkey); + let old_owner_hotkey = SubnetOwnerHotkey::::get(lease.netuid); + let now = Subtensor::::get_current_block_as_u64(); + let old_owner_lock = LockState { + locked_mass: 100u64.into(), + conviction: U64F64::from_num(100), + last_update: now, + }; + let new_owner_lock = LockState { + locked_mass: 200u64.into(), + conviction: U64F64::from_num(200), + last_update: now, + }; + Subtensor::::insert_owner_lock_state(lease.netuid, old_owner_lock.clone()); + Subtensor::::insert_decaying_owner_lock_state(lease.netuid, old_owner_lock); + Subtensor::::insert_hotkey_lock_state(lease.netuid, &hotkey, new_owner_lock.clone()); + Subtensor::::insert_decaying_hotkey_lock_state(lease.netuid, &hotkey, new_owner_lock); #[extrinsic_call] _( @@ -1875,6 +1891,28 @@ mod pallet_benchmarks { assert_eq!(SubnetOwner::::get(lease.netuid), beneficiary); assert_eq!(SubnetOwnerHotkey::::get(lease.netuid), hotkey); + assert_eq!( + HotkeyLock::::get(lease.netuid, &old_owner_hotkey) + .unwrap() + .locked_mass, + 100u64.into() + ); + assert_eq!( + DecayingHotkeyLock::::get(lease.netuid, &old_owner_hotkey) + .unwrap() + .locked_mass, + 100u64.into() + ); + assert_eq!( + OwnerLock::::get(lease.netuid).unwrap().locked_mass, + 200u64.into() + ); + assert_eq!( + DecayingOwnerLock::::get(lease.netuid) + .unwrap() + .locked_mass, + 200u64.into() + ); assert_eq!(SubnetLeases::::get(lease_id), None); assert!(!SubnetLeaseShares::::contains_prefix(lease_id)); diff --git a/pallets/subtensor/src/macros/hooks.rs b/pallets/subtensor/src/macros/hooks.rs index 40a7d1d060..f4805dac77 100644 --- a/pallets/subtensor/src/macros/hooks.rs +++ b/pallets/subtensor/src/macros/hooks.rs @@ -171,12 +171,12 @@ mod hooks { .saturating_add(migrations::migrate_dynamic_tempo::migrate_dynamic_tempo::()) // Populate locking reverse map. .saturating_add(migrations::migrate_populate_locking_coldkeys::migrate_populate_locking_coldkeys::()) - // Rebuild conviction aggregates corrupted by partial v443 roll-forward updates. - .saturating_add(migrations::migrate_rebuild_conviction_aggregates::migrate_rebuild_conviction_aggregates::()) // Capture the runtime-upgrade block for TAO-in refund cutover. .saturating_add(migrations::migrate_tao_in_refund_deployment_block::migrate_tao_in_refund_deployment_block::()) // Fix lock state left behind by subnet-scoped hotkey swaps. .saturating_add(migrations::migrate_fix_subnet_hotkey_lock_swaps::migrate_fix_subnet_hotkey_lock_swaps::()) + // Rebuild conviction aggregates after every migration that can rewrite lock rows. + .saturating_add(migrations::migrate_rebuild_conviction_aggregates::migrate_rebuild_conviction_aggregates::()) // Populate reverse lookup index for EVM address associations. .saturating_add(migrations::migrate_associated_evm_address_index::migrate_associated_evm_address_index::()) // Fold deprecated SubnetTaoProvided / SubnetAlphaInProvided residuals into the diff --git a/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs b/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs index 93af663092..ae60ad0c36 100644 --- a/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs +++ b/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs @@ -1,5 +1,5 @@ use super::*; -use crate::staking::lock::LockState; +use crate::staking::lock::{LockClass, LockState}; use frame_support::weights::Weight; use scale_info::prelude::string::String; use sp_core::crypto::Ss58Codec; @@ -140,13 +140,6 @@ fn is_non_zero_lock(lock: &LockState) -> bool { !lock.locked_mass.is_zero() || lock.conviction > U64F64::saturating_from_num(0) } -fn add_lock_state(mut lhs: LockState, rhs: &LockState) -> LockState { - lhs.locked_mass = lhs.locked_mass.saturating_add(rhs.locked_mass); - lhs.conviction = lhs.conviction.saturating_add(rhs.conviction); - lhs.last_update = lhs.last_update.max(rhs.last_update); - lhs -} - fn subtract_lock_state(mut lhs: LockState, rhs: &LockState) -> LockState { lhs.locked_mass = lhs.locked_mass.saturating_sub(rhs.locked_mass); lhs.conviction = lhs.conviction.saturating_sub(rhs.conviction); @@ -164,8 +157,8 @@ fn mutate_aggregate( let perpetual = DecayingLock::::get(coldkey, netuid) == Some(false); let owner = SubnetOwnerHotkey::::get(netuid) == *hotkey; - match (owner, perpetual) { - (true, true) => OwnerLock::::mutate(netuid, |maybe_lock| { + match LockClass::from_roles(owner, perpetual) { + LockClass::PerpetualOwner => OwnerLock::::mutate(netuid, |maybe_lock| { if let Some(lock) = maybe_lock.take() { let updated = mutate(lock); if is_non_zero_lock(&updated) { @@ -173,7 +166,7 @@ fn mutate_aggregate( } } }), - (true, false) => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { + LockClass::DecayingOwner => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { if let Some(lock) = maybe_lock.take() { let updated = mutate(lock); if is_non_zero_lock(&updated) { @@ -181,7 +174,7 @@ fn mutate_aggregate( } } }), - (false, true) => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + LockClass::PerpetualGeneral => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { if let Some(lock) = maybe_lock.take() { let updated = mutate(lock); if is_non_zero_lock(&updated) { @@ -189,14 +182,16 @@ fn mutate_aggregate( } } }), - (false, false) => DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { - if let Some(lock) = maybe_lock.take() { - let updated = mutate(lock); - if is_non_zero_lock(&updated) { - *maybe_lock = Some(updated); + LockClass::DecayingGeneral => { + DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + if let Some(lock) = maybe_lock.take() { + let updated = mutate(lock); + if is_non_zero_lock(&updated) { + *maybe_lock = Some(updated); + } } - } - }), + }) + } } } @@ -209,31 +204,33 @@ fn add_to_aggregate( let perpetual = DecayingLock::::get(coldkey, netuid) == Some(false); let owner = SubnetOwnerHotkey::::get(netuid) == *hotkey; - match (owner, perpetual) { - (true, true) => OwnerLock::::mutate(netuid, |maybe_lock| { - *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => add_lock_state(lock, added), - None => added.clone(), - }); - }), - (true, false) => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { + match LockClass::from_roles(owner, perpetual) { + LockClass::PerpetualOwner => OwnerLock::::mutate(netuid, |maybe_lock| { *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => add_lock_state(lock, added), + Some(lock) => lock.merge(added), None => added.clone(), }); }), - (false, true) => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + LockClass::DecayingOwner => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => add_lock_state(lock, added), + Some(lock) => lock.merge(added), None => added.clone(), }); }), - (false, false) => DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + LockClass::PerpetualGeneral => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => add_lock_state(lock, added), + Some(lock) => lock.merge(added), None => added.clone(), }); }), + LockClass::DecayingGeneral => { + DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + *maybe_lock = Some(match maybe_lock.take() { + Some(lock) => lock.merge(added), + None => added.clone(), + }); + }) + } } } diff --git a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs index 2c4ef96ba8..6bf328e536 100644 --- a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs +++ b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs @@ -4,9 +4,9 @@ use frame_support::{traits::Get, weights::Weight}; use crate::{ Config, DecayingHotkeyLock, DecayingLock, DecayingOwnerLock, HasMigrationRun, HotkeyLock, Lock, LockingColdkeys, MaturityRate, OwnerLock, Pallet as Subtensor, SubnetOwnerHotkey, UnlockRate, - staking::lock::{ConvictionModel, LockState}, + staking::lock::{ConvictionModel, LockClass, LockState}, }; -use subtensor_runtime_common::{NetUid, Token}; +use subtensor_runtime_common::NetUid; const MIGRATION_NAME: &[u8] = b"migrate_rebuild_conviction_aggregates"; @@ -24,15 +24,9 @@ const OBSERVED_MAINNET_AGGREGATE_ROWS: u64 = 193; const OBSERVED_MAINNET_MAX_LOCKS_PER_SUBNET: u64 = 44; const OBSERVED_MAINNET_BLOCK: u64 = 8_793_919; -fn merge_lock(lhs: &mut LockState, rhs: &LockState) { - lhs.locked_mass = lhs.locked_mass.saturating_add(rhs.locked_mass); - lhs.conviction = lhs.conviction.saturating_add(rhs.conviction); - lhs.last_update = lhs.last_update.max(rhs.last_update); -} - fn merge_into(aggregates: &mut BTreeMap, key: K, lock: &LockState) { if let Some(aggregate) = aggregates.get_mut(&key) { - merge_lock(aggregate, lock); + *aggregate = aggregate.merge(lock); } else { aggregates.insert(key, lock.clone()); } @@ -143,13 +137,13 @@ pub fn migrate_rebuild_conviction_aggregates() -> Weight { retained_count = retained_count.saturating_add(1); weight = weight.saturating_add(T::DbWeight::get().writes(2)); - match (owner_lock, perpetual_lock) { - (true, true) => merge_into(&mut perpetual_owner, netuid, &rolled), - (true, false) => merge_into(&mut decaying_owner, netuid, &rolled), - (false, true) => { + match LockClass::from_roles(owner_lock, perpetual_lock) { + LockClass::PerpetualOwner => merge_into(&mut perpetual_owner, netuid, &rolled), + LockClass::DecayingOwner => merge_into(&mut decaying_owner, netuid, &rolled), + LockClass::PerpetualGeneral => { merge_into(&mut perpetual_general, (netuid, hotkey), &rolled); } - (false, false) => { + LockClass::DecayingGeneral => { merge_into(&mut decaying_general, (netuid, hotkey), &rolled); } } diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 79cbe2c975..8a331765a4 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -29,6 +29,41 @@ impl LockState { self.locked_mass < AlphaBalance::from(LOCK_STATE_ZERO_THRESHOLD) && self.conviction < U64F64::saturating_from_num(LOCK_STATE_ZERO_THRESHOLD) } + + pub(crate) fn merge(&self, other: &Self) -> Self { + Self { + locked_mass: self.locked_mass.saturating_add(other.locked_mass), + conviction: self.conviction.saturating_add(other.conviction), + last_update: self.last_update.max(other.last_update), + } + } +} + +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub(crate) enum LockClass { + PerpetualGeneral, + DecayingGeneral, + PerpetualOwner, + DecayingOwner, +} + +impl LockClass { + pub(crate) fn from_roles(owner: bool, perpetual: bool) -> Self { + match (owner, perpetual) { + (false, true) => Self::PerpetualGeneral, + (false, false) => Self::DecayingGeneral, + (true, true) => Self::PerpetualOwner, + (true, false) => Self::DecayingOwner, + } + } + + fn is_owner(self) -> bool { + matches!(self, Self::PerpetualOwner | Self::DecayingOwner) + } + + fn is_perpetual(self) -> bool { + matches!(self, Self::PerpetualGeneral | Self::PerpetualOwner) + } } #[derive(Clone, Copy, PartialEq, Eq, Debug)] @@ -52,10 +87,8 @@ impl From<&LockState> for LockContribution { /// This model has one individual lock state, which relates to the stake owner /// (locking coldkey) lock and 4 aggregates that are maintained in operations. pub struct ConvictionModel { - /// Whether this model's individual lock targets the subnet owner hotkey. - owner_lock: bool, - /// Whether this model's individual lock uses the non-decaying lock mode. - perpetual_lock: bool, + /// Aggregate bucket selected by the individual lock's owner role and lock mode. + lock_class: LockClass, /// Individual stake owner coldkey lock individual_lock: LockState, individual_lock_dirty: bool, @@ -84,8 +117,7 @@ impl ConvictionModel { agg_decaying_owner: LockState, ) -> Self { Self { - owner_lock, - perpetual_lock, + lock_class: LockClass::from_roles(owner_lock, perpetual_lock), individual_lock, individual_lock_dirty: false, agg_perpetual_general, @@ -120,14 +152,11 @@ impl ConvictionModel { } pub fn aggregate_lock(&self) -> &LockState { - if self.owner_lock && self.perpetual_lock { - &self.agg_perpetual_owner - } else if self.owner_lock { - &self.agg_decaying_owner - } else if self.perpetual_lock { - &self.agg_perpetual_general - } else { - &self.agg_decaying_general + match self.lock_class { + LockClass::PerpetualGeneral => &self.agg_perpetual_general, + LockClass::DecayingGeneral => &self.agg_decaying_general, + LockClass::PerpetualOwner => &self.agg_perpetual_owner, + LockClass::DecayingOwner => &self.agg_decaying_owner, } } @@ -152,19 +181,17 @@ impl ConvictionModel { } pub fn merge(&mut self, conv: &ConvictionModel) { - self.individual_lock = Self::merge_lock(&self.individual_lock, &conv.individual_lock); + self.individual_lock = self.individual_lock.merge(&conv.individual_lock); self.individual_lock_dirty = true; - self.agg_perpetual_general = - Self::merge_lock(&self.agg_perpetual_general, &conv.agg_perpetual_general); + self.agg_perpetual_general = self + .agg_perpetual_general + .merge(&conv.agg_perpetual_general); self.agg_perpetual_general_dirty = true; - self.agg_decaying_general = - Self::merge_lock(&self.agg_decaying_general, &conv.agg_decaying_general); + self.agg_decaying_general = self.agg_decaying_general.merge(&conv.agg_decaying_general); self.agg_decaying_general_dirty = true; - self.agg_perpetual_owner = - Self::merge_lock(&self.agg_perpetual_owner, &conv.agg_perpetual_owner); + self.agg_perpetual_owner = self.agg_perpetual_owner.merge(&conv.agg_perpetual_owner); self.agg_perpetual_owner_dirty = true; - self.agg_decaying_owner = - Self::merge_lock(&self.agg_decaying_owner, &conv.agg_decaying_owner); + self.agg_decaying_owner = self.agg_decaying_owner.merge(&conv.agg_decaying_owner); self.agg_decaying_owner_dirty = true; } @@ -184,8 +211,8 @@ impl ConvictionModel { now, unlock_rate, maturity_rate, - self.owner_lock, - self.perpetual_lock, + self.lock_class.is_owner(), + self.lock_class.is_perpetual(), ); self.attach_to_detached_individual(lock); self.roll_forward_aggregate(now, unlock_rate, maturity_rate); @@ -199,8 +226,8 @@ impl ConvictionModel { now, unlock_rate, maturity_rate, - self.owner_lock, - self.perpetual_lock, + self.lock_class.is_owner(), + self.lock_class.is_perpetual(), ) } @@ -238,8 +265,8 @@ impl ConvictionModel { /// then merge them again. This prevents both skipping sibling evolution /// and applying an individual's evolution twice. pub fn roll_forward(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { - let owner_lock = self.owner_lock; - let perpetual_lock = self.perpetual_lock; + let owner_lock = self.lock_class.is_owner(); + let perpetual_lock = self.lock_class.is_perpetual(); let aggregate_last_update = self.aggregate_lock().last_update; let anchor = aggregate_last_update.max(self.individual_lock.last_update); @@ -286,7 +313,7 @@ impl ConvictionModel { owner_lock, perpetual_lock, ); - let rolled_aggregate = Self::merge_lock(&rolled_siblings, &rolled_individual); + let rolled_aggregate = rolled_siblings.merge(&rolled_individual); self.individual_lock = rolled_individual; self.individual_lock_dirty = true; @@ -296,8 +323,8 @@ impl ConvictionModel { } fn roll_forward_aggregate(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { - let owner_lock = self.owner_lock; - let perpetual_lock = self.perpetual_lock; + let owner_lock = self.lock_class.is_owner(); + let perpetual_lock = self.lock_class.is_perpetual(); let (aggregate, aggregate_dirty) = self.aggregate_mut(); *aggregate = Self::roll_forward_lock( aggregate.clone(), @@ -357,34 +384,23 @@ impl ConvictionModel { } fn aggregate_mut(&mut self) -> (&mut LockState, &mut bool) { - if self.owner_lock && self.perpetual_lock { - ( - &mut self.agg_perpetual_owner, - &mut self.agg_perpetual_owner_dirty, - ) - } else if self.owner_lock { - ( - &mut self.agg_decaying_owner, - &mut self.agg_decaying_owner_dirty, - ) - } else if self.perpetual_lock { - ( + match self.lock_class { + LockClass::PerpetualGeneral => ( &mut self.agg_perpetual_general, &mut self.agg_perpetual_general_dirty, - ) - } else { - ( + ), + LockClass::DecayingGeneral => ( &mut self.agg_decaying_general, &mut self.agg_decaying_general_dirty, - ) - } - } - - fn merge_lock(lhs: &LockState, rhs: &LockState) -> LockState { - LockState { - locked_mass: lhs.locked_mass.saturating_add(rhs.locked_mass), - conviction: lhs.conviction.saturating_add(rhs.conviction), - last_update: lhs.last_update.max(rhs.last_update), + ), + LockClass::PerpetualOwner => ( + &mut self.agg_perpetual_owner, + &mut self.agg_perpetual_owner_dirty, + ), + LockClass::DecayingOwner => ( + &mut self.agg_decaying_owner, + &mut self.agg_decaying_owner_dirty, + ), } } @@ -1193,67 +1209,21 @@ impl Pallet { .map(|(hotkey, _)| hotkey) } - /// Reassigns subnet ownership to the current lock-conviction leader when the subnet - /// is mature enough and enough conviction has accumulated. + /// Reclassify aggregate lock buckets when a subnet's owner hotkey changes. /// - /// Ownership can change only after the subnet is at least [`ONE_YEAR`] old and the - /// hotkey with the highest rolled aggregate conviction itself holds at least 10% of - /// `SubnetAlphaOut`. If those gates pass, that hotkey becomes the subnet owner - /// hotkey, and its owning coldkey becomes the subnet owner coldkey. The new owner - /// hotkey's conviction is then progressed to its current locked mass so the new - /// owner starts with full owner conviction. - pub fn change_subnet_owner_if_needed(netuid: NetUid) { - // No outstanding alpha means there is no meaningful 10% conviction threshold. - let subnet_alpha_out = SubnetAlphaOut::::get(netuid); - if subnet_alpha_out.is_zero() { - return; - } - - // Ownership can only be reassigned after the subnet has aged for one year. + /// The outgoing owner's aggregate becomes an ordinary hotkey aggregate, while + /// the incoming hotkey's aggregate becomes the owner aggregate. This must run + /// before updating [`SubnetOwnerHotkey`] so both buckets are interpreted using + /// their old roles while they are rolled forward. + pub(crate) fn transition_subnet_owner_lock_aggregates( + netuid: NetUid, + old_owner_hotkey: &T::AccountId, + new_owner_hotkey: &T::AccountId, + ) { let now = Self::get_current_block_as_u64(); - let registered_at = NetworkRegisteredAt::::get(netuid); - if now < registered_at.saturating_add(ONE_YEAR) { - return; - } - - // Pick the hotkey with the highest rolled aggregate conviction. - let Some(king_hotkey) = Self::subnet_king(netuid) else { - return; - }; - - // The challenger must itself hold at least 10% of subnet alpha out. - // Gating on subnet-wide conviction would let unrelated lockers, - // including the incumbent, supply the challenger's quorum. - let king_conviction = Self::hotkey_conviction(&king_hotkey, netuid); - if king_conviction.saturating_mul(U64F64::saturating_from_num(10)) - < U64F64::saturating_from_num(u64::from(subnet_alpha_out)) - { - return; - } - - // The king hotkey must resolve to a real coldkey owner. - let new_owner_coldkey = Self::get_owning_coldkey_for_hotkey(&king_hotkey); - if new_owner_coldkey == DefaultAccount::::get() { - return; - } - - // If the winning hotkey already belongs to the current owner, nothing changes. - let current_owner_coldkey = SubnetOwner::::get(netuid); - if new_owner_coldkey == current_owner_coldkey { - return; - } - let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - // Register new owner as a neuron if not yet registered. - if Self::get_uid_for_net_and_hotkey(netuid, &king_hotkey).is_err() - && Self::register_neuron(netuid, &king_hotkey).is_err() - { - return; - } - - // Move aggregate buckets using the hotkey's new role. if let Some(owner_lock) = OwnerLock::::take(netuid) { let moved_owner_lock = ConvictionModel::roll_forward_lock( owner_lock, @@ -1263,7 +1233,7 @@ impl Pallet { true, true, ); - let current = HotkeyLock::::get(netuid, &old_owner_hotkey) + let current = HotkeyLock::::get(netuid, old_owner_hotkey) .map(|lock| { ConvictionModel::roll_forward_lock( lock, @@ -1277,7 +1247,7 @@ impl Pallet { .unwrap_or_else(|| Self::empty_lock(now)); Self::insert_hotkey_lock_state( netuid, - &old_owner_hotkey, + old_owner_hotkey, LockState { locked_mass: current .locked_mass @@ -1298,7 +1268,7 @@ impl Pallet { true, false, ); - let current = DecayingHotkeyLock::::get(netuid, &old_owner_hotkey) + let current = DecayingHotkeyLock::::get(netuid, old_owner_hotkey) .map(|lock| { ConvictionModel::roll_forward_lock( lock, @@ -1312,7 +1282,7 @@ impl Pallet { .unwrap_or_else(|| Self::empty_lock(now)); Self::insert_decaying_hotkey_lock_state( netuid, - &old_owner_hotkey, + old_owner_hotkey, LockState { locked_mass: current .locked_mass @@ -1324,9 +1294,9 @@ impl Pallet { }, ); } - if let Some(king_lock) = HotkeyLock::::take(netuid, &king_hotkey) { - let moved_king_lock = ConvictionModel::roll_forward_lock( - king_lock, + if let Some(new_owner_lock) = HotkeyLock::::take(netuid, new_owner_hotkey) { + let moved_new_owner_lock = ConvictionModel::roll_forward_lock( + new_owner_lock, now, unlock_rate, maturity_rate, @@ -1351,10 +1321,10 @@ impl Pallet { LockState { locked_mass: current .locked_mass - .saturating_add(moved_king_lock.locked_mass), + .saturating_add(moved_new_owner_lock.locked_mass), conviction: current .conviction - .saturating_add(moved_king_lock.conviction), + .saturating_add(moved_new_owner_lock.conviction), last_update: now, }, now, @@ -1365,9 +1335,9 @@ impl Pallet { ), ); } - if let Some(king_lock) = DecayingHotkeyLock::::take(netuid, &king_hotkey) { - let moved_king_lock = ConvictionModel::roll_forward_lock( - king_lock, + if let Some(new_owner_lock) = DecayingHotkeyLock::::take(netuid, new_owner_hotkey) { + let moved_new_owner_lock = ConvictionModel::roll_forward_lock( + new_owner_lock, now, unlock_rate, maturity_rate, @@ -1392,10 +1362,10 @@ impl Pallet { LockState { locked_mass: current .locked_mass - .saturating_add(moved_king_lock.locked_mass), + .saturating_add(moved_new_owner_lock.locked_mass), conviction: current .conviction - .saturating_add(moved_king_lock.conviction), + .saturating_add(moved_new_owner_lock.conviction), last_update: now, }, now, @@ -1406,6 +1376,67 @@ impl Pallet { ), ); } + } + + /// Reassigns subnet ownership to the current lock-conviction leader when the subnet + /// is mature enough and enough conviction has accumulated. + /// + /// Ownership can change only after the subnet is at least [`ONE_YEAR`] old and the + /// hotkey with the highest rolled aggregate conviction itself holds at least 10% of + /// `SubnetAlphaOut`. If those gates pass, that hotkey becomes the subnet owner + /// hotkey, and its owning coldkey becomes the subnet owner coldkey. The new owner + /// hotkey's conviction is then progressed to its current locked mass so the new + /// owner starts with full owner conviction. + pub fn change_subnet_owner_if_needed(netuid: NetUid) { + // No outstanding alpha means there is no meaningful 10% conviction threshold. + let subnet_alpha_out = SubnetAlphaOut::::get(netuid); + if subnet_alpha_out.is_zero() { + return; + } + + // Ownership can only be reassigned after the subnet has aged for one year. + let now = Self::get_current_block_as_u64(); + let registered_at = NetworkRegisteredAt::::get(netuid); + if now < registered_at.saturating_add(ONE_YEAR) { + return; + } + + // Pick the hotkey with the highest rolled aggregate conviction. + let Some(king_hotkey) = Self::subnet_king(netuid) else { + return; + }; + + // The challenger must itself hold at least 10% of subnet alpha out. + // Gating on subnet-wide conviction would let unrelated lockers, + // including the incumbent, supply the challenger's quorum. + let king_conviction = Self::hotkey_conviction(&king_hotkey, netuid); + if king_conviction.saturating_mul(U64F64::saturating_from_num(10)) + < U64F64::saturating_from_num(u64::from(subnet_alpha_out)) + { + return; + } + + // The king hotkey must resolve to a real coldkey owner. + let new_owner_coldkey = Self::get_owning_coldkey_for_hotkey(&king_hotkey); + if new_owner_coldkey == DefaultAccount::::get() { + return; + } + + // If the winning hotkey already belongs to the current owner, nothing changes. + let current_owner_coldkey = SubnetOwner::::get(netuid); + if new_owner_coldkey == current_owner_coldkey { + return; + } + let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); + + // Register new owner as a neuron if not yet registered. + if Self::get_uid_for_net_and_hotkey(netuid, &king_hotkey).is_err() + && Self::register_neuron(netuid, &king_hotkey).is_err() + { + return; + } + + Self::transition_subnet_owner_lock_aggregates(netuid, &old_owner_hotkey, &king_hotkey); // Reassign subnet owner coldkey and owner hotkey. SubnetOwner::::insert(netuid, new_owner_coldkey.clone()); @@ -1852,7 +1883,7 @@ impl Pallet { maturity_rate, move |destination_model| { let existing = destination_model.detach_individual(); - let combined = ConvictionModel::merge_lock(&existing, &lock); + let combined = existing.merge(&lock); destination_model.attach_to_detached_individual(combined); }, ); diff --git a/pallets/subtensor/src/subnets/leasing.rs b/pallets/subtensor/src/subnets/leasing.rs index 3aa08b6db1..e69e5a1110 100644 --- a/pallets/subtensor/src/subnets/leasing.rs +++ b/pallets/subtensor/src/subnets/leasing.rs @@ -202,6 +202,12 @@ impl Pallet { Self::coldkey_owns_hotkey(&lease.beneficiary, &hotkey), Error::::BeneficiaryDoesNotOwnHotkey ); + ensure!( + Self::is_subnet_account_id(&hotkey).is_none(), + Error::::CannotUseSystemAccount + ); + let old_owner_hotkey = SubnetOwnerHotkey::::get(lease.netuid); + Self::transition_subnet_owner_lock_aggregates(lease.netuid, &old_owner_hotkey, &hotkey); SubnetOwner::::insert(lease.netuid, lease.beneficiary.clone()); Self::set_subnet_owner_hotkey(lease.netuid, &hotkey)?; diff --git a/pallets/subtensor/src/subnets/subnet.rs b/pallets/subtensor/src/subnets/subnet.rs index ad97baac3e..656d53d34e 100644 --- a/pallets/subtensor/src/subnets/subnet.rs +++ b/pallets/subtensor/src/subnets/subnet.rs @@ -620,7 +620,14 @@ impl Pallet { current_block, ); - // Insert/update the hotkey + ensure!( + Self::is_subnet_account_id(hotkey).is_none(), + Error::::CannotUseSystemAccount + ); + let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); + Self::transition_subnet_owner_lock_aggregates(netuid, &old_owner_hotkey, hotkey); + + // Insert/update the hotkey after reclassifying aggregates under their old roles. Self::set_subnet_owner_hotkey(netuid, hotkey)?; // Return success. diff --git a/pallets/subtensor/src/tests/leasing.rs b/pallets/subtensor/src/tests/leasing.rs index 0bc00d139d..b27a05b32a 100644 --- a/pallets/subtensor/src/tests/leasing.rs +++ b/pallets/subtensor/src/tests/leasing.rs @@ -4,7 +4,7 @@ clippy::indexing_slicing )] use super::mock::*; -use crate::{subnets::leasing::SubnetLeaseOf, *}; +use crate::{staking::lock::LockState, subnets::leasing::SubnetLeaseOf, *}; use frame_support::{StorageDoubleMap, assert_err, assert_ok}; use sp_core::U256; use sp_runtime::Percent; @@ -329,6 +329,142 @@ fn test_terminate_lease_works() { }); } +#[test] +fn test_terminate_lease_reclassifies_locks_and_prevents_stale_beneficiary_takeover() { + new_test_ext(1).execute_with(|| { + let beneficiary = U256::from(1); + let contributions = vec![(U256::from(2), 990_000_000_000)]; + setup_crowdloan( + 0, + 10_000_000_000, + 1_000_000_000_000, + beneficiary, + &contributions, + ); + let (lease_id, lease) = + setup_leased_network(beneficiary, Percent::from_percent(30), Some(500), None); + + let beneficiary_hotkey = U256::from(3); + let challenger_coldkey = U256::from(4); + let challenger_hotkey = U256::from(5); + let old_owner_locker = U256::from(6); + assert_ok!(SubtensorModule::create_account_if_non_existent( + &beneficiary, + &beneficiary_hotkey + )); + assert_ok!(SubtensorModule::create_account_if_non_existent( + &challenger_coldkey, + &challenger_hotkey + )); + + let registered_at = NetworkRegisteredAt::::get(lease.netuid); + let now = registered_at + .saturating_add(crate::staking::lock::ONE_YEAR) + .saturating_add(1); + System::set_block_number(now); + SubnetAlphaOut::::insert(lease.netuid, AlphaBalance::from(10_000u64)); + + // The lease owner has 11% conviction, while a legitimate challenger has 12%. + // Keep matching individual rows so later force reductions exercise the same + // model path that would expose a stale beneficiary bucket. + let old_owner_lock = LockState { + locked_mass: 1_100u64.into(), + conviction: U64F64::from_num(1_100), + last_update: now, + }; + DecayingLock::::insert(old_owner_locker, lease.netuid, false); + SubtensorModule::insert_lock_state( + &old_owner_locker, + lease.netuid, + &lease.hotkey, + old_owner_lock.clone(), + ); + SubtensorModule::insert_owner_lock_state(lease.netuid, old_owner_lock); + + let challenger_lock = LockState { + locked_mass: 1_200u64.into(), + conviction: U64F64::from_num(1_200), + last_update: now, + }; + DecayingLock::::insert(challenger_coldkey, lease.netuid, false); + SubtensorModule::insert_lock_state( + &challenger_coldkey, + lease.netuid, + &challenger_hotkey, + challenger_lock.clone(), + ); + SubtensorModule::insert_hotkey_lock_state( + lease.netuid, + &challenger_hotkey, + challenger_lock, + ); + let beneficiary_lock = LockState { + locked_mass: 100u64.into(), + conviction: U64F64::from_num(100), + last_update: now, + }; + DecayingLock::::insert(beneficiary, lease.netuid, false); + SubtensorModule::insert_lock_state( + &beneficiary, + lease.netuid, + &beneficiary_hotkey, + beneficiary_lock.clone(), + ); + SubtensorModule::insert_hotkey_lock_state( + lease.netuid, + &beneficiary_hotkey, + beneficiary_lock, + ); + + assert_ok!(SubtensorModule::terminate_lease( + RuntimeOrigin::signed(beneficiary), + lease_id, + beneficiary_hotkey, + )); + + // Lease termination must move the outgoing owner's contribution to its + // hotkey bucket instead of leaving it in the owner bucket now attributed + // to the beneficiary. Only the beneficiary's real 1% lock becomes owner + // conviction. + assert_eq!( + OwnerLock::::get(lease.netuid).unwrap().locked_mass, + 100u64.into() + ); + assert_eq!( + HotkeyLock::::get(lease.netuid, lease.hotkey) + .unwrap() + .locked_mass, + 1_100u64.into() + ); + assert!(HotkeyLock::::get(lease.netuid, beneficiary_hotkey).is_none()); + + // The 12% challenger can take over normally. + SubtensorModule::change_subnet_owner_if_needed(lease.netuid); + assert_eq!( + SubnetOwnerHotkey::::get(lease.netuid), + challenger_hotkey + ); + + // Remove both real contributions. Without the lease transition fix, the + // former owner's 11% remains orphaned in the beneficiary bucket and lets + // the beneficiary retake the subnet despite holding only 1% canonically. + SubtensorModule::force_reduce_lock(&old_owner_locker, lease.netuid, 1_100u64.into()); + SubtensorModule::force_reduce_lock(&challenger_coldkey, lease.netuid, 1_200u64.into()); + SubtensorModule::change_subnet_owner_if_needed(lease.netuid); + + assert_eq!( + SubnetOwnerHotkey::::get(lease.netuid), + challenger_hotkey + ); + assert_eq!( + HotkeyLock::::get(lease.netuid, beneficiary_hotkey) + .unwrap() + .conviction, + U64F64::from_num(100) + ); + }); +} + #[test] fn test_terminate_lease_fails_if_bad_origin() { new_test_ext(1).execute_with(|| { diff --git a/pallets/subtensor/src/tests/migration.rs b/pallets/subtensor/src/tests/migration.rs index 7c6dc0fdc2..3b188f912a 100644 --- a/pallets/subtensor/src/tests/migration.rs +++ b/pallets/subtensor/src/tests/migration.rs @@ -369,6 +369,67 @@ fn test_migrate_fix_subnet_hotkey_lock_swaps_moves_or_discards_conflicts() { ); }); } + +#[test] +fn test_runtime_upgrade_fixes_hotkey_swaps_before_rebuilding_aggregates() { + new_test_ext(1).execute_with(|| { + const REMOVE_DEPRECATED_MIGRATION: &[u8] = b"migrate_remove_deprecated_conviction_maps"; + const RESET_MIGRATION: &[u8] = b"migrate_reset_tnet_conviction_locks"; + const SWAP_FIX_MIGRATION: &[u8] = b"migrate_fix_subnet_hotkey_lock_swaps"; + const REBUILD_MIGRATION: &[u8] = b"migrate_rebuild_conviction_aggregates"; + + let old_hotkey = + decode_account_id32::("5Ca8L8PkbqXUtzohKtSM3i1naGQxANGLx51kJsEPNB14Admz") + .expect("old hotkey should decode"); + let new_owner_hotkey = + decode_account_id32::("5Evgh9QTXJLxYLusVy3tcY5S6Z3GgRSNDb9AzXUchX5dco3P") + .expect("new owner hotkey should decode"); + let coldkey = U256::from(28_001); + let netuid = NetUid::from(28); + let lock = LockState { + locked_mass: AlphaBalance::from(10_000_u64), + conviction: U64F64::from_num(10_000), + last_update: 1, + }; + + // Preserve the fixture from the older reset migration while leaving both migrations + // under test pending, exactly as they can be on a runtime upgrade. + HasMigrationRun::::insert(REMOVE_DEPRECATED_MIGRATION, true); + HasMigrationRun::::insert(RESET_MIGRATION, true); + HasMigrationRun::::remove(SWAP_FIX_MIGRATION); + HasMigrationRun::::remove(REBUILD_MIGRATION); + + SubnetOwnerHotkey::::insert(netuid, new_owner_hotkey); + DecayingLock::::insert(coldkey, netuid, false); + Lock::::insert((coldkey, netuid, old_hotkey), lock.clone()); + LockingColdkeys::::insert((netuid, old_hotkey, coldkey), ()); + + // The historical subnet hotkey swap transitioned the aggregate only. The swap-fix + // migration relies on this owner aggregate when moving the canonical individual row. + OwnerLock::::insert(netuid, lock.clone()); + + let _ = as Hooks>::on_runtime_upgrade(); + + assert!(HasMigrationRun::::get(SWAP_FIX_MIGRATION)); + assert!(HasMigrationRun::::get(REBUILD_MIGRATION)); + assert!(Lock::::get((coldkey, netuid, old_hotkey)).is_none()); + assert_eq!( + Lock::::get((coldkey, netuid, new_owner_hotkey)), + Some(lock.clone()) + ); + assert!(!LockingColdkeys::::contains_key(( + netuid, old_hotkey, coldkey + ))); + assert!(LockingColdkeys::::contains_key(( + netuid, + new_owner_hotkey, + coldkey + ))); + assert!(HotkeyLock::::get(netuid, old_hotkey).is_none()); + assert_eq!(OwnerLock::::get(netuid), Some(lock)); + }); +} + #[test] fn test_migration_transfer_nets_to_foundation() { new_test_ext(1).execute_with(|| { diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 004618afd2..a8ccbb9996 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2600,6 +2600,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetLeases` (`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::SubnetOwnerHotkey` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) + /// 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::OwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetLeaseShares` (r:499 w:499) @@ -2612,22 +2626,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) - /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AccumulatedLeaseDividends` (r:0 w:1) /// Proof: `SubtensorModule::AccumulatedLeaseDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[2, 500]`. fn terminate_lease(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1501 + k * (53 ±0)` - // Estimated: `6148 + k * (2529 ±0)` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(50_239_437, 6148) - // Standard Error: 5_020 - .saturating_add(Weight::from_parts(1_091_523, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Measured: `2111 + k * (53 ±0)` + // Estimated: `8054 + k * (2529 ±0)` + // Minimum execution time: 87_000_000 picoseconds. + Weight::from_parts(93_461_390, 8054) + // Standard Error: 4_516 + .saturating_add(Weight::from_parts(1_356_955, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(8_u64)) + .saturating_add(T::DbWeight::get().writes(14_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) } @@ -6223,6 +6235,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetLeases` (`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::SubnetOwnerHotkey` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) + /// 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::OwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetLeaseShares` (r:499 w:499) @@ -6235,22 +6261,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) - /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AccumulatedLeaseDividends` (r:0 w:1) /// Proof: `SubtensorModule::AccumulatedLeaseDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[2, 500]`. fn terminate_lease(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1501 + k * (53 ±0)` - // Estimated: `6148 + k * (2529 ±0)` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(50_239_437, 6148) - // Standard Error: 5_020 - .saturating_add(Weight::from_parts(1_091_523, 0).saturating_mul(k.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Measured: `2111 + k * (53 ±0)` + // Estimated: `8054 + k * (2529 ±0)` + // Minimum execution time: 87_000_000 picoseconds. + Weight::from_parts(93_461_390, 8054) + // Standard Error: 4_516 + .saturating_add(Weight::from_parts(1_356_955, 0).saturating_mul(k.into())) + .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) - .saturating_add(RocksDbWeight::get().writes(8_u64)) + .saturating_add(RocksDbWeight::get().writes(14_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) } From 78f7903be72a7d44d518968444fede4a27c0e697 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 7 Aug 2026 15:43:51 -0400 Subject: [PATCH 09/14] Fix build --- precompiles/src/staking.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/precompiles/src/staking.rs b/precompiles/src/staking.rs index 656af18226..09dba7e93a 100644 --- a/precompiles/src/staking.rs +++ b/precompiles/src/staking.rs @@ -573,7 +573,7 @@ where let now = pallet_subtensor::Pallet::::get_current_block_as_u64(); let owner_lock = hotkey == pallet_subtensor::SubnetOwnerHotkey::::get(netuid); - let (lock, _) = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( + let lock = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( lock, now, pallet_subtensor::UnlockRate::::get(), @@ -618,7 +618,7 @@ where owner_lock: bool, perpetual_lock: bool| { if let Some(lock) = maybe_lock { - let (lock, _) = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( + let lock = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( lock, now, unlock_rate, @@ -2920,15 +2920,14 @@ mod tests { frame_system::Pallet::::set_block_number(100); let raw_lock = pallet_subtensor::Lock::::get((&coldkey, netuid, &hotkey)) .expect("stale individual lock remains in storage"); - let (rolled_lock, _) = - pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( - raw_lock, - 100, - pallet_subtensor::UnlockRate::::get(), - pallet_subtensor::MaturityRate::::get(), - true, - false, - ); + let rolled_lock = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( + raw_lock, + 100, + pallet_subtensor::UnlockRate::::get(), + pallet_subtensor::MaturityRate::::get(), + true, + false, + ); assert!(rolled_lock.is_zero()); precompiles From bbce4bee13fc5fd63b3cdfce8f64728d3d73fb09 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 7 Aug 2026 18:36:44 -0400 Subject: [PATCH 10/14] address review --- pallets/admin-utils/src/tests/mod.rs | 52 ++++-- pallets/subtensor/src/staking/lock.rs | 235 ++++++++++---------------- pallets/subtensor/src/tests/locks.rs | 81 +++++++++ 3 files changed, 205 insertions(+), 163 deletions(-) diff --git a/pallets/admin-utils/src/tests/mod.rs b/pallets/admin-utils/src/tests/mod.rs index 55db7407cd..116bf7ef84 100644 --- a/pallets/admin-utils/src/tests/mod.rs +++ b/pallets/admin-utils/src/tests/mod.rs @@ -2108,6 +2108,10 @@ fn test_set_sn_owner_hotkey_root() { add_network(netuid, 10); let owner = U256::from(10); + let old_perpetual_coldkey = U256::from(11); + let old_decaying_coldkey = U256::from(12); + let new_perpetual_coldkey = U256::from(13); + let new_decaying_coldkey = U256::from(14); pallet_subtensor::SubnetOwner::::insert(netuid, owner); pallet_subtensor::SubnetOwnerHotkey::::insert(netuid, old_hotkey); let now = SubtensorModule::get_current_block_as_u64(); @@ -2121,6 +2125,32 @@ fn test_set_sn_owner_hotkey_root() { conviction: U64F64::from_num(2_000), last_update: now, }; + pallet_subtensor::DecayingLock::::insert(old_perpetual_coldkey, netuid, false); + pallet_subtensor::DecayingLock::::insert(new_perpetual_coldkey, netuid, false); + SubtensorModule::insert_lock_state( + &old_perpetual_coldkey, + netuid, + &old_hotkey, + old_owner_lock.clone(), + ); + SubtensorModule::insert_lock_state( + &old_decaying_coldkey, + netuid, + &old_hotkey, + old_owner_lock.clone(), + ); + SubtensorModule::insert_lock_state( + &new_perpetual_coldkey, + netuid, + &hotkey, + new_owner_lock.clone(), + ); + SubtensorModule::insert_lock_state( + &new_decaying_coldkey, + netuid, + &hotkey, + new_owner_lock.clone(), + ); SubtensorModule::insert_owner_lock_state(netuid, old_owner_lock.clone()); SubtensorModule::insert_decaying_owner_lock_state(netuid, old_owner_lock); SubtensorModule::insert_hotkey_lock_state(netuid, &hotkey, new_owner_lock.clone()); @@ -2138,27 +2168,21 @@ fn test_set_sn_owner_hotkey_root() { assert_eq!(actual_hotkey, hotkey); assert_eq!( pallet_subtensor::HotkeyLock::::get(netuid, old_hotkey) - .unwrap() - .locked_mass, - 1_000u64.into() + .map(|lock| lock.locked_mass), + Some(1_000u64.into()) ); assert_eq!( pallet_subtensor::DecayingHotkeyLock::::get(netuid, old_hotkey) - .unwrap() - .locked_mass, - 1_000u64.into() + .map(|lock| lock.locked_mass), + Some(1_000u64.into()) ); assert_eq!( - pallet_subtensor::OwnerLock::::get(netuid) - .unwrap() - .locked_mass, - 2_000u64.into() + pallet_subtensor::OwnerLock::::get(netuid).map(|lock| lock.locked_mass), + Some(2_000u64.into()) ); assert_eq!( - pallet_subtensor::DecayingOwnerLock::::get(netuid) - .unwrap() - .locked_mass, - 2_000u64.into() + pallet_subtensor::DecayingOwnerLock::::get(netuid).map(|lock| lock.locked_mass), + Some(2_000u64.into()) ); }); } diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 8a331765a4..5e5985e783 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -1209,12 +1209,73 @@ impl Pallet { .map(|(hotkey, _)| hotkey) } - /// Reclassify aggregate lock buckets when a subnet's owner hotkey changes. + /// Rebuild one hotkey's aggregate buckets from its canonical individual rows + /// using the role it will have after an ownership transition. + fn rebuild_hotkey_lock_buckets_for_role( + netuid: NetUid, + hotkey: &T::AccountId, + owner_lock: bool, + now: u64, + unlock_rate: u64, + maturity_rate: u64, + ) { + // Collect before rewriting LockingColdkeys so dust and orphan cleanup cannot + // disturb the prefix iterator. + let coldkeys: Vec = LockingColdkeys::::iter_prefix((netuid, hotkey)) + .map(|(coldkey, ())| coldkey) + .collect(); + let mut perpetual_aggregate = Self::empty_lock(now); + let mut decaying_aggregate = Self::empty_lock(now); + + for coldkey in coldkeys { + let Some(lock) = Lock::::get((&coldkey, netuid, hotkey)) else { + Self::maybe_remove_locking_coldkey(hotkey, netuid, &coldkey); + continue; + }; + let perpetual_lock = Self::is_perpetual_lock(&coldkey, netuid); + let rolled = ConvictionModel::roll_forward_lock( + lock, + now, + unlock_rate, + maturity_rate, + owner_lock, + perpetual_lock, + ); + + // Persist the role-adjusted member before deriving its aggregate. In + // particular, owner promotion must make the full-conviction boost + // canonical on every individual row rather than only on the aggregate. + Self::insert_lock_state(&coldkey, netuid, hotkey, rolled.clone()); + if rolled.is_zero() { + continue; + } + + match LockClass::from_roles(owner_lock, perpetual_lock) { + LockClass::PerpetualGeneral | LockClass::PerpetualOwner => { + perpetual_aggregate = perpetual_aggregate.merge(&rolled); + } + LockClass::DecayingGeneral | LockClass::DecayingOwner => { + decaying_aggregate = decaying_aggregate.merge(&rolled); + } + } + } + + if owner_lock { + Self::insert_owner_lock_state(netuid, perpetual_aggregate); + Self::insert_decaying_owner_lock_state(netuid, decaying_aggregate); + } else { + Self::insert_hotkey_lock_state(netuid, hotkey, perpetual_aggregate); + Self::insert_decaying_hotkey_lock_state(netuid, hotkey, decaying_aggregate); + } + } + + /// Reclassify canonical individual locks and their aggregate buckets when a + /// subnet's owner hotkey changes. /// - /// The outgoing owner's aggregate becomes an ordinary hotkey aggregate, while - /// the incoming hotkey's aggregate becomes the owner aggregate. This must run - /// before updating [`SubnetOwnerHotkey`] so both buckets are interpreted using - /// their old roles while they are rolled forward. + /// This must run before updating [`SubnetOwnerHotkey`]. Every member of the + /// outgoing and incoming hotkeys is persisted under its new role, then the + /// affected aggregates are rebuilt from those rows. Keeping the owner boost + /// on both representations prevents it becoming orphaned after demotion. pub(crate) fn transition_subnet_owner_lock_aggregates( netuid: NetUid, old_owner_hotkey: &T::AccountId, @@ -1224,158 +1285,34 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - if let Some(owner_lock) = OwnerLock::::take(netuid) { - let moved_owner_lock = ConvictionModel::roll_forward_lock( - owner_lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ); - let current = HotkeyLock::::get(netuid, old_owner_hotkey) - .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ) - }) - .unwrap_or_else(|| Self::empty_lock(now)); - Self::insert_hotkey_lock_state( + // Discard aggregate-only history for the affected hotkeys. The rows below + // are the canonical source of truth for the rebuilt buckets. + OwnerLock::::remove(netuid); + DecayingOwnerLock::::remove(netuid); + HotkeyLock::::remove(netuid, old_owner_hotkey); + DecayingHotkeyLock::::remove(netuid, old_owner_hotkey); + if old_owner_hotkey != new_owner_hotkey { + HotkeyLock::::remove(netuid, new_owner_hotkey); + DecayingHotkeyLock::::remove(netuid, new_owner_hotkey); + + Self::rebuild_hotkey_lock_buckets_for_role( netuid, old_owner_hotkey, - LockState { - locked_mass: current - .locked_mass - .saturating_add(moved_owner_lock.locked_mass), - conviction: current - .conviction - .saturating_add(moved_owner_lock.conviction), - last_update: now, - }, - ); - } - if let Some(owner_lock) = DecayingOwnerLock::::take(netuid) { - let moved_owner_lock = ConvictionModel::roll_forward_lock( - owner_lock, - now, - unlock_rate, - maturity_rate, - true, false, - ); - let current = DecayingHotkeyLock::::get(netuid, old_owner_hotkey) - .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - false, - ) - }) - .unwrap_or_else(|| Self::empty_lock(now)); - Self::insert_decaying_hotkey_lock_state( - netuid, - old_owner_hotkey, - LockState { - locked_mass: current - .locked_mass - .saturating_add(moved_owner_lock.locked_mass), - conviction: current - .conviction - .saturating_add(moved_owner_lock.conviction), - last_update: now, - }, - ); - } - if let Some(new_owner_lock) = HotkeyLock::::take(netuid, new_owner_hotkey) { - let moved_new_owner_lock = ConvictionModel::roll_forward_lock( - new_owner_lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ); - let current = OwnerLock::::get(netuid) - .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ) - }) - .unwrap_or_else(|| Self::empty_lock(now)); - Self::insert_owner_lock_state( - netuid, - ConvictionModel::roll_forward_lock( - LockState { - locked_mass: current - .locked_mass - .saturating_add(moved_new_owner_lock.locked_mass), - conviction: current - .conviction - .saturating_add(moved_new_owner_lock.conviction), - last_update: now, - }, - now, - unlock_rate, - maturity_rate, - true, - true, - ), - ); - } - if let Some(new_owner_lock) = DecayingHotkeyLock::::take(netuid, new_owner_hotkey) { - let moved_new_owner_lock = ConvictionModel::roll_forward_lock( - new_owner_lock, now, unlock_rate, maturity_rate, - false, - false, - ); - let current = DecayingOwnerLock::::get(netuid) - .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - false, - ) - }) - .unwrap_or_else(|| Self::empty_lock(now)); - Self::insert_decaying_owner_lock_state( - netuid, - ConvictionModel::roll_forward_lock( - LockState { - locked_mass: current - .locked_mass - .saturating_add(moved_new_owner_lock.locked_mass), - conviction: current - .conviction - .saturating_add(moved_new_owner_lock.conviction), - last_update: now, - }, - now, - unlock_rate, - maturity_rate, - true, - false, - ), ); } + + Self::rebuild_hotkey_lock_buckets_for_role( + netuid, + new_owner_hotkey, + true, + now, + unlock_rate, + maturity_rate, + ); } /// Reassigns subnet ownership to the current lock-conviction leader when the subnet diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index d531e853ca..af57b8101b 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -3323,6 +3323,7 @@ fn test_change_subnet_owner_if_needed_reassigns_to_subnet_king() { System::set_block_number(now); NetworkRegisteredAt::::insert(netuid, 1); SubnetAlphaOut::::insert(netuid, AlphaBalance::from(10_000u64)); + DecayingLock::::insert(new_owner_coldkey, netuid, false); // Seed matching individual and aggregate lock rows for the future king. let locked_mass = AlphaBalance::from(1_000u64); @@ -3334,6 +3335,7 @@ fn test_change_subnet_owner_if_needed_reassigns_to_subnet_king() { last_update: now, }, ); + SubtensorModule::add_locking_coldkey(&king_hotkey, netuid, &new_owner_coldkey); HotkeyLock::::insert( netuid, king_hotkey, @@ -3480,6 +3482,7 @@ fn test_run_coinbase_reassigns_subnet_owner_by_conviction_on_epoch() { SubtensorModule::set_tempo_unchecked(netuid, 1); LastEpochBlock::::insert(netuid, now.saturating_sub(1)); PendingEpochAt::::insert(netuid, 0); + DecayingLock::::insert(new_owner_coldkey, netuid, false); let locked_mass = AlphaBalance::from(1_000u64); Lock::::insert( @@ -3490,6 +3493,7 @@ fn test_run_coinbase_reassigns_subnet_owner_by_conviction_on_epoch() { last_update: now, }, ); + SubtensorModule::add_locking_coldkey(&king_hotkey, netuid, &new_owner_coldkey); HotkeyLock::::insert( netuid, king_hotkey, @@ -3535,6 +3539,7 @@ fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { NetworkRegisteredAt::::insert(netuid, 1); SubnetAlphaOut::::insert(netuid, AlphaBalance::from(10_000u64)); DecayingLock::::insert(perpetual_coldkey, netuid, false); + DecayingLock::::insert(king_coldkey, netuid, false); Lock::::insert( (perpetual_coldkey, netuid, old_owner_hotkey), @@ -3544,6 +3549,7 @@ fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { last_update: now, }, ); + SubtensorModule::add_locking_coldkey(&old_owner_hotkey, netuid, &perpetual_coldkey); Lock::::insert( (decaying_coldkey, netuid, old_owner_hotkey), LockState { @@ -3552,6 +3558,7 @@ fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { last_update: now, }, ); + SubtensorModule::add_locking_coldkey(&old_owner_hotkey, netuid, &decaying_coldkey); OwnerLock::::insert( netuid, LockState { @@ -3576,6 +3583,7 @@ fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { last_update: now, }, ); + SubtensorModule::add_locking_coldkey(&king_hotkey, netuid, &king_coldkey); HotkeyLock::::insert( netuid, king_hotkey, @@ -3608,6 +3616,79 @@ fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { }); } +#[test] +fn test_owner_demotion_then_member_update_does_not_leave_ghost_conviction() { + new_test_ext(100).execute_with(|| { + let netuid = NetUid::from(1); + let original_owner_hotkey = U256::from(1); + let promoted_hotkey = U256::from(2); + let next_owner_hotkey = U256::from(3); + let first_coldkey = U256::from(10); + let second_coldkey = U256::from(11); + let now = SubtensorModule::get_current_block_as_u64(); + let member = LockState { + locked_mass: 1_000u64.into(), + conviction: U64F64::from_num(100), + last_update: now, + }; + + SubnetOwnerHotkey::::insert(netuid, original_owner_hotkey); + DecayingLock::::insert(first_coldkey, netuid, false); + DecayingLock::::insert(second_coldkey, netuid, false); + SubtensorModule::insert_lock_state( + &first_coldkey, + netuid, + &promoted_hotkey, + member.clone(), + ); + SubtensorModule::insert_lock_state( + &second_coldkey, + netuid, + &promoted_hotkey, + member.clone(), + ); + HotkeyLock::::insert( + netuid, + promoted_hotkey, + LockState { + locked_mass: 2_000u64.into(), + conviction: U64F64::from_num(200), + last_update: now, + }, + ); + + SubtensorModule::transition_subnet_owner_lock_aggregates( + netuid, + &original_owner_hotkey, + &promoted_hotkey, + ); + SubnetOwnerHotkey::::insert(netuid, promoted_hotkey); + + SubtensorModule::transition_subnet_owner_lock_aggregates( + netuid, + &promoted_hotkey, + &next_owner_hotkey, + ); + SubnetOwnerHotkey::::insert(netuid, next_owner_hotkey); + + // Removing one member after demotion must remove its complete canonical + // contribution. Any aggregate-only owner boost would survive as ghost + // conviction in the promoted hotkey's general bucket. + SubtensorModule::force_reduce_lock(&first_coldkey, netuid, 1_000u64.into()); + + assert!(Lock::::get((first_coldkey, netuid, promoted_hotkey)).is_none()); + let remaining = Lock::::get((second_coldkey, netuid, promoted_hotkey)) + .expect("second member should remain"); + assert_eq!(remaining.locked_mass, 1_000u64.into()); + assert_eq!(remaining.conviction, U64F64::from_num(1_000)); + assert_eq!( + HotkeyLock::::get(netuid, promoted_hotkey), + Some(remaining) + ); + assert!(OwnerLock::::get(netuid).is_none()); + }); +} + #[test] fn test_swap_hotkey_locks_moves_owner_hotkey_aggregate_to_owner_lock() { new_test_ext(1).execute_with(|| { From d6aafa330a89689ca7aef6f02c1fc11bc35d3235 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Mon, 10 Aug 2026 16:13:25 -0400 Subject: [PATCH 11/14] Rework lock.rs --- pallets/admin-utils/src/benchmarking.rs | 36 - pallets/admin-utils/src/lib.rs | 12 +- pallets/admin-utils/src/weights.rs | 832 +++--- .../subtensor/src/benchmarks/benchmarks.rs | 86 +- pallets/subtensor/src/coinbase/block_step.rs | 7 +- .../subtensor/src/coinbase/run_coinbase.rs | 24 +- pallets/subtensor/src/macros/dispatches.rs | 13 +- pallets/subtensor/src/macros/hooks.rs | 3 +- .../migrate_fix_subnet_hotkey_lock_swaps.rs | 54 +- .../migrate_populate_locking_coldkeys.rs | 2 +- .../migrate_rebuild_conviction_aggregates.rs | 18 +- pallets/subtensor/src/staking/lock.rs | 1461 +++++------ pallets/subtensor/src/subnets/leasing.rs | 19 +- pallets/subtensor/src/tests/leasing.rs | 6 +- pallets/subtensor/src/tests/locks.rs | 151 +- pallets/subtensor/src/tests/migration.rs | 20 +- pallets/subtensor/src/tests/networks.rs | 27 +- pallets/subtensor/src/weights.rs | 2323 ++++++++++------- precompiles/src/staking.rs | 10 +- 19 files changed, 2822 insertions(+), 2282 deletions(-) diff --git a/pallets/admin-utils/src/benchmarking.rs b/pallets/admin-utils/src/benchmarking.rs index 25c0f56ea5..fc3086dff4 100644 --- a/pallets/admin-utils/src/benchmarking.rs +++ b/pallets/admin-utils/src/benchmarking.rs @@ -23,7 +23,6 @@ mod benchmarks { use super::*; #[cfg(test)] use crate::tests::mock; - use pallet_subtensor::staking::lock::LockState; use sp_runtime::PerU16; use substrate_fixed::types::{I64F64, U64F64}; use subtensor_runtime_common::{NetUid, TaoBalance}; @@ -630,29 +629,6 @@ mod benchmarks { netuid, 1u16, // tempo ); pallet_subtensor::SubnetOwnerHotkey::::insert(netuid, &old_hotkey); - let now = pallet_subtensor::Pallet::::get_current_block_as_u64(); - let old_owner_lock = LockState { - locked_mass: 1_000u64.into(), - conviction: U64F64::from_num(1_000), - last_update: now, - }; - let new_owner_lock = LockState { - locked_mass: 2_000u64.into(), - conviction: U64F64::from_num(2_000), - last_update: now, - }; - pallet_subtensor::Pallet::::insert_owner_lock_state(netuid, old_owner_lock.clone()); - pallet_subtensor::Pallet::::insert_decaying_owner_lock_state(netuid, old_owner_lock); - pallet_subtensor::Pallet::::insert_hotkey_lock_state( - netuid, - &hotkey, - new_owner_lock.clone(), - ); - pallet_subtensor::Pallet::::insert_decaying_hotkey_lock_state( - netuid, - &hotkey, - new_owner_lock, - ); #[extrinsic_call] _(RawOrigin::Root, netuid, hotkey.clone()); @@ -661,18 +637,6 @@ mod benchmarks { pallet_subtensor::SubnetOwnerHotkey::::get(netuid), hotkey ); - assert!(pallet_subtensor::HotkeyLock::::contains_key( - netuid, - &old_hotkey - )); - assert!(pallet_subtensor::DecayingHotkeyLock::::contains_key( - netuid, - &old_hotkey - )); - assert!(pallet_subtensor::OwnerLock::::contains_key(netuid)); - assert!(pallet_subtensor::DecayingOwnerLock::::contains_key( - netuid - )); } #[benchmark] diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index 7369006133..b371e875f5 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -1774,7 +1774,17 @@ pub mod pallet { /// # Rate Limiting /// This function is rate-limited to one call per subnet per interval (e.g., one week). #[pallet::call_index(67)] - #[pallet::weight(::WeightInfo::sudo_set_sn_owner_hotkey())] + #[pallet::weight({ + let member_count = + pallet_subtensor::Pallet::::owner_transition_member_count(*netuid, hotkey); + ::WeightInfo::sudo_set_sn_owner_hotkey().saturating_add( + <::WeightInfo as pallet_subtensor::weights::WeightInfo>::transition_subnet_owner_locks( + member_count, + ).saturating_add( + pallet_subtensor::Pallet::::owner_transition_member_count_weight(member_count), + ), + ) + })] pub fn sudo_set_sn_owner_hotkey( origin: OriginFor, netuid: NetUid, diff --git a/pallets/admin-utils/src/weights.rs b/pallets/admin-utils/src/weights.rs index a897dfdb68..14b03d4387 100644 --- a/pallets/admin-utils/src/weights.rs +++ b/pallets/admin-utils/src/weights.rs @@ -2,16 +2,16 @@ //! Autogenerated weights for `pallet_admin_utils` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` +//! HOSTNAME: `Grigoris-MBP.lan`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// /home/runner/work/subtensor/subtensor/target/production/node-subtensor +// /Users/grigorizaitsev/development/subtensor/target/production/node-subtensor // benchmark // pallet -// --runtime=/home/runner/work/subtensor/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm +// --runtime=/Users/grigorizaitsev/development/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm // --genesis-builder=runtime // --genesis-builder-preset=benchmark // --wasm-execution=compiled @@ -22,8 +22,8 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.iJZ8rYougD -// --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs +// --output=/Users/grigorizaitsev/development/subtensor/pallets/admin-utils/src/weights.rs +// --template=/Users/grigorizaitsev/development/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -119,10 +119,10 @@ pub trait WeightInfo { fn sudo_set_start_call_delay() -> Weight; fn sudo_set_burn_half_life() -> Weight; fn sudo_set_burn_increase_mult() -> Weight; - fn sudo_set_owner_cut_enabled() -> Weight; - fn sudo_set_owner_cut_auto_lock_enabled() -> Weight; fn sudo_set_collateral_lock_share() -> Weight; fn sudo_set_collateral_drain_ratio() -> Weight; + fn sudo_set_owner_cut_enabled() -> Weight; + fn sudo_set_owner_cut_auto_lock_enabled() -> Weight; } /// Weights for `pallet_admin_utils` using the Substrate node and recommended hardware. @@ -135,10 +135,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_007_000 picoseconds. - Weight::from_parts(4_721_714, 0) - // Standard Error: 732 - .saturating_add(Weight::from_parts(25_072, 0).saturating_mul(a.into())) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_608_495, 0) + // Standard Error: 1_565 + .saturating_add(Weight::from_parts(15_303, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -148,10 +148,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `174` // Estimated: `2779` - // Minimum execution time: 7_444_000 picoseconds. - Weight::from_parts(8_055_222, 2779) - // Standard Error: 917 - .saturating_add(Weight::from_parts(18_955, 0).saturating_mul(a.into())) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_962_445, 2779) + // Standard Error: 1_197 + .saturating_add(Weight::from_parts(7_187, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -161,8 +161,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_330_000 picoseconds. - Weight::from_parts(5_691_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -179,8 +179,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `747` // Estimated: `4212` - // Minimum execution time: 27_211_000 picoseconds. - Weight::from_parts(28_163_000, 4212) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4212) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -200,8 +200,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_972_000 picoseconds. - Weight::from_parts(34_014_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(24_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -221,8 +221,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_831_000 picoseconds. - Weight::from_parts(33_853_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -234,8 +234,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 15_810_000 picoseconds. - Weight::from_parts(16_350_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -255,8 +255,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_982_000 picoseconds. - Weight::from_parts(34_094_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -276,8 +276,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_911_000 picoseconds. - Weight::from_parts(33_944_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -297,8 +297,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_082_000 picoseconds. - Weight::from_parts(33_894_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -320,8 +320,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 34_535_000 picoseconds. - Weight::from_parts(35_477_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -341,8 +341,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_062_000 picoseconds. - Weight::from_parts(33_974_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -354,8 +354,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 16_090_000 picoseconds. - Weight::from_parts(16_591_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -375,8 +375,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_452_000 picoseconds. - Weight::from_parts(34_194_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -398,8 +398,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_753_000 picoseconds. - Weight::from_parts(34_805_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -409,8 +409,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_993_000 picoseconds. - Weight::from_parts(7_354_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -429,8 +429,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 29_966_000 picoseconds. - Weight::from_parts(30_948_000, 4383) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(20_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -442,8 +442,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 16_040_000 picoseconds. - Weight::from_parts(16_591_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -467,8 +467,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 35_977_000 picoseconds. - Weight::from_parts(37_299_000, 4383) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4383) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -494,8 +494,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4433` - // Minimum execution time: 41_067_000 picoseconds. - Weight::from_parts(42_269_000, 4433) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(28_000_000, 4433) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -515,8 +515,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_721_000 picoseconds. - Weight::from_parts(33_793_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -536,8 +536,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_601_000 picoseconds. - Weight::from_parts(33_853_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -557,8 +557,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_112_000 picoseconds. - Weight::from_parts(33_784_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -580,8 +580,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `945` // Estimated: `4410` - // Minimum execution time: 36_247_000 picoseconds. - Weight::from_parts(36_978_000, 4410) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4410) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -603,8 +603,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `920` // Estimated: `4385` - // Minimum execution time: 35_867_000 picoseconds. - Weight::from_parts(37_510_000, 4385) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4385) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -614,8 +614,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_752_000 picoseconds. - Weight::from_parts(7_163_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -636,8 +636,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 45_966_000 picoseconds. - Weight::from_parts(47_038_000, 4440) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 4440) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -657,8 +657,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_763_000 picoseconds. - Weight::from_parts(34_514_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -678,8 +678,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_242_000 picoseconds. - Weight::from_parts(33_914_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -689,8 +689,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_971_000 picoseconds. - Weight::from_parts(6_352_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -699,16 +699,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_360_000 picoseconds. - Weight::from_parts(5_720_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn sudo_set_total_issuance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_790_000 picoseconds. - Weight::from_parts(6_021_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -718,8 +718,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 15_869_000 picoseconds. - Weight::from_parts(16_370_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -729,8 +729,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_480_000 picoseconds. - Weight::from_parts(5_661_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -745,8 +745,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `950` // Estimated: `6890` - // Minimum execution time: 29_785_000 picoseconds. - Weight::from_parts(30_577_000, 6890) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(19_000_000, 6890) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -756,8 +756,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_561_000 picoseconds. - Weight::from_parts(5_721_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -766,8 +766,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_410_000 picoseconds. - Weight::from_parts(5_671_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -790,8 +790,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `954` // Estimated: `4419` - // Minimum execution time: 36_419_000 picoseconds. - Weight::from_parts(37_621_000, 4419) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4419) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -809,8 +809,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 24_436_000 picoseconds. - Weight::from_parts(25_598_000, 4280) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -830,8 +830,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `962` // Estimated: `4427` - // Minimum execution time: 33_122_000 picoseconds. - Weight::from_parts(33_783_000, 4427) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4427) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -841,8 +841,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_480_000 picoseconds. - Weight::from_parts(5_791_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -851,8 +851,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_480_000 picoseconds. - Weight::from_parts(5_760_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -861,8 +861,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_240_000 picoseconds. - Weight::from_parts(5_660_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -879,8 +879,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 27_180_000 picoseconds. - Weight::from_parts(28_282_000, 4280) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -890,8 +890,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 6_051_000 picoseconds. - Weight::from_parts(6_202_000, 3507) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 3507) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -900,8 +900,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_875_000 picoseconds. - Weight::from_parts(2_985_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -910,8 +910,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_877_000 picoseconds. - Weight::from_parts(4_238_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -930,8 +930,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 29_776_000 picoseconds. - Weight::from_parts(30_897_000, 4383) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -949,8 +949,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 27_751_000 picoseconds. - Weight::from_parts(28_463_000, 4280) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -968,8 +968,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 29_636_000 picoseconds. - Weight::from_parts(30_025_000, 4280) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -981,8 +981,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 15_900_000 picoseconds. - Weight::from_parts(16_401_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -996,21 +996,23 @@ 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::OwnerLock` (r:1 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) + /// Storage: `SubtensorModule::LockingColdkeys` (r:2 w:0) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) + /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_sn_owner_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `1208` - // Estimated: `7148` - // Minimum execution time: 72_000_000 picoseconds. - Weight::from_parts(77_000_000, 7148) - .saturating_add(T::DbWeight::get().reads(11_u64)) + // Measured: `925` + // Estimated: `6865` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(41_000_000, 6865) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1027,8 +1029,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 24_125_000 picoseconds. - Weight::from_parts(24_847_000, 4280) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1038,8 +1040,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_500_000 picoseconds. - Weight::from_parts(5_731_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -1048,8 +1050,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_600_000 picoseconds. - Weight::from_parts(5_831_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1066,8 +1068,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 24_045_000 picoseconds. - Weight::from_parts(24_967_000, 4280) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1091,8 +1093,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `933` // Estimated: `4398` - // Minimum execution time: 36_298_000 picoseconds. - Weight::from_parts(37_260_000, 4398) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4398) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1102,8 +1104,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_904_000 picoseconds. - Weight::from_parts(7_203_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxEpochsPerBlock` (r:0 w:1) @@ -1112,8 +1114,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_460_000 picoseconds. - Weight::from_parts(5_740_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1138,8 +1140,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 41_231_000 picoseconds. - Weight::from_parts(42_292_000, 4467) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1147,8 +1149,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_692_000 picoseconds. - Weight::from_parts(1_913_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) } /// Storage: `SubtensorModule::SubnetOwnerCut` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwnerCut` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -1156,8 +1158,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_996_000 picoseconds. - Weight::from_parts(4_416_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkRateLimit` (r:0 w:1) @@ -1166,8 +1168,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_996_000 picoseconds. - Weight::from_parts(4_267_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkImmunityPeriod` (r:0 w:1) @@ -1176,8 +1178,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_996_000 picoseconds. - Weight::from_parts(4_347_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkMinLockCost` (r:0 w:1) @@ -1186,8 +1188,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_896_000 picoseconds. - Weight::from_parts(4_166_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetLimit` (r:0 w:1) @@ -1196,8 +1198,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_896_000 picoseconds. - Weight::from_parts(4_246_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkLockReductionInterval` (r:0 w:1) @@ -1206,8 +1208,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_925_000 picoseconds. - Weight::from_parts(4_257_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `EVMChainId::ChainId` (r:0 w:1) @@ -1216,8 +1218,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_655_000 picoseconds. - Weight::from_parts(2_875_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1240,8 +1242,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 32_888_000 picoseconds. - Weight::from_parts(33_720_000, 4364) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4364) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1251,8 +1253,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_903_000 picoseconds. - Weight::from_parts(2_083_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1281,8 +1283,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1132` // Estimated: `4597` - // Minimum execution time: 51_307_000 picoseconds. - Weight::from_parts(52_768_000, 4597) + // Minimum execution time: 34_000_000 picoseconds. + Weight::from_parts(35_000_000, 4597) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1308,8 +1310,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1039` // Estimated: `4504` - // Minimum execution time: 44_135_000 picoseconds. - Weight::from_parts(45_668_000, 4504) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 4504) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1319,8 +1321,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_993_000 picoseconds. - Weight::from_parts(2_173_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::FlowNormExponent` (r:0 w:1) @@ -1329,8 +1331,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_083_000 picoseconds. - Weight::from_parts(2_204_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EmissionGateBar` (r:0 w:1) @@ -1341,7 +1343,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1373,8 +1375,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_943_000 picoseconds. - Weight::from_parts(2_093_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetTaoFlowEnabled` (r:0 w:1) @@ -1383,8 +1385,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_952_000 picoseconds. - Weight::from_parts(2_073_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxMechanismCount` (r:0 w:1) @@ -1393,8 +1395,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_674_000 picoseconds. - Weight::from_parts(2_835_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::StartCallDelay` (r:0 w:1) @@ -1403,8 +1405,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_026_000 picoseconds. - Weight::from_parts(4_166_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1429,8 +1431,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 41_282_000 picoseconds. - Weight::from_parts(42_653_000, 4467) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1456,22 +1458,62 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 41_972_000 picoseconds. - Weight::from_parts(42_884_000, 4467) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(29_000_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Same owner-hyperparameter guard path and single insert as - /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. + /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) + /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Tempo` (r:1 w:0) + /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) + /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) + /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) + /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralLockShare` (r:0 w:1) + /// Proof: `SubtensorModule::CollateralLockShare` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_collateral_lock_share() -> Weight { - Weight::from_parts(42_884_000, 4467) + // Proof Size summary in bytes: + // Measured: `1002` + // Estimated: `4467` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(29_000_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Same owner-hyperparameter guard path and single insert as - /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. + /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) + /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Tempo` (r:1 w:0) + /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) + /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) + /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) + /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralDrainRatio` (r:0 w:1) + /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_collateral_drain_ratio() -> Weight { - Weight::from_parts(42_884_000, 4467) + // Proof Size summary in bytes: + // Measured: `1002` + // Estimated: `4467` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(29_000_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1493,8 +1535,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 31_937_000 picoseconds. - Weight::from_parts(32_729_000, 4440) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4440) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1516,8 +1558,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 31_918_000 picoseconds. - Weight::from_parts(32_919_000, 4440) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(24_000_000, 4440) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1532,10 +1574,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_007_000 picoseconds. - Weight::from_parts(4_721_714, 0) - // Standard Error: 732 - .saturating_add(Weight::from_parts(25_072, 0).saturating_mul(a.into())) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_608_495, 0) + // Standard Error: 1_565 + .saturating_add(Weight::from_parts(15_303, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -1545,10 +1587,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `174` // Estimated: `2779` - // Minimum execution time: 7_444_000 picoseconds. - Weight::from_parts(8_055_222, 2779) - // Standard Error: 917 - .saturating_add(Weight::from_parts(18_955, 0).saturating_mul(a.into())) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_962_445, 2779) + // Standard Error: 1_197 + .saturating_add(Weight::from_parts(7_187, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1558,8 +1600,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_330_000 picoseconds. - Weight::from_parts(5_691_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1576,8 +1618,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `747` // Estimated: `4212` - // Minimum execution time: 27_211_000 picoseconds. - Weight::from_parts(28_163_000, 4212) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4212) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1597,8 +1639,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_972_000 picoseconds. - Weight::from_parts(34_014_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(24_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1618,8 +1660,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_831_000 picoseconds. - Weight::from_parts(33_853_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1631,8 +1673,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 15_810_000 picoseconds. - Weight::from_parts(16_350_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1652,8 +1694,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_982_000 picoseconds. - Weight::from_parts(34_094_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1673,8 +1715,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_911_000 picoseconds. - Weight::from_parts(33_944_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1694,8 +1736,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_082_000 picoseconds. - Weight::from_parts(33_894_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1717,8 +1759,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 34_535_000 picoseconds. - Weight::from_parts(35_477_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1738,8 +1780,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_062_000 picoseconds. - Weight::from_parts(33_974_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1751,8 +1793,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 16_090_000 picoseconds. - Weight::from_parts(16_591_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1772,8 +1814,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_452_000 picoseconds. - Weight::from_parts(34_194_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1795,8 +1837,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_753_000 picoseconds. - Weight::from_parts(34_805_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1806,8 +1848,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_993_000 picoseconds. - Weight::from_parts(7_354_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1826,8 +1868,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 29_966_000 picoseconds. - Weight::from_parts(30_948_000, 4383) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(20_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1839,8 +1881,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 16_040_000 picoseconds. - Weight::from_parts(16_591_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1864,8 +1906,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 35_977_000 picoseconds. - Weight::from_parts(37_299_000, 4383) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1891,8 +1933,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4433` - // Minimum execution time: 41_067_000 picoseconds. - Weight::from_parts(42_269_000, 4433) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(28_000_000, 4433) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1912,8 +1954,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_721_000 picoseconds. - Weight::from_parts(33_793_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1933,8 +1975,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_601_000 picoseconds. - Weight::from_parts(33_853_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1954,8 +1996,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_112_000 picoseconds. - Weight::from_parts(33_784_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1977,8 +2019,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `945` // Estimated: `4410` - // Minimum execution time: 36_247_000 picoseconds. - Weight::from_parts(36_978_000, 4410) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4410) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2000,8 +2042,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `920` // Estimated: `4385` - // Minimum execution time: 35_867_000 picoseconds. - Weight::from_parts(37_510_000, 4385) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4385) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2011,8 +2053,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_752_000 picoseconds. - Weight::from_parts(7_163_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2033,8 +2075,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 45_966_000 picoseconds. - Weight::from_parts(47_038_000, 4440) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 4440) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -2054,8 +2096,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_763_000 picoseconds. - Weight::from_parts(34_514_000, 4383) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2075,8 +2117,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 33_242_000 picoseconds. - Weight::from_parts(33_914_000, 4383) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2086,8 +2128,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_971_000 picoseconds. - Weight::from_parts(6_352_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -2096,16 +2138,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_360_000 picoseconds. - Weight::from_parts(5_720_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn sudo_set_total_issuance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_790_000 picoseconds. - Weight::from_parts(6_021_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2115,8 +2157,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 15_869_000 picoseconds. - Weight::from_parts(16_370_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2126,8 +2168,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_480_000 picoseconds. - Weight::from_parts(5_661_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -2142,8 +2184,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `950` // Estimated: `6890` - // Minimum execution time: 29_785_000 picoseconds. - Weight::from_parts(30_577_000, 6890) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(19_000_000, 6890) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2153,8 +2195,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_561_000 picoseconds. - Weight::from_parts(5_721_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -2163,8 +2205,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_410_000 picoseconds. - Weight::from_parts(5_671_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2187,8 +2229,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `954` // Estimated: `4419` - // Minimum execution time: 36_419_000 picoseconds. - Weight::from_parts(37_621_000, 4419) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4419) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2206,8 +2248,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 24_436_000 picoseconds. - Weight::from_parts(25_598_000, 4280) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2227,8 +2269,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `962` // Estimated: `4427` - // Minimum execution time: 33_122_000 picoseconds. - Weight::from_parts(33_783_000, 4427) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4427) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2238,8 +2280,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_480_000 picoseconds. - Weight::from_parts(5_791_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -2248,8 +2290,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_480_000 picoseconds. - Weight::from_parts(5_760_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -2258,8 +2300,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_240_000 picoseconds. - Weight::from_parts(5_660_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2276,8 +2318,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 27_180_000 picoseconds. - Weight::from_parts(28_282_000, 4280) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2287,8 +2329,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 6_051_000 picoseconds. - Weight::from_parts(6_202_000, 3507) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 3507) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -2297,8 +2339,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_875_000 picoseconds. - Weight::from_parts(2_985_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -2307,8 +2349,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_877_000 picoseconds. - Weight::from_parts(4_238_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2327,8 +2369,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 29_776_000 picoseconds. - Weight::from_parts(30_897_000, 4383) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2346,8 +2388,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 27_751_000 picoseconds. - Weight::from_parts(28_463_000, 4280) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2365,8 +2407,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 29_636_000 picoseconds. - Weight::from_parts(30_025_000, 4280) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2378,8 +2420,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 15_900_000 picoseconds. - Weight::from_parts(16_401_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2393,21 +2435,23 @@ 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::OwnerLock` (r:1 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) + /// Storage: `SubtensorModule::LockingColdkeys` (r:2 w:0) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) + /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_sn_owner_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `1208` - // Estimated: `7148` - // Minimum execution time: 72_000_000 picoseconds. - Weight::from_parts(77_000_000, 7148) - .saturating_add(RocksDbWeight::get().reads(11_u64)) + // Measured: `925` + // Estimated: `6865` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(41_000_000, 6865) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2424,8 +2468,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 24_125_000 picoseconds. - Weight::from_parts(24_847_000, 4280) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2435,8 +2479,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_500_000 picoseconds. - Weight::from_parts(5_731_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -2445,8 +2489,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_600_000 picoseconds. - Weight::from_parts(5_831_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2463,8 +2507,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 24_045_000 picoseconds. - Weight::from_parts(24_967_000, 4280) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2488,8 +2532,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `933` // Estimated: `4398` - // Minimum execution time: 36_298_000 picoseconds. - Weight::from_parts(37_260_000, 4398) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4398) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2499,8 +2543,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_904_000 picoseconds. - Weight::from_parts(7_203_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxEpochsPerBlock` (r:0 w:1) @@ -2509,8 +2553,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_460_000 picoseconds. - Weight::from_parts(5_740_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2535,8 +2579,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 41_231_000 picoseconds. - Weight::from_parts(42_292_000, 4467) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2544,8 +2588,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_692_000 picoseconds. - Weight::from_parts(1_913_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) } /// Storage: `SubtensorModule::SubnetOwnerCut` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwnerCut` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -2553,8 +2597,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_996_000 picoseconds. - Weight::from_parts(4_416_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkRateLimit` (r:0 w:1) @@ -2563,8 +2607,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_996_000 picoseconds. - Weight::from_parts(4_267_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkImmunityPeriod` (r:0 w:1) @@ -2573,8 +2617,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_996_000 picoseconds. - Weight::from_parts(4_347_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkMinLockCost` (r:0 w:1) @@ -2583,8 +2627,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_896_000 picoseconds. - Weight::from_parts(4_166_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetLimit` (r:0 w:1) @@ -2593,8 +2637,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_896_000 picoseconds. - Weight::from_parts(4_246_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkLockReductionInterval` (r:0 w:1) @@ -2603,8 +2647,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_925_000 picoseconds. - Weight::from_parts(4_257_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `EVMChainId::ChainId` (r:0 w:1) @@ -2613,8 +2657,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_655_000 picoseconds. - Weight::from_parts(2_875_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2637,8 +2681,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 32_888_000 picoseconds. - Weight::from_parts(33_720_000, 4364) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4364) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2648,8 +2692,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_903_000 picoseconds. - Weight::from_parts(2_083_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2678,8 +2722,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1132` // Estimated: `4597` - // Minimum execution time: 51_307_000 picoseconds. - Weight::from_parts(52_768_000, 4597) + // Minimum execution time: 34_000_000 picoseconds. + Weight::from_parts(35_000_000, 4597) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -2705,8 +2749,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1039` // Estimated: `4504` - // Minimum execution time: 44_135_000 picoseconds. - Weight::from_parts(45_668_000, 4504) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 4504) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2716,8 +2760,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_993_000 picoseconds. - Weight::from_parts(2_173_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::FlowNormExponent` (r:0 w:1) @@ -2726,8 +2770,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_083_000 picoseconds. - Weight::from_parts(2_204_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EmissionGateBar` (r:0 w:1) @@ -2738,7 +2782,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2770,8 +2814,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_943_000 picoseconds. - Weight::from_parts(2_093_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetTaoFlowEnabled` (r:0 w:1) @@ -2780,8 +2824,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_952_000 picoseconds. - Weight::from_parts(2_073_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxMechanismCount` (r:0 w:1) @@ -2790,8 +2834,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_674_000 picoseconds. - Weight::from_parts(2_835_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::StartCallDelay` (r:0 w:1) @@ -2800,8 +2844,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_026_000 picoseconds. - Weight::from_parts(4_166_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2826,8 +2870,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 41_282_000 picoseconds. - Weight::from_parts(42_653_000, 4467) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2853,22 +2897,62 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 41_972_000 picoseconds. - Weight::from_parts(42_884_000, 4467) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(29_000_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Same owner-hyperparameter guard path and single insert as - /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. + /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) + /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Tempo` (r:1 w:0) + /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) + /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) + /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) + /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralLockShare` (r:0 w:1) + /// Proof: `SubtensorModule::CollateralLockShare` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_collateral_lock_share() -> Weight { - Weight::from_parts(42_884_000, 4467) + // Proof Size summary in bytes: + // Measured: `1002` + // Estimated: `4467` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(29_000_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Same owner-hyperparameter guard path and single insert as - /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. + /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) + /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Tempo` (r:1 w:0) + /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) + /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) + /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) + /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralDrainRatio` (r:0 w:1) + /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_collateral_drain_ratio() -> Weight { - Weight::from_parts(42_884_000, 4467) + // Proof Size summary in bytes: + // Measured: `1002` + // Estimated: `4467` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(29_000_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2890,8 +2974,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 31_937_000 picoseconds. - Weight::from_parts(32_729_000, 4440) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 4440) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2913,8 +2997,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 31_918_000 picoseconds. - Weight::from_parts(32_919_000, 4440) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(24_000_000, 4440) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/subtensor/src/benchmarks/benchmarks.rs b/pallets/subtensor/src/benchmarks/benchmarks.rs index ee578d868e..e5340751b7 100644 --- a/pallets/subtensor/src/benchmarks/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks/benchmarks.rs @@ -1865,22 +1865,6 @@ mod pallet_benchmarks { let lease = SubnetLeases::::get(0).unwrap(); let hotkey = account::("beneficiary_hotkey", 0, 0); let _ = Subtensor::::create_account_if_non_existent(&beneficiary, &hotkey); - let old_owner_hotkey = SubnetOwnerHotkey::::get(lease.netuid); - let now = Subtensor::::get_current_block_as_u64(); - let old_owner_lock = LockState { - locked_mass: 100u64.into(), - conviction: U64F64::from_num(100), - last_update: now, - }; - let new_owner_lock = LockState { - locked_mass: 200u64.into(), - conviction: U64F64::from_num(200), - last_update: now, - }; - Subtensor::::insert_owner_lock_state(lease.netuid, old_owner_lock.clone()); - Subtensor::::insert_decaying_owner_lock_state(lease.netuid, old_owner_lock); - Subtensor::::insert_hotkey_lock_state(lease.netuid, &hotkey, new_owner_lock.clone()); - Subtensor::::insert_decaying_hotkey_lock_state(lease.netuid, &hotkey, new_owner_lock); #[extrinsic_call] _( @@ -1891,34 +1875,60 @@ mod pallet_benchmarks { assert_eq!(SubnetOwner::::get(lease.netuid), beneficiary); assert_eq!(SubnetOwnerHotkey::::get(lease.netuid), hotkey); - assert_eq!( - HotkeyLock::::get(lease.netuid, &old_owner_hotkey) - .unwrap() - .locked_mass, - 100u64.into() - ); - assert_eq!( - DecayingHotkeyLock::::get(lease.netuid, &old_owner_hotkey) - .unwrap() - .locked_mass, - 100u64.into() - ); - assert_eq!( - OwnerLock::::get(lease.netuid).unwrap().locked_mass, - 200u64.into() - ); - assert_eq!( - DecayingOwnerLock::::get(lease.netuid) - .unwrap() - .locked_mass, - 200u64.into() - ); assert_eq!(SubnetLeases::::get(lease_id), None); assert!(!SubnetLeaseShares::::contains_prefix(lease_id)); assert!(!AccumulatedLeaseDividends::::contains_key(lease_id)); } + #[benchmark] + fn transition_subnet_owner_locks(l: Linear<1, 128>) { + let netuid = NetUid::from(1); + let old_owner_hotkey = account::("old_owner", 0, 0); + let new_owner_hotkey = account::("new_owner", 0, 0); + let benchmark_block: BlockNumberFor = 100u32.into(); + + Subtensor::::init_new_network(netuid, 1); + SubnetOwnerHotkey::::insert(netuid, &old_owner_hotkey); + UnlockRate::::put(1); + MaturityRate::::put(1); + frame_system::Pallet::::set_block_number(benchmark_block); + + for i in 0..l { + let coldkey = account::("locker", i, 0); + let hotkey = if i % 2 == 0 { + &old_owner_hotkey + } else { + &new_owner_hotkey + }; + Subtensor::::insert_lock_state( + &coldkey, + netuid, + hotkey, + LockState { + locked_mass: 1_000u64.into(), + conviction: U64F64::from_num(1_000), + last_update: 0, + }, + ); + } + + #[block] + { + let transitioned = Subtensor::::transition_subnet_owner_lock_aggregates( + netuid, + &old_owner_hotkey, + &new_owner_hotkey, + ); + assert_eq!(transitioned, l); + } + + assert_eq!( + Subtensor::::owner_transition_member_count(netuid, &new_owner_hotkey), + 0 + ); + } + #[benchmark] fn update_symbol() { let coldkey: T::AccountId = whitelisted_caller(); diff --git a/pallets/subtensor/src/coinbase/block_step.rs b/pallets/subtensor/src/coinbase/block_step.rs index 5e296ac545..978b076d31 100644 --- a/pallets/subtensor/src/coinbase/block_step.rs +++ b/pallets/subtensor/src/coinbase/block_step.rs @@ -1,10 +1,11 @@ use super::*; +use frame_support::weights::Weight; use substrate_fixed::types::U96F32; use subtensor_runtime_common::NetUid; impl Pallet { /// Executes the necessary operations for each block. - pub fn block_step() -> Result<(), &'static str> { + pub fn block_step() -> Result { let block_number: u64 = Self::get_current_block_as_u64(); // --- 1. Update registration burn prices. @@ -17,7 +18,7 @@ impl Pallet { // --- 3. Reveal matured weights. Self::reveal_crv3_commits(); // --- 4. Run emission through network. - Self::run_coinbase(block_emission); + let owner_transition_weight = Self::run_coinbase(block_emission); // --- 4b. Flush queued root-dividend basket deposits: one hotkey per block, // round-robin. Runs right after coinbase (and before the price EMA update) so a // flush lands where the epoch-inline deposits used to happen. @@ -37,7 +38,7 @@ impl Pallet { } // Return ok. - Ok(()) + Ok(owner_transition_weight) } fn try_set_pending_children(block_number: u64) { diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 644c36a489..c992a32c61 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -2,6 +2,7 @@ use super::*; use crate::coinbase::tao::CreditOf; use alloc::collections::{BTreeMap, BTreeSet}; use frame_support::traits::Imbalance; +use frame_support::weights::Weight; use safe_math::*; use substrate_fixed::types::{U64F64, U96F32}; use subtensor_runtime_common::{AlphaBalance, NetUid, TaoBalance, Token}; @@ -21,7 +22,7 @@ macro_rules! tou64 { } impl Pallet { - pub fn run_coinbase(block_emission_credit: CreditOf) { + pub fn run_coinbase(block_emission_credit: CreditOf) -> Weight { // --- 0. Get current block. let current_block: u64 = Self::get_current_block_as_u64(); let block_emission = U96F32::saturating_from_num(block_emission_credit.peek()); @@ -61,10 +62,13 @@ impl Pallet { ); // --- 5. Drain pending emissions. - let emissions_to_distribute = Self::drain_pending(&subnets, current_block); + let (emissions_to_distribute, owner_transition_weight) = + Self::drain_pending_with_weight(&subnets, current_block); // --- 6. Distribute the emissions to the subnets. Self::distribute_emissions_to_subnets(&emissions_to_distribute); + + owner_transition_weight } pub fn inject_and_maybe_swap( @@ -380,11 +384,22 @@ impl Pallet { subnets: &[NetUid], current_block: u64, ) -> BTreeMap { + Self::drain_pending_with_weight(subnets, current_block).0 + } + + fn drain_pending_with_weight( + subnets: &[NetUid], + current_block: u64, + ) -> ( + BTreeMap, + Weight, + ) { // Map of netuid to (pending_server_alpha, pending_validator_alpha, pending_root_alpha, pending_owner_cut). let mut emissions_to_distribute: BTreeMap< NetUid, (AlphaBalance, AlphaBalance, AlphaBalance, AlphaBalance), > = BTreeMap::new(); + let mut owner_transition_weight = Weight::zero(); // Per-block cap on number of epochs that may run; the rest are deferred 1 block forward // by setting `PendingEpochAt`. let max_epochs_per_block = Self::get_max_epochs_per_block() as u32; @@ -452,7 +467,8 @@ impl Pallet { epochs_run_this_block = epochs_run_this_block.saturating_add(1); // Change subnet owner based on conviction. - Self::change_subnet_owner_if_needed(netuid); + owner_transition_weight + .saturating_accrue(Self::change_subnet_owner_if_needed(netuid)); } else { // Schedule advances below; execution skipped. Pending emissions accumulate // and will be drained by the next successful epoch. @@ -467,7 +483,7 @@ impl Pallet { PendingEpochAt::::insert(netuid, 0); SubnetEpochIndex::::mutate(netuid, |idx| *idx = idx.saturating_add(1)); } - emissions_to_distribute + (emissions_to_distribute, owner_transition_weight) } pub fn distribute_emissions_to_subnets( diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 11aacadc6e..356c03cc4d 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -1717,7 +1717,18 @@ mod dispatches { /// /// * `hotkey`: The hotkey of the beneficiary to mark as subnet owner hotkey. #[pallet::call_index(111)] - #[pallet::weight(::WeightInfo::terminate_lease(T::MaxContributors::get()))] + #[pallet::weight({ + let member_count = + Pallet::::lease_owner_transition_member_count(*lease_id, hotkey); + ::WeightInfo::terminate_lease(T::MaxContributors::get()) + .saturating_add( + ::WeightInfo::transition_subnet_owner_locks( + member_count, + ).saturating_add( + Pallet::::lease_owner_transition_member_count_weight(member_count), + ), + ) + })] pub fn terminate_lease( origin: OriginFor, lease_id: LeaseId, diff --git a/pallets/subtensor/src/macros/hooks.rs b/pallets/subtensor/src/macros/hooks.rs index f4805dac77..500e45d408 100644 --- a/pallets/subtensor/src/macros/hooks.rs +++ b/pallets/subtensor/src/macros/hooks.rs @@ -20,11 +20,12 @@ mod hooks { let block_step_result = Self::block_step(); match block_step_result { - Ok(_) => { + Ok(owner_transition_weight) => { // --- If the block step was successful, return the weight. log::debug!("Successfully ran block step."); <::WeightInfo as crate::weights::WeightInfo>::block_step() .saturating_add(hotkey_swap_clean_up_weight) + .saturating_add(owner_transition_weight) } Err(e) => { // --- If the block step was unsuccessful, return the weight anyway. diff --git a/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs b/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs index ae60ad0c36..5c2abbe799 100644 --- a/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs +++ b/pallets/subtensor/src/migrations/migrate_fix_subnet_hotkey_lock_swaps.rs @@ -1,5 +1,5 @@ use super::*; -use crate::staking::lock::{LockClass, LockState}; +use crate::staking::lock::LockState; use frame_support::weights::Weight; use scale_info::prelude::string::String; use sp_core::crypto::Ss58Codec; @@ -157,8 +157,8 @@ fn mutate_aggregate( let perpetual = DecayingLock::::get(coldkey, netuid) == Some(false); let owner = SubnetOwnerHotkey::::get(netuid) == *hotkey; - match LockClass::from_roles(owner, perpetual) { - LockClass::PerpetualOwner => OwnerLock::::mutate(netuid, |maybe_lock| { + match (owner, perpetual) { + (true, true) => OwnerLock::::mutate(netuid, |maybe_lock| { if let Some(lock) = maybe_lock.take() { let updated = mutate(lock); if is_non_zero_lock(&updated) { @@ -166,7 +166,7 @@ fn mutate_aggregate( } } }), - LockClass::DecayingOwner => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { + (true, false) => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { if let Some(lock) = maybe_lock.take() { let updated = mutate(lock); if is_non_zero_lock(&updated) { @@ -174,7 +174,7 @@ fn mutate_aggregate( } } }), - LockClass::PerpetualGeneral => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + (false, true) => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { if let Some(lock) = maybe_lock.take() { let updated = mutate(lock); if is_non_zero_lock(&updated) { @@ -182,16 +182,14 @@ fn mutate_aggregate( } } }), - LockClass::DecayingGeneral => { - DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { - if let Some(lock) = maybe_lock.take() { - let updated = mutate(lock); - if is_non_zero_lock(&updated) { - *maybe_lock = Some(updated); - } + (false, false) => DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + if let Some(lock) = maybe_lock.take() { + let updated = mutate(lock); + if is_non_zero_lock(&updated) { + *maybe_lock = Some(updated); } - }) - } + } + }), } } @@ -204,33 +202,31 @@ fn add_to_aggregate( let perpetual = DecayingLock::::get(coldkey, netuid) == Some(false); let owner = SubnetOwnerHotkey::::get(netuid) == *hotkey; - match LockClass::from_roles(owner, perpetual) { - LockClass::PerpetualOwner => OwnerLock::::mutate(netuid, |maybe_lock| { + match (owner, perpetual) { + (true, true) => OwnerLock::::mutate(netuid, |maybe_lock| { *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => lock.merge(added), + Some(lock) => lock.add(added), None => added.clone(), }); }), - LockClass::DecayingOwner => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { + (true, false) => DecayingOwnerLock::::mutate(netuid, |maybe_lock| { *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => lock.merge(added), + Some(lock) => lock.add(added), None => added.clone(), }); }), - LockClass::PerpetualGeneral => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + (false, true) => HotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => lock.merge(added), + Some(lock) => lock.add(added), + None => added.clone(), + }); + }), + (false, false) => DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { + *maybe_lock = Some(match maybe_lock.take() { + Some(lock) => lock.add(added), None => added.clone(), }); }), - LockClass::DecayingGeneral => { - DecayingHotkeyLock::::mutate(netuid, hotkey, |maybe_lock| { - *maybe_lock = Some(match maybe_lock.take() { - Some(lock) => lock.merge(added), - None => added.clone(), - }); - }) - } } } diff --git a/pallets/subtensor/src/migrations/migrate_populate_locking_coldkeys.rs b/pallets/subtensor/src/migrations/migrate_populate_locking_coldkeys.rs index c1220c2077..d544fe0c3c 100644 --- a/pallets/subtensor/src/migrations/migrate_populate_locking_coldkeys.rs +++ b/pallets/subtensor/src/migrations/migrate_populate_locking_coldkeys.rs @@ -38,7 +38,7 @@ pub fn migrate_populate_locking_coldkeys() -> Weight { Subtensor::::read_conviction_model_for_hotkey(&coldkey, netuid, &hotkey, now); model.roll_forward(now, unlock_rate, maturity_rate); - if model.individual_lock().is_zero() { + if model.individual_lock().is_dust() { removed_count = removed_count.saturating_add(1); } else { indexed_count = indexed_count.saturating_add(1); diff --git a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs index 6bf328e536..9bbd3dfc09 100644 --- a/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs +++ b/pallets/subtensor/src/migrations/migrate_rebuild_conviction_aggregates.rs @@ -4,7 +4,7 @@ use frame_support::{traits::Get, weights::Weight}; use crate::{ Config, DecayingHotkeyLock, DecayingLock, DecayingOwnerLock, HasMigrationRun, HotkeyLock, Lock, LockingColdkeys, MaturityRate, OwnerLock, Pallet as Subtensor, SubnetOwnerHotkey, UnlockRate, - staking::lock::{ConvictionModel, LockClass, LockState}, + staking::lock::{LockState, roll_lock_state}, }; use subtensor_runtime_common::NetUid; @@ -26,7 +26,7 @@ const OBSERVED_MAINNET_BLOCK: u64 = 8_793_919; fn merge_into(aggregates: &mut BTreeMap, key: K, lock: &LockState) { if let Some(aggregate) = aggregates.get_mut(&key) { - *aggregate = aggregate.merge(lock); + *aggregate = aggregate.add(lock); } else { aggregates.insert(key, lock.clone()); } @@ -116,7 +116,7 @@ pub fn migrate_rebuild_conviction_aggregates() -> Weight { let perpetual_lock = DecayingLock::::get(&coldkey, netuid) == Some(false); weight = weight.saturating_add(T::DbWeight::get().reads(2)); - let rolled = ConvictionModel::roll_forward_lock( + let rolled = roll_lock_state( lock, now, unlock_rate, @@ -125,7 +125,7 @@ pub fn migrate_rebuild_conviction_aggregates() -> Weight { perpetual_lock, ); - if rolled.is_zero() { + if rolled.is_dust() { Lock::::remove((&coldkey, netuid, &hotkey)); removed_dust_count = removed_dust_count.saturating_add(1); weight = weight.saturating_add(T::DbWeight::get().writes(1)); @@ -137,13 +137,13 @@ pub fn migrate_rebuild_conviction_aggregates() -> Weight { retained_count = retained_count.saturating_add(1); weight = weight.saturating_add(T::DbWeight::get().writes(2)); - match LockClass::from_roles(owner_lock, perpetual_lock) { - LockClass::PerpetualOwner => merge_into(&mut perpetual_owner, netuid, &rolled), - LockClass::DecayingOwner => merge_into(&mut decaying_owner, netuid, &rolled), - LockClass::PerpetualGeneral => { + match (owner_lock, perpetual_lock) { + (true, true) => merge_into(&mut perpetual_owner, netuid, &rolled), + (true, false) => merge_into(&mut decaying_owner, netuid, &rolled), + (false, true) => { merge_into(&mut perpetual_general, (netuid, hotkey), &rolled); } - LockClass::DecayingGeneral => { + (false, false) => { merge_into(&mut decaying_general, (netuid, hotkey), &rolled); } } diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 5e5985e783..3dffb5bea9 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -1,6 +1,8 @@ use super::*; +use crate::subnets::leasing::LeaseId; +use crate::weights::WeightInfo; use codec::{Decode, DecodeWithMemTracking, Encode}; -use frame_support::weights::WeightMeter; +use frame_support::weights::{Weight, WeightMeter}; use safe_math::FixedExt; use scale_info::TypeInfo; use sp_std::collections::btree_map::BTreeMap; @@ -13,7 +15,9 @@ pub const ONE_YEAR: u64 = 7200 * 365 + 1800; pub const LOCK_STATE_ZERO_THRESHOLD: u64 = 100; /// Exponential lock state for a coldkey on a subnet. -#[crate::freeze_struct("1f6be20a66128b8d")] +/// This struct is stored in state maps. The additional logic is implemented in +// higher level LockState[class] structs. +#[crate::freeze_struct("eedde2cfd95ddcb1")] #[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo)] pub struct LockState { /// Exponentially decaying locked amount. @@ -25,391 +29,17 @@ pub struct LockState { } impl LockState { - pub fn is_zero(&self) -> bool { + pub fn is_dust(&self) -> bool { self.locked_mass < AlphaBalance::from(LOCK_STATE_ZERO_THRESHOLD) && self.conviction < U64F64::saturating_from_num(LOCK_STATE_ZERO_THRESHOLD) } - pub(crate) fn merge(&self, other: &Self) -> Self { - Self { - locked_mass: self.locked_mass.saturating_add(other.locked_mass), - conviction: self.conviction.saturating_add(other.conviction), - last_update: self.last_update.max(other.last_update), - } - } -} - -#[derive(Clone, Copy, PartialEq, Eq, Debug)] -pub(crate) enum LockClass { - PerpetualGeneral, - DecayingGeneral, - PerpetualOwner, - DecayingOwner, -} - -impl LockClass { - pub(crate) fn from_roles(owner: bool, perpetual: bool) -> Self { - match (owner, perpetual) { - (false, true) => Self::PerpetualGeneral, - (false, false) => Self::DecayingGeneral, - (true, true) => Self::PerpetualOwner, - (true, false) => Self::DecayingOwner, - } - } - - fn is_owner(self) -> bool { - matches!(self, Self::PerpetualOwner | Self::DecayingOwner) - } - - fn is_perpetual(self) -> bool { - matches!(self, Self::PerpetualGeneral | Self::PerpetualOwner) - } -} - -#[derive(Clone, Copy, PartialEq, Eq, Debug)] -struct LockContribution { - locked_mass: AlphaBalance, - conviction: U64F64, -} - -impl From<&LockState> for LockContribution { - fn from(lock: &LockState) -> Self { - Self { - locked_mass: lock.locked_mass, - conviction: lock.conviction, - } - } -} - -/// A struct that incapsulates Lock primitives such as adding, removing, -/// rolling, and updating aggregates. -/// -/// This model has one individual lock state, which relates to the stake owner -/// (locking coldkey) lock and 4 aggregates that are maintained in operations. -pub struct ConvictionModel { - /// Aggregate bucket selected by the individual lock's owner role and lock mode. - lock_class: LockClass, - /// Individual stake owner coldkey lock - individual_lock: LockState, - individual_lock_dirty: bool, - /// Perpetual non-owner aggregate - agg_perpetual_general: LockState, - agg_perpetual_general_dirty: bool, - /// Decaying non-owner aggregate - agg_decaying_general: LockState, - agg_decaying_general_dirty: bool, - /// Perpetual owner aggregate - agg_perpetual_owner: LockState, - agg_perpetual_owner_dirty: bool, - /// Decaying owner aggregate - agg_decaying_owner: LockState, - agg_decaying_owner_dirty: bool, -} - -impl ConvictionModel { - pub fn new( - owner_lock: bool, - perpetual_lock: bool, - individual_lock: LockState, - agg_perpetual_general: LockState, - agg_decaying_general: LockState, - agg_perpetual_owner: LockState, - agg_decaying_owner: LockState, - ) -> Self { - Self { - lock_class: LockClass::from_roles(owner_lock, perpetual_lock), - individual_lock, - individual_lock_dirty: false, - agg_perpetual_general, - agg_perpetual_general_dirty: false, - agg_decaying_general, - agg_decaying_general_dirty: false, - agg_perpetual_owner, - agg_perpetual_owner_dirty: false, - agg_decaying_owner, - agg_decaying_owner_dirty: false, - } - } - - pub fn individual_lock(&self) -> &LockState { - &self.individual_lock - } - - pub fn agg_perpetual_general(&self) -> &LockState { - &self.agg_perpetual_general - } - - pub fn agg_decaying_general(&self) -> &LockState { - &self.agg_decaying_general - } - - pub fn agg_perpetual_owner(&self) -> &LockState { - &self.agg_perpetual_owner - } - - pub fn agg_decaying_owner(&self) -> &LockState { - &self.agg_decaying_owner - } - - pub fn aggregate_lock(&self) -> &LockState { - match self.lock_class { - LockClass::PerpetualGeneral => &self.agg_perpetual_general, - LockClass::DecayingGeneral => &self.agg_decaying_general, - LockClass::PerpetualOwner => &self.agg_perpetual_owner, - LockClass::DecayingOwner => &self.agg_decaying_owner, - } - } - - pub fn individual_lock_dirty(&self) -> bool { - self.individual_lock_dirty - } - - pub fn agg_perpetual_general_dirty(&self) -> bool { - self.agg_perpetual_general_dirty - } - - pub fn agg_decaying_general_dirty(&self) -> bool { - self.agg_decaying_general_dirty - } - - pub fn agg_perpetual_owner_dirty(&self) -> bool { - self.agg_perpetual_owner_dirty - } - - pub fn agg_decaying_owner_dirty(&self) -> bool { - self.agg_decaying_owner_dirty - } - - pub fn merge(&mut self, conv: &ConvictionModel) { - self.individual_lock = self.individual_lock.merge(&conv.individual_lock); - self.individual_lock_dirty = true; - self.agg_perpetual_general = self - .agg_perpetual_general - .merge(&conv.agg_perpetual_general); - self.agg_perpetual_general_dirty = true; - self.agg_decaying_general = self.agg_decaying_general.merge(&conv.agg_decaying_general); - self.agg_decaying_general_dirty = true; - self.agg_perpetual_owner = self.agg_perpetual_owner.merge(&conv.agg_perpetual_owner); - self.agg_perpetual_owner_dirty = true; - self.agg_decaying_owner = self.agg_decaying_owner.merge(&conv.agg_decaying_owner); - self.agg_decaying_owner_dirty = true; - } - - /// Adds locked mass while keeping the individual and aggregate - /// contributions synchronized. - fn add_locked_mass( - &mut self, - amount: AlphaBalance, - now: u64, - unlock_rate: u64, - maturity_rate: u64, - ) { - let mut lock = self.detach_individual(); - lock.locked_mass = lock.locked_mass.saturating_add(amount); - lock = Self::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - self.lock_class.is_owner(), - self.lock_class.is_perpetual(), - ); - self.attach_to_detached_individual(lock); - self.roll_forward_aggregate(now, unlock_rate, maturity_rate); - } - - /// Returns the individual lock rolled to `now` without changing model - /// state or dirty flags. - pub fn rolled_individual(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> LockState { - Self::roll_forward_lock( - self.individual_lock.clone(), - now, - unlock_rate, - maturity_rate, - self.lock_class.is_owner(), - self.lock_class.is_perpetual(), - ) - } - - /// Removes the complete canonical individual contribution from this model - /// and its aggregate bucket. - fn detach_individual(&mut self) -> LockState { - let detached = self.individual_lock.clone(); - let contribution = LockContribution::from(&detached); - self.individual_lock = Self::reduce_lock( - &self.individual_lock, - contribution.locked_mass, - contribution.conviction, - ); - self.individual_lock_dirty = true; - self.reduce_aggregate(contribution); - detached - } - - /// Adds one canonical individual contribution after the previous - /// contribution has been detached from this model and its aggregate. - fn attach_to_detached_individual(&mut self, lock: LockState) { - let contribution = LockContribution::from(&lock); - self.individual_lock = lock; - self.individual_lock_dirty = true; - self.add_to_aggregate(contribution); - } - - /// Rolls the individual lock and its aggregate bucket forward together. - /// - /// Individual locks and their aggregate can have different timestamps - /// because aggregate-only operations may advance the bucket without - /// rewriting every member. Before rolling to `now`, reconstruct the - /// individual's contribution at a common anchor, detach it from the - /// aggregate, roll the remaining members and the individual separately, - /// then merge them again. This prevents both skipping sibling evolution - /// and applying an individual's evolution twice. - pub fn roll_forward(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { - let owner_lock = self.lock_class.is_owner(); - let perpetual_lock = self.lock_class.is_perpetual(); - let aggregate_last_update = self.aggregate_lock().last_update; - let anchor = aggregate_last_update.max(self.individual_lock.last_update); - - let individual_at_anchor = Self::roll_forward_lock_preserving_dust( - self.individual_lock.clone(), - anchor, - unlock_rate, - maturity_rate, - owner_lock, - perpetual_lock, - ); - let aggregate_at_anchor = Self::roll_forward_lock( - self.aggregate_lock().clone(), - anchor, - unlock_rate, - maturity_rate, - owner_lock, - perpetual_lock, - ); - let siblings_at_anchor = Self::reduce_lock( - &aggregate_at_anchor, - individual_at_anchor.locked_mass, - individual_at_anchor.conviction, - ); - - // Preserve sub-threshold member contributions in the sibling remainder - // until those members are detached individually. Applying the - // individual dust threshold to the merged remainder would make a - // later member reconstruction subtract value that is no longer in the - // aggregate. - let rolled_siblings = Self::roll_forward_lock_preserving_dust( - siblings_at_anchor, - now, - unlock_rate, - maturity_rate, - owner_lock, - perpetual_lock, - ); - let rolled_individual = Self::roll_forward_lock( - individual_at_anchor, - now, - unlock_rate, - maturity_rate, - owner_lock, - perpetual_lock, - ); - let rolled_aggregate = rolled_siblings.merge(&rolled_individual); - - self.individual_lock = rolled_individual; - self.individual_lock_dirty = true; - let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = rolled_aggregate; - *aggregate_dirty = true; - } - - fn roll_forward_aggregate(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { - let owner_lock = self.lock_class.is_owner(); - let perpetual_lock = self.lock_class.is_perpetual(); - let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = Self::roll_forward_lock( - aggregate.clone(), - now, - unlock_rate, - maturity_rate, - owner_lock, - perpetual_lock, - ); - *aggregate_dirty = true; - } - - fn add_to_aggregate(&mut self, added: LockContribution) { - let (aggregate, aggregate_dirty) = self.aggregate_mut(); - aggregate.locked_mass = aggregate.locked_mass.saturating_add(added.locked_mass); - aggregate.conviction = aggregate.conviction.saturating_add(added.conviction); - *aggregate_dirty = true; - } - - fn reduce_aggregate(&mut self, removed: LockContribution) { - let (aggregate, aggregate_dirty) = self.aggregate_mut(); - *aggregate = Self::reduce_lock(aggregate, removed.locked_mass, removed.conviction); - *aggregate_dirty = true; - } - - fn force_reduce_individual(&mut self, amount: AlphaBalance, now: u64) { - let rolled = self.individual_lock.clone(); - let new_locked_mass = rolled.locked_mass.saturating_sub(amount); - let locked_mass_diff = rolled.locked_mass.saturating_sub(new_locked_mass); - - let conviction_diff = if new_locked_mass.is_zero() { - self.individual_lock = LockState { - locked_mass: AlphaBalance::ZERO, - conviction: U64F64::saturating_from_num(0), - last_update: now, - }; - rolled.conviction - } else { - let removed_proportion = U64F64::saturating_from_num(u64::from(amount)) - .safe_div(U64F64::saturating_from_num(u64::from(rolled.locked_mass))); - let new_conviction = rolled - .conviction - .saturating_mul(U64F64::saturating_from_num(1).saturating_sub(removed_proportion)); - self.individual_lock = LockState { - locked_mass: new_locked_mass, - conviction: new_conviction, - last_update: now, - }; - rolled.conviction.saturating_sub(new_conviction) - }; - self.individual_lock_dirty = true; - - self.reduce_aggregate(LockContribution { - locked_mass: locked_mass_diff, - conviction: conviction_diff, - }); - } - - fn aggregate_mut(&mut self) -> (&mut LockState, &mut bool) { - match self.lock_class { - LockClass::PerpetualGeneral => ( - &mut self.agg_perpetual_general, - &mut self.agg_perpetual_general_dirty, - ), - LockClass::DecayingGeneral => ( - &mut self.agg_decaying_general, - &mut self.agg_decaying_general_dirty, - ), - LockClass::PerpetualOwner => ( - &mut self.agg_perpetual_owner, - &mut self.agg_perpetual_owner_dirty, - ), - LockClass::DecayingOwner => ( - &mut self.agg_decaying_owner, - &mut self.agg_decaying_owner_dirty, - ), - } - } - - fn reduce_lock(lock: &LockState, locked_mass: AlphaBalance, conviction: U64F64) -> LockState { - LockState { - locked_mass: lock.locked_mass.saturating_sub(locked_mass), - conviction: lock.conviction.saturating_sub(conviction), - last_update: lock.last_update, + fn normalize_dust(mut self) -> Self { + if self.is_dust() { + self.locked_mass = AlphaBalance::ZERO; + self.conviction = U64F64::saturating_from_num(0); } + self } pub fn exp_decay(dt: u64, tau: u64) -> U64F64 { @@ -433,8 +63,7 @@ impl ConvictionModel { } fn calculate_decayed_mass_and_conviction( - locked_mass: AlphaBalance, - conviction: U64F64, + &self, dt: u64, unlock_rate: u64, maturity_rate: u64, @@ -442,9 +71,9 @@ impl ConvictionModel { ) -> (AlphaBalance, U64F64) { let unlock_decay = Self::exp_decay(dt, unlock_rate); let maturity_decay = Self::exp_decay(dt, maturity_rate); - let mass_fixed = U64F64::saturating_from_num(locked_mass); + let mass_fixed = U64F64::saturating_from_num(self.locked_mass); let new_locked_mass = if perpetual_lock { - locked_mass + self.locked_mass } else { unlock_decay .saturating_mul(mass_fixed) @@ -452,7 +81,7 @@ impl ConvictionModel { .into() }; - let conviction_from_existing = maturity_decay.saturating_mul(conviction); + let conviction_from_existing = maturity_decay.saturating_mul(self.conviction); let conviction_from_mass = if perpetual_lock { mass_fixed.saturating_mul(U64F64::saturating_from_num(1).saturating_sub(maturity_decay)) } else if unlock_rate == maturity_rate { @@ -486,74 +115,490 @@ impl ConvictionModel { (new_locked_mass, new_conviction) } - pub fn roll_forward_lock( - lock: LockState, - now: u64, - unlock_rate: u64, - maturity_rate: u64, - owner_lock: bool, - perpetual_lock: bool, - ) -> LockState { - let mut rolled = Self::roll_forward_lock_preserving_dust( - lock, - now, - unlock_rate, - maturity_rate, - owner_lock, - perpetual_lock, - ); + pub(crate) fn add(&self, other: &Self) -> Self { + Self { + locked_mass: self.locked_mass.saturating_add(other.locked_mass), + conviction: self.conviction.saturating_add(other.conviction), + last_update: self.last_update, + } + } +} + +#[derive(Clone, PartialEq, Eq, Debug)] +struct LockStatePerpetualGeneral { + lock: LockState, +} + +#[derive(Clone, PartialEq, Eq, Debug)] +struct LockStateDecayinglGeneral { + lock: LockState, +} + +#[derive(Clone, PartialEq, Eq, Debug)] +struct LockStatePerpetualOwner { + lock: LockState, +} + +#[derive(Clone, PartialEq, Eq, Debug)] +struct LockStateDecayinglOwner { + lock: LockState, +} + +impl LockStatePerpetualGeneral { + pub fn roll_forward(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> Self { + Self { + lock: if now > self.lock.last_update { + let dt = now.saturating_sub(self.lock.last_update); + let (locked_mass, conviction) = self.lock.calculate_decayed_mass_and_conviction( + dt, + unlock_rate, + maturity_rate, + true, + ); + + LockState { + locked_mass, + conviction, + last_update: now, + } + } else { + self.lock.clone() + }, + } + } +} + +impl LockStateDecayinglGeneral { + pub fn roll_forward(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> Self { + Self { + lock: if now > self.lock.last_update { + let dt = now.saturating_sub(self.lock.last_update); + let (locked_mass, conviction) = self.lock.calculate_decayed_mass_and_conviction( + dt, + unlock_rate, + maturity_rate, + false, + ); + + LockState { + locked_mass, + conviction, + last_update: now, + } + } else { + self.lock.clone() + }, + } + } +} + +impl LockStatePerpetualOwner { + pub fn roll_forward(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> Self { + let mut lock = if now > self.lock.last_update { + let dt = now.saturating_sub(self.lock.last_update); + let (locked_mass, conviction) = self.lock.calculate_decayed_mass_and_conviction( + dt, + unlock_rate, + maturity_rate, + true, + ); + + LockState { + locked_mass, + conviction, + last_update: now, + } + } else { + self.lock.clone() + }; + lock.conviction = U64F64::saturating_from_num(u64::from(lock.locked_mass)); + Self { lock } + } +} + +impl LockStateDecayinglOwner { + pub fn roll_forward(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> Self { + let mut lock = if now > self.lock.last_update { + let dt = now.saturating_sub(self.lock.last_update); + let (locked_mass, conviction) = self.lock.calculate_decayed_mass_and_conviction( + dt, + unlock_rate, + maturity_rate, + false, + ); + + LockState { + locked_mass, + conviction, + last_update: now, + } + } else { + self.lock.clone() + }; + lock.conviction = U64F64::saturating_from_num(u64::from(lock.locked_mass)); + Self { lock } + } +} + +/// Class of lock that is determined by owner and perpetual flags. +#[derive(Clone, PartialEq, Eq, Debug)] +enum LockClass { + PerpetualGeneral(LockStatePerpetualGeneral), + DecayingGeneral(LockStateDecayinglGeneral), + PerpetualOwner(LockStatePerpetualOwner), + DecayingOwner(LockStateDecayinglOwner), +} + +impl LockClass { + pub(crate) fn new(lock: LockState, owner: bool, perpetual: bool) -> Self { + match (owner, perpetual) { + (false, true) => Self::PerpetualGeneral(LockStatePerpetualGeneral { lock }), + (false, false) => Self::DecayingGeneral(LockStateDecayinglGeneral { lock }), + (true, true) => Self::PerpetualOwner(LockStatePerpetualOwner { lock }), + (true, false) => Self::DecayingOwner(LockStateDecayinglOwner { lock }), + } + } + + fn lock(&self) -> &LockState { + match self { + Self::PerpetualGeneral(state) => &state.lock, + Self::DecayingGeneral(state) => &state.lock, + Self::PerpetualOwner(state) => &state.lock, + Self::DecayingOwner(state) => &state.lock, + } + } + + fn lock_mut(&mut self) -> &mut LockState { + match self { + Self::PerpetualGeneral(state) => &mut state.lock, + Self::DecayingGeneral(state) => &mut state.lock, + Self::PerpetualOwner(state) => &mut state.lock, + Self::DecayingOwner(state) => &mut state.lock, + } + } + + pub(crate) fn into_lock(self) -> LockState { + match self { + Self::PerpetualGeneral(state) => state.lock, + Self::DecayingGeneral(state) => state.lock, + Self::PerpetualOwner(state) => state.lock, + Self::DecayingOwner(state) => state.lock, + } + } + + pub(crate) fn roll_forward(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> Self { + match self { + Self::PerpetualGeneral(state) => { + Self::PerpetualGeneral(state.roll_forward(now, unlock_rate, maturity_rate)) + } + Self::DecayingGeneral(state) => { + Self::DecayingGeneral(state.roll_forward(now, unlock_rate, maturity_rate)) + } + Self::PerpetualOwner(state) => { + Self::PerpetualOwner(state.roll_forward(now, unlock_rate, maturity_rate)) + } + Self::DecayingOwner(state) => { + Self::DecayingOwner(state.roll_forward(now, unlock_rate, maturity_rate)) + } + } + } + + fn flags(&self) -> (bool, bool) { + match self { + Self::PerpetualGeneral(_) => (false, true), + Self::DecayingGeneral(_) => (false, false), + Self::PerpetualOwner(_) => (true, true), + Self::DecayingOwner(_) => (true, false), + } + } +} + +pub fn roll_lock_state( + lock: LockState, + now: u64, + unlock_rate: u64, + maturity_rate: u64, + owner: bool, + perpetual: bool, +) -> LockState { + LockClass::new(lock, owner, perpetual) + .roll_forward(now, unlock_rate, maturity_rate) + .into_lock() + .normalize_dust() +} + +/// A struct that incapsulates Lock primitives such as adding, removing, +/// rolling, and updating aggregates. +pub struct ConvictionModel { + individual_lock: LockClass, + aggregate_lock: LockClass, +} + +impl ConvictionModel { + pub fn new( + owner_lock: bool, + perpetual_lock: bool, + individual_lock_state: LockState, + aggregate_lock_state: LockState, + ) -> Self { + Self { + individual_lock: LockClass::new(individual_lock_state, owner_lock, perpetual_lock), + aggregate_lock: LockClass::new(aggregate_lock_state, owner_lock, perpetual_lock), + } + } + + pub fn individual_lock(&self) -> &LockState { + self.individual_lock.lock() + } + + pub fn aggregate_lock(&self) -> &LockState { + self.aggregate_lock.lock() + } + + pub fn rolled_individual(&self, now: u64, unlock_rate: u64, maturity_rate: u64) -> LockState { + self.individual_lock + .roll_forward(now, unlock_rate, maturity_rate) + .into_lock() + .normalize_dust() + } + + pub fn merge(&mut self, conv: &ConvictionModel) { + match ( + &self.individual_lock, + &self.aggregate_lock, + &conv.individual_lock, + &conv.aggregate_lock, + ) { + ( + LockClass::PerpetualGeneral(_), + LockClass::PerpetualGeneral(_), + LockClass::PerpetualGeneral(_), + LockClass::PerpetualGeneral(_), + ) + | ( + LockClass::DecayingGeneral(_), + LockClass::DecayingGeneral(_), + LockClass::DecayingGeneral(_), + LockClass::DecayingGeneral(_), + ) + | ( + LockClass::PerpetualOwner(_), + LockClass::PerpetualOwner(_), + LockClass::PerpetualOwner(_), + LockClass::PerpetualOwner(_), + ) + | ( + LockClass::DecayingOwner(_), + LockClass::DecayingOwner(_), + LockClass::DecayingOwner(_), + LockClass::DecayingOwner(_), + ) => {} + _ => { + log::error!("Cannot merge conviction models with different lock classes"); + return; + } + } + + let individual = self.individual_lock.lock().add(conv.individual_lock.lock()); + let aggregate = self.aggregate_lock.lock().add(conv.aggregate_lock.lock()); + *self.individual_lock.lock_mut() = individual; + *self.aggregate_lock.lock_mut() = aggregate; + } + + /// Rolls the individual lock and its aggregate bucket forward together. + /// If individual lock becomes dust, makes it zero and removes it from the aggregate. + pub fn roll_forward(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { + if self.individual_lock.flags() != self.aggregate_lock.flags() { + log::error!( + "Cannot roll conviction model with different individual and aggregate classes" + ); + return; + } + + self.individual_lock = self + .individual_lock + .roll_forward(now, unlock_rate, maturity_rate); + self.aggregate_lock = self + .aggregate_lock + .roll_forward(now, unlock_rate, maturity_rate); + + self.collect_individual_dust(); + } + + /// Rolls the model forward and adds locked mass while keeping the individual and + /// aggregate contributions synchronized. + fn add_locked_mass( + &mut self, + amount: AlphaBalance, + now: u64, + unlock_rate: u64, + maturity_rate: u64, + ) { + self.roll_forward(now, unlock_rate, maturity_rate); + + let owner_lock = match (&self.individual_lock, &self.aggregate_lock) { + (LockClass::PerpetualGeneral(_), LockClass::PerpetualGeneral(_)) + | (LockClass::DecayingGeneral(_), LockClass::DecayingGeneral(_)) => false, + (LockClass::PerpetualOwner(_), LockClass::PerpetualOwner(_)) + | (LockClass::DecayingOwner(_), LockClass::DecayingOwner(_)) => true, + _ => { + log::error!("Cannot add locked mass to different individual and aggregate classes"); + return; + } + }; + + let individual = self.individual_lock.lock_mut(); + let aggregate = self.aggregate_lock.lock_mut(); + individual.locked_mass = individual.locked_mass.saturating_add(amount); + aggregate.locked_mass = aggregate.locked_mass.saturating_add(amount); + if owner_lock { + individual.conviction = U64F64::saturating_from_num(u64::from(individual.locked_mass)); + aggregate.conviction = U64F64::saturating_from_num(u64::from(aggregate.locked_mass)); + } + + self.collect_individual_dust(); + } + + fn force_reduce_individual(&mut self, amount: AlphaBalance, now: u64) { + if self.individual_lock.flags() != self.aggregate_lock.flags() { + log::error!("Cannot reduce lock with different individual and aggregate classes"); + return; + } + + let before = self.individual_lock.lock().clone(); + let new_locked_mass = before.locked_mass.saturating_sub(amount); + let new_conviction = if new_locked_mass.is_zero() { + U64F64::saturating_from_num(0) + } else { + let remaining = U64F64::saturating_from_num(u64::from(new_locked_mass)) + .safe_div(U64F64::saturating_from_num(u64::from(before.locked_mass))); + before.conviction.saturating_mul(remaining) + }; + + let individual = self.individual_lock.lock_mut(); + individual.locked_mass = new_locked_mass; + individual.conviction = new_conviction; + individual.last_update = now; + + let aggregate = self.aggregate_lock.lock_mut(); + aggregate.locked_mass = aggregate + .locked_mass + .saturating_sub(before.locked_mass.saturating_sub(new_locked_mass)); + aggregate.conviction = aggregate + .conviction + .saturating_sub(before.conviction.saturating_sub(new_conviction)); + + self.collect_individual_dust(); + } + + fn collect_individual_dust(&mut self) { + if !self.individual_lock.lock().is_dust() { + return; + } + + let dust = self.individual_lock.lock().clone(); + let aggregate = self.aggregate_lock.lock_mut(); + aggregate.locked_mass = aggregate.locked_mass.saturating_sub(dust.locked_mass); + aggregate.conviction = aggregate.conviction.saturating_sub(dust.conviction); + + let individual = self.individual_lock.lock_mut(); + individual.locked_mass = AlphaBalance::ZERO; + individual.conviction = U64F64::saturating_from_num(0); + } + + fn roll_forward_aggregate(&mut self, now: u64, unlock_rate: u64, maturity_rate: u64) { + self.aggregate_lock = self + .aggregate_lock + .roll_forward(now, unlock_rate, maturity_rate); + } + + fn cloned(&self) -> Self { + Self { + individual_lock: self.individual_lock.clone(), + aggregate_lock: self.aggregate_lock.clone(), + } + } + + fn remove_individual_contribution(&mut self) -> LockState { + let contribution = self.individual_lock.lock().clone(); + let aggregate = self.aggregate_lock.lock_mut(); + aggregate.locked_mass = aggregate + .locked_mass + .saturating_sub(contribution.locked_mass); + aggregate.conviction = aggregate.conviction.saturating_sub(contribution.conviction); + *self.individual_lock.lock_mut() = LockState { + locked_mass: AlphaBalance::ZERO, + conviction: U64F64::saturating_from_num(0), + last_update: contribution.last_update, + }; + contribution + } + + fn replace_individual(&mut self, replacement: LockState) { + let previous = self.individual_lock.lock().clone(); + let aggregate = self.aggregate_lock.lock_mut(); + aggregate.locked_mass = aggregate + .locked_mass + .saturating_sub(previous.locked_mass) + .saturating_add(replacement.locked_mass); + aggregate.conviction = aggregate + .conviction + .saturating_sub(previous.conviction) + .saturating_add(replacement.conviction); + *self.individual_lock.lock_mut() = replacement; + } + + pub fn set_perpetual(&mut self, perpetual: bool) -> Self { + let individual_flags = self.individual_lock.flags(); + if individual_flags != self.aggregate_lock.flags() { + log::error!( + "Cannot change perpetual behavior for different individual and aggregate classes" + ); + return self.cloned(); + } - if rolled.is_zero() { - rolled.locked_mass = AlphaBalance::ZERO; - rolled.conviction = U64F64::saturating_from_num(0); + let (owner, currently_perpetual) = individual_flags; + if currently_perpetual == perpetual { + return self.cloned(); } - rolled + let contribution = self.remove_individual_contribution(); + ConvictionModel::new(owner, perpetual, contribution.clone(), contribution) } - /// Evolves a lock without applying the individual dust threshold. - /// - /// Aggregate synchronization uses this to reconstruct and detach the - /// member's full contribution at the aggregate timestamp. Dust cleanup is - /// applied after the member and the sibling remainder are separated. - fn roll_forward_lock_preserving_dust( - lock: LockState, - now: u64, - unlock_rate: u64, - maturity_rate: u64, - owner_lock: bool, - perpetual_lock: bool, - ) -> LockState { - let mut rolled = if now > lock.last_update { - let dt = now.saturating_sub(lock.last_update); - let (new_locked_mass, new_conviction) = Self::calculate_decayed_mass_and_conviction( - lock.locked_mass, - lock.conviction, - dt, - unlock_rate, - maturity_rate, - perpetual_lock, + pub fn set_owner(&mut self, owner: bool) -> Self { + let individual_flags = self.individual_lock.flags(); + if individual_flags != self.aggregate_lock.flags() { + log::error!( + "Cannot change owner behavior for different individual and aggregate classes" ); + return self.cloned(); + } - LockState { - locked_mass: new_locked_mass, - conviction: new_conviction, - last_update: now, - } - } else { - lock - }; + let (currently_owner, perpetual) = individual_flags; + if currently_owner == owner { + return self.cloned(); + } - if owner_lock { - rolled.conviction = U64F64::saturating_from_num(u64::from(rolled.locked_mass)); + let mut contribution = self.remove_individual_contribution(); + if owner { + contribution.conviction = + U64F64::saturating_from_num(u64::from(contribution.locked_mass)); } - rolled + ConvictionModel::new(owner, perpetual, contribution.clone(), contribution) + } + + fn aggregate_mut(&mut self) -> &mut LockState { + self.aggregate_lock.lock_mut() } } impl Pallet { pub fn add_locking_coldkey(hotkey: &T::AccountId, netuid: NetUid, coldkey: &T::AccountId) { + if LockingColdkeys::::contains_key((netuid, hotkey, coldkey)) { + return; + } LockingColdkeys::::insert((netuid, hotkey, coldkey), ()); } @@ -562,7 +607,52 @@ impl Pallet { netuid: NetUid, coldkey: &T::AccountId, ) { - LockingColdkeys::::remove((netuid, hotkey, coldkey)); + let _ = LockingColdkeys::::take((netuid, hotkey, coldkey)); + } + + /// Number of indexed individual locks touched by an ownership transition. + /// + /// REVIEW NOTE: This scan is intentionally unbounded. Ownership transitions are + /// exceptionally rare (expected only a few times per year), and the mainnet scan + /// performed for the conviction migration found at most 44 lock rows on one subnet. + /// Reviewers should not request a maintained counter or staged transition solely + /// because this iterator is unbounded; the deliberate tradeoff is to charge the + /// complete member-scaled work instead of adding permanent storage bookkeeping. + pub fn owner_transition_member_count(netuid: NetUid, new_owner_hotkey: &T::AccountId) -> u32 { + let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); + let old_owner_members = LockingColdkeys::::iter_prefix((netuid, &old_owner_hotkey)) + .fold(0u32, |count, _| count.saturating_add(1)); + + if &old_owner_hotkey == new_owner_hotkey { + return old_owner_members; + } + + LockingColdkeys::::iter_prefix((netuid, new_owner_hotkey)) + .fold(old_owner_members, |count, _| count.saturating_add(1)) + } + + /// Database cost of looking up an ownership transition's member count before dispatch. + pub fn owner_transition_member_count_weight(member_count: u32) -> Weight { + // One SubnetOwnerHotkey read, one read per indexed member, and one terminal + // read for each of the two LockingColdkeys prefix iterators. This slightly + // overcharges the no-op same-hotkey case, which only runs one iterator. + T::DbWeight::get().reads(u64::from(member_count).saturating_add(3)) + } + + /// Number of indexed individual locks touched when terminating a lease. + pub fn lease_owner_transition_member_count( + lease_id: LeaseId, + new_owner_hotkey: &T::AccountId, + ) -> u32 { + SubnetLeases::::get(lease_id) + .map(|lease| Self::owner_transition_member_count(lease.netuid, new_owner_hotkey)) + .unwrap_or(0) + } + + /// Database cost of looking up a lease ownership transition's member count before dispatch. + pub fn lease_owner_transition_member_count_weight(member_count: u32) -> Weight { + // SubnetLeases plus the ordinary ownership-transition count lookup. + T::DbWeight::get().reads(u64::from(member_count).saturating_add(4)) } pub fn account_rejects_locked_alpha(coldkey: &T::AccountId) -> bool { @@ -606,7 +696,7 @@ impl Pallet { hotkey: &T::AccountId, lock_state: LockState, ) { - if lock_state.is_zero() { + if lock_state.is_dust() { Self::maybe_remove_locking_coldkey(hotkey, netuid, coldkey); // If there is no record previously, this is a no-op Lock::::remove((coldkey, netuid, hotkey)); @@ -682,14 +772,43 @@ impl Pallet { hotkey: &T::AccountId, now: u64, ) -> ConvictionModel { + let owner_lock = Self::is_subnet_owner_hotkey(netuid, hotkey); + let perpetual_lock = Self::is_perpetual_lock(coldkey, netuid); + Self::read_conviction_model_for_class( + coldkey, + netuid, + hotkey, + now, + owner_lock, + perpetual_lock, + ) + } + + fn read_conviction_model_for_class( + coldkey: &T::AccountId, + netuid: NetUid, + hotkey: &T::AccountId, + now: u64, + owner_lock: bool, + perpetual_lock: bool, + ) -> ConvictionModel { + let aggregate_lock = match (owner_lock, perpetual_lock) { + (false, true) => { + HotkeyLock::::get(netuid, hotkey).unwrap_or_else(|| Self::empty_lock(now)) + } + (false, false) => DecayingHotkeyLock::::get(netuid, hotkey) + .unwrap_or_else(|| Self::empty_lock(now)), + (true, true) => OwnerLock::::get(netuid).unwrap_or_else(|| Self::empty_lock(now)), + (true, false) => { + DecayingOwnerLock::::get(netuid).unwrap_or_else(|| Self::empty_lock(now)) + } + }; + ConvictionModel::new( - Self::is_subnet_owner_hotkey(netuid, hotkey), - Self::is_perpetual_lock(coldkey, netuid), + owner_lock, + perpetual_lock, Lock::::get((coldkey, netuid, hotkey)).unwrap_or_else(|| Self::empty_lock(now)), - HotkeyLock::::get(netuid, hotkey).unwrap_or_else(|| Self::empty_lock(now)), - DecayingHotkeyLock::::get(netuid, hotkey).unwrap_or_else(|| Self::empty_lock(now)), - OwnerLock::::get(netuid).unwrap_or_else(|| Self::empty_lock(now)), - DecayingOwnerLock::::get(netuid).unwrap_or_else(|| Self::empty_lock(now)), + aggregate_lock, ) } @@ -712,24 +831,21 @@ impl Pallet { hotkey: &T::AccountId, model: ConvictionModel, ) { - if model.individual_lock_dirty() { - Self::insert_lock_state(coldkey, netuid, hotkey, model.individual_lock().clone()); - } - if model.agg_perpetual_general_dirty() { - Self::insert_hotkey_lock_state(netuid, hotkey, model.agg_perpetual_general().clone()); - } - if model.agg_decaying_general_dirty() { - Self::insert_decaying_hotkey_lock_state( - netuid, - hotkey, - model.agg_decaying_general().clone(), - ); - } - if model.agg_perpetual_owner_dirty() { - Self::insert_owner_lock_state(netuid, model.agg_perpetual_owner().clone()); - } - if model.agg_decaying_owner_dirty() { - Self::insert_decaying_owner_lock_state(netuid, model.agg_decaying_owner().clone()); + Self::insert_lock_state(coldkey, netuid, hotkey, model.individual_lock().clone()); + + match model.aggregate_lock { + LockClass::PerpetualGeneral(aggregate) => { + Self::insert_hotkey_lock_state(netuid, hotkey, aggregate.lock); + } + LockClass::DecayingGeneral(aggregate) => { + Self::insert_decaying_hotkey_lock_state(netuid, hotkey, aggregate.lock); + } + LockClass::PerpetualOwner(aggregate) => { + Self::insert_owner_lock_state(netuid, aggregate.lock); + } + LockClass::DecayingOwner(aggregate) => { + Self::insert_decaying_owner_lock_state(netuid, aggregate.lock); + } } } @@ -741,23 +857,24 @@ impl Pallet { ensure!(Self::if_subnet_exist(netuid), Error::::SubnetNotExists); let now = Self::get_current_block_as_u64(); + let unlock_rate = UnlockRate::::get(); + let maturity_rate = MaturityRate::::get(); let current_enabled = Self::is_perpetual_lock(coldkey, netuid); - if let Some((hotkey, mut model)) = Self::read_conviction_model(coldkey, netuid, now) { - model.roll_forward(now, UnlockRate::::get(), MaturityRate::::get()); - let rolled = model.individual_lock().clone(); - Self::save_conviction_model(coldkey, netuid, &hotkey, model); - - if current_enabled != enabled { - Self::reduce_aggregate_lock( - coldkey, - &hotkey, - netuid, - rolled.locked_mass, - rolled.conviction, - ); + let reclassified_model = if current_enabled == enabled { + if let Some((hotkey, mut model)) = Self::read_conviction_model(coldkey, netuid, now) { + model.roll_forward(now, unlock_rate, maturity_rate); + Self::save_conviction_model(coldkey, netuid, &hotkey, model); } - } + None + } else { + Self::read_conviction_model(coldkey, netuid, now).map(|(hotkey, mut model)| { + model.roll_forward(now, unlock_rate, maturity_rate); + let reclassified = model.set_perpetual(enabled); + Self::save_conviction_model(coldkey, netuid, &hotkey, model); + (hotkey, reclassified) + }) + }; if enabled { DecayingLock::::insert(coldkey, netuid, false); @@ -765,11 +882,14 @@ impl Pallet { DecayingLock::::remove(coldkey, netuid); } - if current_enabled != enabled - && let Some((hotkey, model)) = Self::read_conviction_model(coldkey, netuid, now) - { - Self::add_aggregate_lock(coldkey, &hotkey, netuid, model.individual_lock().clone()); + if let Some((hotkey, reclassified)) = reclassified_model { + let mut destination = + Self::read_conviction_model_for_hotkey(coldkey, netuid, &hotkey, now); + destination.roll_forward(now, unlock_rate, maturity_rate); + destination.merge(&reclassified); + Self::save_conviction_model(coldkey, netuid, &hotkey, destination); } + Self::deposit_event(Event::PerpetualLockUpdated { coldkey: coldkey.clone(), netuid, @@ -978,8 +1098,9 @@ impl Pallet { let now = Self::get_current_block_as_u64(); let mut model = Self::read_conviction_model_for_hotkey(coldkey, netuid, hotkey, now); model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); - model.add_to_aggregate(LockContribution::from(&added)); - model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); + let aggregate = model.aggregate_mut(); + aggregate.locked_mass = aggregate.locked_mass.saturating_add(added.locked_mass); + aggregate.conviction = aggregate.conviction.saturating_add(added.conviction); Self::save_conviction_model(coldkey, netuid, hotkey, model); } @@ -994,10 +1115,9 @@ impl Pallet { let now = Self::get_current_block_as_u64(); let mut model = Self::read_conviction_model_for_hotkey(coldkey, netuid, hotkey, now); model.roll_forward_aggregate(now, UnlockRate::::get(), MaturityRate::::get()); - model.reduce_aggregate(LockContribution { - locked_mass: amount, - conviction, - }); + let aggregate = model.aggregate_mut(); + aggregate.locked_mass = aggregate.locked_mass.saturating_sub(amount); + aggregate.conviction = aggregate.conviction.saturating_sub(conviction); Self::save_conviction_model(coldkey, netuid, hotkey, model); } @@ -1009,56 +1129,24 @@ impl Pallet { let maturity_rate = MaturityRate::::get(); let perpetual_conviction = HotkeyLock::::get(netuid, hotkey) .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, true).conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); let decaying_conviction = DecayingHotkeyLock::::get(netuid, hotkey) .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - false, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, false).conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); let hotkey_conviction = perpetual_conviction.saturating_add(decaying_conviction); if hotkey == &SubnetOwnerHotkey::::get(netuid) { let owner_conviction = OwnerLock::::get(netuid) .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, true, true).conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); let decaying_owner_conviction = DecayingOwnerLock::::get(netuid) .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - false, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false).conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); hotkey_conviction @@ -1076,58 +1164,26 @@ impl Pallet { let maturity_rate = MaturityRate::::get(); let hotkey_conviction = HotkeyLock::::iter_prefix(netuid) .map(|(_hotkey, lock)| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, true).conviction }) .fold(U64F64::saturating_from_num(0), |acc, conviction| { acc.saturating_add(conviction) }); let decaying_hotkey_conviction = DecayingHotkeyLock::::iter_prefix(netuid) .map(|(_hotkey, lock)| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - false, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, false).conviction }) .fold(U64F64::saturating_from_num(0), |acc, conviction| { acc.saturating_add(conviction) }); let owner_conviction = OwnerLock::::get(netuid) .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, true, true).conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); let decaying_owner_conviction = DecayingOwnerLock::::get(netuid) .map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - false, - ) - .conviction + roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false).conviction }) .unwrap_or_else(|| U64F64::saturating_from_num(0)); @@ -1145,28 +1201,14 @@ impl Pallet { let mut scores: BTreeMap = BTreeMap::new(); HotkeyLock::::iter_prefix(netuid).for_each(|(hotkey, lock)| { - let rolled = ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ); + let rolled = roll_lock_state(lock, now, unlock_rate, maturity_rate, false, true); let entry = scores .entry(hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); *entry = entry.saturating_add(rolled.conviction); }); DecayingHotkeyLock::::iter_prefix(netuid).for_each(|(hotkey, lock)| { - let rolled = ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - false, - ); + let rolled = roll_lock_state(lock, now, unlock_rate, maturity_rate, false, false); let entry = scores .entry(hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); @@ -1174,14 +1216,7 @@ impl Pallet { }); if let Some(lock) = OwnerLock::::get(netuid) { let owner_hotkey = SubnetOwnerHotkey::::get(netuid); - let rolled = ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ); + let rolled = roll_lock_state(lock, now, unlock_rate, maturity_rate, true, true); let entry = scores .entry(owner_hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); @@ -1189,14 +1224,7 @@ impl Pallet { } if let Some(lock) = DecayingOwnerLock::::get(netuid) { let owner_hotkey = SubnetOwnerHotkey::::get(netuid); - let rolled = ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - false, - ); + let rolled = roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false); let entry = scores .entry(owner_hotkey) .or_insert_with(|| U64F64::saturating_from_num(0)); @@ -1209,110 +1237,99 @@ impl Pallet { .map(|(hotkey, _)| hotkey) } - /// Rebuild one hotkey's aggregate buckets from its canonical individual rows - /// using the role it will have after an ownership transition. - fn rebuild_hotkey_lock_buckets_for_role( + fn transition_hotkey_lock_owner_class( netuid: NetUid, hotkey: &T::AccountId, - owner_lock: bool, + previous_owner: bool, + new_owner: bool, now: u64, unlock_rate: u64, maturity_rate: u64, - ) { - // Collect before rewriting LockingColdkeys so dust and orphan cleanup cannot - // disturb the prefix iterator. + ) -> u32 { + // Intentionally unbounded: ownership changes are rare, and the full + // member-scaled work is charged. See owner_transition_member_count for + // the operational rationale and observed mainnet size. let coldkeys: Vec = LockingColdkeys::::iter_prefix((netuid, hotkey)) .map(|(coldkey, ())| coldkey) .collect(); - let mut perpetual_aggregate = Self::empty_lock(now); - let mut decaying_aggregate = Self::empty_lock(now); + let mut transitioned = 0u32; for coldkey in coldkeys { - let Some(lock) = Lock::::get((&coldkey, netuid, hotkey)) else { + if !Lock::::contains_key((&coldkey, netuid, hotkey)) { Self::maybe_remove_locking_coldkey(hotkey, netuid, &coldkey); continue; - }; + } + let perpetual_lock = Self::is_perpetual_lock(&coldkey, netuid); - let rolled = ConvictionModel::roll_forward_lock( - lock, + let mut source = Self::read_conviction_model_for_class( + &coldkey, + netuid, + hotkey, now, - unlock_rate, - maturity_rate, - owner_lock, + previous_owner, perpetual_lock, ); + source.roll_forward(now, unlock_rate, maturity_rate); + let contribution = source.set_owner(new_owner); + Self::save_conviction_model(&coldkey, netuid, hotkey, source); - // Persist the role-adjusted member before deriving its aggregate. In - // particular, owner promotion must make the full-conviction boost - // canonical on every individual row rather than only on the aggregate. - Self::insert_lock_state(&coldkey, netuid, hotkey, rolled.clone()); - if rolled.is_zero() { - continue; - } + let mut destination = Self::read_conviction_model_for_class( + &coldkey, + netuid, + hotkey, + now, + new_owner, + perpetual_lock, + ); + destination.roll_forward(now, unlock_rate, maturity_rate); + destination.merge(&contribution); + Self::save_conviction_model(&coldkey, netuid, hotkey, destination); - match LockClass::from_roles(owner_lock, perpetual_lock) { - LockClass::PerpetualGeneral | LockClass::PerpetualOwner => { - perpetual_aggregate = perpetual_aggregate.merge(&rolled); - } - LockClass::DecayingGeneral | LockClass::DecayingOwner => { - decaying_aggregate = decaying_aggregate.merge(&rolled); - } - } + transitioned = transitioned.saturating_add(1); } - if owner_lock { - Self::insert_owner_lock_state(netuid, perpetual_aggregate); - Self::insert_decaying_owner_lock_state(netuid, decaying_aggregate); - } else { - Self::insert_hotkey_lock_state(netuid, hotkey, perpetual_aggregate); - Self::insert_decaying_hotkey_lock_state(netuid, hotkey, decaying_aggregate); - } + transitioned } /// Reclassify canonical individual locks and their aggregate buckets when a /// subnet's owner hotkey changes. /// /// This must run before updating [`SubnetOwnerHotkey`]. Every member of the - /// outgoing and incoming hotkeys is persisted under its new role, then the - /// affected aggregates are rebuilt from those rows. Keeping the owner boost - /// on both representations prevents it becoming orphaned after demotion. + /// outgoing and incoming hotkeys is rolled to now and moved between the + /// corresponding aggregate classes. Keeping the owner boost on both + /// representations prevents it becoming orphaned after demotion. pub(crate) fn transition_subnet_owner_lock_aggregates( netuid: NetUid, old_owner_hotkey: &T::AccountId, new_owner_hotkey: &T::AccountId, - ) { + ) -> u32 { let now = Self::get_current_block_as_u64(); let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); - - // Discard aggregate-only history for the affected hotkeys. The rows below - // are the canonical source of truth for the rebuilt buckets. - OwnerLock::::remove(netuid); - DecayingOwnerLock::::remove(netuid); - HotkeyLock::::remove(netuid, old_owner_hotkey); - DecayingHotkeyLock::::remove(netuid, old_owner_hotkey); - if old_owner_hotkey != new_owner_hotkey { - HotkeyLock::::remove(netuid, new_owner_hotkey); - DecayingHotkeyLock::::remove(netuid, new_owner_hotkey); - - Self::rebuild_hotkey_lock_buckets_for_role( - netuid, - old_owner_hotkey, - false, - now, - unlock_rate, - maturity_rate, - ); + if old_owner_hotkey == new_owner_hotkey { + return 0; } - Self::rebuild_hotkey_lock_buckets_for_role( + let demoted = Self::transition_hotkey_lock_owner_class( + netuid, + old_owner_hotkey, + true, + false, + now, + unlock_rate, + maturity_rate, + ); + let promoted = Self::transition_hotkey_lock_owner_class( netuid, new_owner_hotkey, + false, true, now, unlock_rate, maturity_rate, ); + + demoted.saturating_add(promoted) } /// Reassigns subnet ownership to the current lock-conviction leader when the subnet @@ -1324,23 +1341,23 @@ impl Pallet { /// hotkey, and its owning coldkey becomes the subnet owner coldkey. The new owner /// hotkey's conviction is then progressed to its current locked mass so the new /// owner starts with full owner conviction. - pub fn change_subnet_owner_if_needed(netuid: NetUid) { + pub fn change_subnet_owner_if_needed(netuid: NetUid) -> Weight { // No outstanding alpha means there is no meaningful 10% conviction threshold. let subnet_alpha_out = SubnetAlphaOut::::get(netuid); if subnet_alpha_out.is_zero() { - return; + return Weight::zero(); } // Ownership can only be reassigned after the subnet has aged for one year. let now = Self::get_current_block_as_u64(); let registered_at = NetworkRegisteredAt::::get(netuid); if now < registered_at.saturating_add(ONE_YEAR) { - return; + return Weight::zero(); } // Pick the hotkey with the highest rolled aggregate conviction. let Some(king_hotkey) = Self::subnet_king(netuid) else { - return; + return Weight::zero(); }; // The challenger must itself hold at least 10% of subnet alpha out. @@ -1350,19 +1367,19 @@ impl Pallet { if king_conviction.saturating_mul(U64F64::saturating_from_num(10)) < U64F64::saturating_from_num(u64::from(subnet_alpha_out)) { - return; + return Weight::zero(); } // The king hotkey must resolve to a real coldkey owner. let new_owner_coldkey = Self::get_owning_coldkey_for_hotkey(&king_hotkey); if new_owner_coldkey == DefaultAccount::::get() { - return; + return Weight::zero(); } // If the winning hotkey already belongs to the current owner, nothing changes. let current_owner_coldkey = SubnetOwner::::get(netuid); if new_owner_coldkey == current_owner_coldkey { - return; + return Weight::zero(); } let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); @@ -1370,10 +1387,11 @@ impl Pallet { if Self::get_uid_for_net_and_hotkey(netuid, &king_hotkey).is_err() && Self::register_neuron(netuid, &king_hotkey).is_err() { - return; + return Weight::zero(); } - Self::transition_subnet_owner_lock_aggregates(netuid, &old_owner_hotkey, &king_hotkey); + let transitioned_members = + Self::transition_subnet_owner_lock_aggregates(netuid, &old_owner_hotkey, &king_hotkey); // Reassign subnet owner coldkey and owner hotkey. SubnetOwner::::insert(netuid, new_owner_coldkey.clone()); @@ -1383,6 +1401,8 @@ impl Pallet { old_coldkey: current_owner_coldkey, new_coldkey: new_owner_coldkey, }); + + ::WeightInfo::transition_subnet_owner_locks(transitioned_members) } /// Ensure the coldkey does not have an active lock on any subnets. @@ -1392,7 +1412,7 @@ impl Pallet { let maturity_rate = MaturityRate::::get(); for ((netuid, hotkey), lock) in Lock::::iter_prefix((coldkey,)) { - let rolled = ConvictionModel::roll_forward_lock( + let rolled = roll_lock_state( lock, now, unlock_rate, @@ -1440,7 +1460,7 @@ impl Pallet { let perpetual_lock = decaying_locks_to_transfer .iter() .any(|(decaying_netuid, decaying)| *decaying_netuid == netuid && !*decaying); - let old_lock = ConvictionModel::roll_forward_lock( + let old_lock = roll_lock_state( lock, now, unlock_rate, @@ -1486,7 +1506,7 @@ impl Pallet { // Insert locks for the new coldkey and add to the destination aggregate // buckets after the flags have moved. for (netuid, hotkey, old_lock, perpetual_lock) in rolled_locks_to_transfer { - let new_lock = ConvictionModel::roll_forward_lock( + let new_lock = roll_lock_state( old_lock.clone(), now, unlock_rate, @@ -1586,7 +1606,7 @@ impl Pallet { .iter() .any(|(rebuild_netuid, _, is_owner)| *rebuild_netuid == netuid && *is_owner); let perpetual_lock = Self::is_perpetual_lock(&coldkey, netuid); - let rolled = ConvictionModel::roll_forward_lock( + let rolled = roll_lock_state( lock, now, unlock_rate, @@ -1594,7 +1614,7 @@ impl Pallet { old_owner_lock, perpetual_lock, ); - let moved = ConvictionModel::roll_forward_lock( + let moved = roll_lock_state( rolled, now, unlock_rate, @@ -1613,49 +1633,18 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); let moved_perpetual_lock = if old_was_owner { - OwnerLock::::take(netuid).map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ) - }) + OwnerLock::::take(netuid) + .map(|lock| roll_lock_state(lock, now, unlock_rate, maturity_rate, true, true)) } else { - HotkeyLock::::take(netuid, old_hotkey).map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ) - }) + HotkeyLock::::take(netuid, old_hotkey) + .map(|lock| roll_lock_state(lock, now, unlock_rate, maturity_rate, false, true)) }; let moved_decaying_lock = if old_was_owner { - DecayingOwnerLock::::take(netuid).map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - false, - ) - }) + DecayingOwnerLock::::take(netuid) + .map(|lock| roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false)) } else { DecayingHotkeyLock::::take(netuid, old_hotkey).map(|lock| { - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - false, - ) + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, false) }) }; @@ -1663,27 +1652,13 @@ impl Pallet { if new_is_owner { Self::insert_owner_lock_state( netuid, - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - true, - ), + roll_lock_state(lock, now, unlock_rate, maturity_rate, true, true), ); } else { Self::insert_hotkey_lock_state( netuid, new_hotkey, - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - true, - ), + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, true), ); } } @@ -1691,27 +1666,13 @@ impl Pallet { if new_is_owner { Self::insert_decaying_owner_lock_state( netuid, - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - true, - false, - ), + roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false), ); } else { Self::insert_decaying_hotkey_lock_state( netuid, new_hotkey, - ConvictionModel::roll_forward_lock( - lock, - now, - unlock_rate, - maturity_rate, - false, - false, - ), + roll_lock_state(lock, now, unlock_rate, maturity_rate, false, false), ); } } @@ -1794,12 +1755,12 @@ impl Pallet { let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); model.roll_forward(now, unlock_rate, maturity_rate); - let mut lock = model.detach_individual(); + let mut lock = model.remove_individual_contribution(); if !Self::conviction_survives_hotkey_change(&origin_hotkey, destination_hotkey) { lock.conviction = U64F64::saturating_from_num(0); } - lock = ConvictionModel::roll_forward_lock( + lock = roll_lock_state( lock, now, unlock_rate, @@ -1819,9 +1780,8 @@ impl Pallet { unlock_rate, maturity_rate, move |destination_model| { - let existing = destination_model.detach_individual(); - let combined = existing.merge(&lock); - destination_model.attach_to_detached_individual(combined); + let combined = destination_model.individual_lock().add(&lock); + destination_model.replace_individual(combined); }, ); @@ -1966,7 +1926,7 @@ impl Pallet { } Self::ensure_can_receive_locked_alpha(destination_coldkey, locked_transfer)?; - source_lock = ConvictionModel::roll_forward_lock( + source_lock = roll_lock_state( source_lock, now, unlock_rate, @@ -1974,8 +1934,7 @@ impl Pallet { Self::is_subnet_owner_hotkey(netuid, &source_hotkey), Self::is_perpetual_lock(origin_coldkey, netuid), ); - source_model.detach_individual(); - source_model.attach_to_detached_individual(source_lock); + source_model.replace_individual(source_lock); if !locked_transfer.is_zero() || maybe_destination_hotkey.is_some() { let destination_owner_hotkey = destination_lock_hotkey.clone(); @@ -1990,13 +1949,13 @@ impl Pallet { unlock_rate, maturity_rate, move |destination_model| { - let mut destination_lock = destination_model.detach_individual(); + let mut destination_lock = destination_model.individual_lock().clone(); destination_lock.locked_mass = destination_lock.locked_mass.saturating_add(locked_transfer); destination_lock.conviction = destination_lock .conviction .saturating_add(received_conviction); - destination_lock = ConvictionModel::roll_forward_lock( + destination_lock = roll_lock_state( destination_lock, now, unlock_rate, @@ -2004,7 +1963,7 @@ impl Pallet { Self::is_subnet_owner_hotkey(netuid, &destination_owner_hotkey), Self::is_perpetual_lock(destination_coldkey, netuid), ); - destination_model.attach_to_detached_individual(destination_lock); + destination_model.replace_individual(destination_lock); }, ); } else { diff --git a/pallets/subtensor/src/subnets/leasing.rs b/pallets/subtensor/src/subnets/leasing.rs index e69e5a1110..38e816b726 100644 --- a/pallets/subtensor/src/subnets/leasing.rs +++ b/pallets/subtensor/src/subnets/leasing.rs @@ -207,7 +207,8 @@ impl Pallet { Error::::CannotUseSystemAccount ); let old_owner_hotkey = SubnetOwnerHotkey::::get(lease.netuid); - Self::transition_subnet_owner_lock_aggregates(lease.netuid, &old_owner_hotkey, &hotkey); + let transitioned_members = + Self::transition_subnet_owner_lock_aggregates(lease.netuid, &old_owner_hotkey, &hotkey); SubnetOwner::::insert(lease.netuid, lease.beneficiary.clone()); Self::set_subnet_owner_hotkey(lease.netuid, &hotkey)?; @@ -232,16 +233,14 @@ impl Pallet { // Lease shares exclude the beneficiary, while the benchmark's `k` includes them. let contributors_count = clear_result.unique.saturating_add(1); - if contributors_count < T::MaxContributors::get() { - // We have cleared less than the max number of shareholders, so we need to refund the difference - Ok(Some(::WeightInfo::terminate_lease( - contributors_count, + let actual_weight = ::WeightInfo::terminate_lease(contributors_count) + .saturating_add(::WeightInfo::transition_subnet_owner_locks( + transitioned_members, )) - .into()) - } else { - // We have cleared the max number of shareholders, so we don't need to refund anything - Ok(().into()) - } + .saturating_add(Self::lease_owner_transition_member_count_weight( + transitioned_members, + )); + Ok(Some(actual_weight).into()) } /// Hook used when the subnet owner's cut is distributed to split the amount into dividends diff --git a/pallets/subtensor/src/tests/leasing.rs b/pallets/subtensor/src/tests/leasing.rs index b27a05b32a..172ce86325 100644 --- a/pallets/subtensor/src/tests/leasing.rs +++ b/pallets/subtensor/src/tests/leasing.rs @@ -300,7 +300,11 @@ fn test_terminate_lease_works() { Some( <::WeightInfo as crate::weights::WeightInfo>::terminate_lease( contributors_count, - ), + ) + .saturating_add( + <::WeightInfo as crate::weights::WeightInfo>::transition_subnet_owner_locks(0), + ) + .saturating_add(SubtensorModule::lease_owner_transition_member_count_weight(0)), ) ); diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index af57b8101b..4f7bc8cb0a 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -16,7 +16,7 @@ use subtensor_runtime_common::{AlphaBalance, NetUidStorageIndex, TaoBalance}; use subtensor_swap_interface::SwapHandler; use super::mock::*; -use crate::staking::lock::{ConvictionModel, LockState}; +use crate::staking::lock::{ConvictionModel, LockState, roll_lock_state}; use crate::*; // --------------------------------------------------------------------------- @@ -71,7 +71,7 @@ fn roll_forward_lock( owner_lock: bool, perpetual_lock: bool, ) -> LockState { - ConvictionModel::roll_forward_lock( + roll_lock_state( lock, now, UnlockRate::::get(), @@ -1365,11 +1365,15 @@ fn test_locking_coldkeys_removed_when_lock_is_fully_reduced() { assert!(!LockingColdkeys::::contains_key(( netuid, hotkey, coldkey ))); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, hotkey)).count(), + 0 + ); }); } #[test] -fn test_lock_state_is_zero_uses_dust_threshold() { +fn test_lock_state_is_dust_uses_threshold() { let below_threshold = LockState { locked_mass: AlphaBalance::from(99u64), conviction: U64F64::from_num(99), @@ -1386,9 +1390,9 @@ fn test_lock_state_is_zero_uses_dust_threshold() { last_update: 0, }; - assert!(below_threshold.is_zero()); - assert!(!locked_mass_at_threshold.is_zero()); - assert!(!conviction_at_threshold.is_zero()); + assert!(below_threshold.is_dust()); + assert!(!locked_mass_at_threshold.is_dust()); + assert!(!conviction_at_threshold.is_dust()); } // ========================================================================= @@ -1481,7 +1485,7 @@ fn test_lock_stake_topup_exceeds_total() { #[test] fn test_exp_decay_zero_dt() { new_test_ext(1).execute_with(|| { - let result = ConvictionModel::exp_decay(0, 216000); + let result = LockState::exp_decay(0, 216000); assert_eq!(result, U64F64::from_num(1)); }); } @@ -1489,7 +1493,7 @@ fn test_exp_decay_zero_dt() { #[test] fn test_exp_decay_zero_tau() { new_test_ext(1).execute_with(|| { - let result = ConvictionModel::exp_decay(1000, 0); + let result = LockState::exp_decay(1000, 0); assert_eq!(result, U64F64::from_num(0)); }); } @@ -1498,7 +1502,7 @@ fn test_exp_decay_zero_tau() { fn test_exp_decay_one_tau() { new_test_ext(1).execute_with(|| { let tau = 216000u64; - let result = ConvictionModel::exp_decay(tau, tau); + let result = LockState::exp_decay(tau, tau); // exp(-1) ~= 0.36787944 let expected = U64F64::from_num(0.36787944f64); let diff = if result > expected { @@ -1514,8 +1518,8 @@ fn test_exp_decay_one_tau() { fn test_exp_decay_clamps_large_dt_to_min_ratio() { new_test_ext(1).execute_with(|| { let tau = 216000u64; - let clamped_result = ConvictionModel::exp_decay(40 * tau, tau); - let oversized_result = ConvictionModel::exp_decay(100 * tau, tau); + let clamped_result = LockState::exp_decay(40 * tau, tau); + let oversized_result = LockState::exp_decay(100 * tau, tau); let diff = if oversized_result > clamped_result { oversized_result - clamped_result @@ -1546,7 +1550,7 @@ fn test_roll_forward_individual_lock_uses_lock_owner_and_decay_mode() { let rolled = roll_forward_individual_lock(&coldkey, netuid, &owner_hotkey, lock.clone(), now); - let expected = ConvictionModel::roll_forward_lock( + let expected = roll_lock_state( lock, now, UnlockRate::::get(), @@ -1568,20 +1572,7 @@ fn test_rolled_individual_is_a_pure_view() { last_update: 0, }; let aggregate = individual.clone(); - let empty = LockState { - locked_mass: AlphaBalance::ZERO, - conviction: U64F64::from_num(0), - last_update: 0, - }; - let model = ConvictionModel::new( - false, - true, - individual.clone(), - aggregate.clone(), - empty.clone(), - empty.clone(), - empty, - ); + let model = ConvictionModel::new(false, true, individual.clone(), aggregate.clone()); let rolled = model.rolled_individual( 1_000, @@ -1591,12 +1582,7 @@ fn test_rolled_individual_is_a_pure_view() { assert!(rolled.conviction > individual.conviction); assert_eq!(model.individual_lock(), &individual); - assert_eq!(model.agg_perpetual_general(), &aggregate); - assert!(!model.individual_lock_dirty()); - assert!(!model.agg_perpetual_general_dirty()); - assert!(!model.agg_decaying_general_dirty()); - assert!(!model.agg_perpetual_owner_dirty()); - assert!(!model.agg_decaying_owner_dirty()); + assert_eq!(model.aggregate_lock(), &aggregate); }); } @@ -1611,7 +1597,7 @@ fn test_roll_forward_hotkey_lock_uses_perpetual_general_mode() { let now = 1_000u64; let rolled = roll_forward_hotkey_lock(lock.clone(), now); - let expected = ConvictionModel::roll_forward_lock( + let expected = roll_lock_state( lock, now, UnlockRate::::get(), @@ -1635,7 +1621,7 @@ fn test_roll_forward_decaying_hotkey_lock_uses_decaying_general_mode() { let now = 1_000u64; let rolled = roll_forward_decaying_hotkey_lock(lock.clone(), now); - let expected = ConvictionModel::roll_forward_lock( + let expected = roll_lock_state( lock, now, UnlockRate::::get(), @@ -1682,8 +1668,8 @@ fn test_roll_forward_conviction_uses_unequal_rate_closed_form() { }; let rolled = roll_forward_lock(lock, dt, false, false); - let unlock_decay = ConvictionModel::exp_decay(dt, unlock_rate); - let maturity_decay = ConvictionModel::exp_decay(dt, maturity_rate); + let unlock_decay = LockState::exp_decay(dt, unlock_rate); + let maturity_decay = LockState::exp_decay(dt, maturity_rate); let gamma = U64F64::from_num(unlock_rate) .saturating_mul(maturity_decay.saturating_sub(unlock_decay)) .safe_div(U64F64::from_num(maturity_rate.saturating_sub(unlock_rate))); @@ -2242,8 +2228,16 @@ fn test_unstake_roll_forward_collects_decaying_sibling_dust_from_hotkey_aggregat }, now, ); + let rolled_aggregate = roll_forward_decaying_hotkey_lock( + LockState { + locked_mass: (ONE_ALPHA + DUST_ALPHA).into(), + conviction: U64F64::from_num(0), + last_update: lock_block, + }, + now, + ); let rolled_sibling_dust_mass: AlphaBalance = - ConvictionModel::exp_decay(now.saturating_sub(lock_block), UnlockRate::::get()) + LockState::exp_decay(now.saturating_sub(lock_block), UnlockRate::::get()) .saturating_mul(U64F64::from_num(DUST_ALPHA)) .to_num::() .into(); @@ -2262,9 +2256,7 @@ fn test_unstake_roll_forward_collects_decaying_sibling_dust_from_hotkey_aggregat DecayingHotkeyLock::::get(netuid, hotkey_2) .expect("decaying aggregate should remain") .locked_mass, - rolled_large_lock - .locked_mass - .saturating_add(rolled_sibling_dust_mass) + rolled_aggregate.locked_mass ); assert_ok!(SubtensorModule::do_remove_stake( @@ -2277,7 +2269,9 @@ fn test_unstake_roll_forward_collects_decaying_sibling_dust_from_hotkey_aggregat DecayingHotkeyLock::::get(netuid, hotkey_2) .expect("decaying aggregate should remain") .locked_mass, - rolled_large_lock.locked_mass + rolled_aggregate + .locked_mass + .saturating_sub(rolled_sibling_dust_mass) ); }); } @@ -3507,14 +3501,32 @@ fn test_run_coinbase_reassigns_subnet_owner_by_conviction_on_epoch() { assert_eq!(SubnetOwner::::get(netuid), old_owner_coldkey); assert_eq!(SubnetOwnerHotkey::::get(netuid), old_owner_hotkey); - SubtensorModule::run_coinbase(SubtensorModule::mint_tao(0.into())); + let owner_transition_weight = + SubtensorModule::run_coinbase(SubtensorModule::mint_tao(0.into())); assert_eq!(SubnetOwner::::get(netuid), new_owner_coldkey); assert_eq!(SubnetOwnerHotkey::::get(netuid), king_hotkey); assert_eq!(LastEpochBlock::::get(netuid), now); + assert_eq!( + owner_transition_weight, + <::WeightInfo as crate::weights::WeightInfo>::transition_subnet_owner_locks(1), + ); }); } +#[test] +fn test_owner_transition_count_lookup_weight_scales_with_members() { + let member_count = 7; + assert_eq!( + SubtensorModule::owner_transition_member_count_weight(member_count), + ::DbWeight::get().reads(u64::from(member_count) + 3), + ); + assert_eq!( + SubtensorModule::lease_owner_transition_member_count_weight(member_count), + ::DbWeight::get().reads(u64::from(member_count) + 4), + ); +} + #[test] fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { new_test_ext(1).execute_with(|| { @@ -3689,6 +3701,53 @@ fn test_owner_demotion_then_member_update_does_not_leave_ghost_conviction() { }); } +#[test] +fn test_decaying_owner_is_rolled_as_owner_before_demotion() { + new_test_ext(1_000).execute_with(|| { + let netuid = NetUid::from(1); + let old_owner_hotkey = U256::from(1); + let new_owner_hotkey = U256::from(2); + let coldkey = U256::from(10); + let now = SubtensorModule::get_current_block_as_u64(); + let unlock_rate = 200; + let maturity_rate = 300; + let lock = LockState { + locked_mass: 100_000u64.into(), + conviction: U64F64::from_num(100_000), + last_update: now.saturating_sub(100), + }; + + UnlockRate::::put(unlock_rate); + MaturityRate::::put(maturity_rate); + SubnetOwnerHotkey::::insert(netuid, old_owner_hotkey); + SubtensorModule::insert_lock_state(&coldkey, netuid, &old_owner_hotkey, lock.clone()); + DecayingOwnerLock::::insert(netuid, lock.clone()); + + let expected = roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false); + + let transitioned = SubtensorModule::transition_subnet_owner_lock_aggregates( + netuid, + &old_owner_hotkey, + &new_owner_hotkey, + ); + + assert_eq!(transitioned, 1); + assert_eq!( + Lock::::get((coldkey, netuid, old_owner_hotkey)), + Some(expected.clone()) + ); + assert_eq!( + DecayingHotkeyLock::::get(netuid, old_owner_hotkey), + Some(expected.clone()) + ); + assert_eq!( + expected.conviction, + U64F64::from_num(expected.locked_mass), + "the outgoing row must retain full owner conviction at the transition block" + ); + }); +} + #[test] fn test_swap_hotkey_locks_moves_owner_hotkey_aggregate_to_owner_lock() { new_test_ext(1).execute_with(|| { @@ -3744,6 +3803,10 @@ fn test_swap_hotkey_locks_moves_owner_hotkey_aggregate_to_owner_lock() { new_owner_hotkey, locking_coldkey ))); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, new_owner_hotkey)).count(), + 1 + ); }); } @@ -4408,6 +4471,10 @@ fn test_hotkey_swap_swaps_locks_and_convictions() { assert!(LockingColdkeys::::contains_key(( netuid, new_hotkey, coldkey ))); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, new_hotkey)).count(), + 1 + ); // Hotkey lock data also updated, conviction is not reset let hotkey_lock = HotkeyLock::::get(netuid, new_hotkey).unwrap(); diff --git a/pallets/subtensor/src/tests/migration.rs b/pallets/subtensor/src/tests/migration.rs index 3b188f912a..8989fd0873 100644 --- a/pallets/subtensor/src/tests/migration.rs +++ b/pallets/subtensor/src/tests/migration.rs @@ -7,7 +7,7 @@ )] use super::mock::*; -use crate::staking::lock::{ConvictionModel, LockState}; +use crate::staking::lock::{ConvictionModel, LockState, roll_lock_state}; use crate::*; use alloc::collections::BTreeMap; use approx::{assert_abs_diff_eq, assert_relative_eq}; @@ -425,6 +425,10 @@ fn test_runtime_upgrade_fixes_hotkey_swaps_before_rebuilding_aggregates() { new_owner_hotkey, coldkey ))); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, new_owner_hotkey)).count(), + 1 + ); assert!(HotkeyLock::::get(netuid, old_hotkey).is_none()); assert_eq!(OwnerLock::::get(netuid), Some(lock)); }); @@ -1818,7 +1822,7 @@ fn test_migrate_rebuild_conviction_aggregates_from_individual_locks() { ( *coldkey, *hotkey, - ConvictionModel::roll_forward_lock( + roll_lock_state( lock.clone(), now, unlock_rate, @@ -1837,6 +1841,18 @@ fn test_migrate_rebuild_conviction_aggregates_from_individual_locks() { assert!(HasMigrationRun::::get(MIGRATION_NAME)); assert_eq!(Lock::::iter().count(), seeded_locks.len()); assert_eq!(LockingColdkeys::::iter().count(), seeded_locks.len()); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, former_owner)).count(), + 1 + ); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, current_owner)).count(), + 2 + ); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, general_hotkey)).count(), + 3 + ); for (coldkey, hotkey, expected_lock) in &expected { assert_eq!( diff --git a/pallets/subtensor/src/tests/networks.rs b/pallets/subtensor/src/tests/networks.rs index 2aafcaf9fc..3add871656 100644 --- a/pallets/subtensor/src/tests/networks.rs +++ b/pallets/subtensor/src/tests/networks.rs @@ -1122,9 +1122,9 @@ fn destroy_alpha_in_out_stakes_cleans_locking_coldkeys() { }; Lock::::insert((coldkey, netuid, hotkey), lock.clone()); - LockingColdkeys::::insert((netuid, hotkey, coldkey), ()); + SubtensorModule::add_locking_coldkey(&hotkey, netuid, &coldkey); Lock::::insert((coldkey, other_netuid, hotkey), lock); - LockingColdkeys::::insert((other_netuid, hotkey, coldkey), ()); + SubtensorModule::add_locking_coldkey(&hotkey, other_netuid, &coldkey); DissolveCleanupQueue::::set(vec![netuid]); run_block_idle(); @@ -1133,12 +1133,20 @@ fn destroy_alpha_in_out_stakes_cleans_locking_coldkeys() { assert!(!LockingColdkeys::::contains_key(( netuid, hotkey, coldkey ))); + assert_eq!( + LockingColdkeys::::iter_prefix((netuid, hotkey)).count(), + 0 + ); assert!(Lock::::contains_key((coldkey, other_netuid, hotkey))); assert!(LockingColdkeys::::contains_key(( other_netuid, hotkey, coldkey ))); + assert_eq!( + LockingColdkeys::::iter_prefix((other_netuid, hotkey)).count(), + 1 + ); }); } @@ -2700,13 +2708,13 @@ fn dissolve_clears_all_lock_maps_for_removed_network() { // --- Lock: (coldkey, netuid, hotkey) Lock::::insert((cold_1, net, hot_1), lock_a.clone()); - LockingColdkeys::::insert((net, hot_1, cold_1), ()); + SubtensorModule::add_locking_coldkey(&hot_1, net, &cold_1); Lock::::insert((cold_2, net, hot_2), lock_b.clone()); - LockingColdkeys::::insert((net, hot_2, cold_2), ()); + SubtensorModule::add_locking_coldkey(&hot_2, net, &cold_2); // Same cold/hot on another net should survive. Lock::::insert((cold_1, other_net, hot_1), lock_a.clone()); - LockingColdkeys::::insert((other_net, hot_1, cold_1), ()); + SubtensorModule::add_locking_coldkey(&hot_1, other_net, &cold_1); // --- HotkeyLock HotkeyLock::::insert(net, hot_1, lock_a.clone()); @@ -2763,6 +2771,11 @@ fn dissolve_clears_all_lock_maps_for_removed_network() { assert!(!Lock::::contains_key((cold_2, net, hot_2))); assert!(!LockingColdkeys::::contains_key((net, hot_1, cold_1))); assert!(!LockingColdkeys::::contains_key((net, hot_2, cold_2))); + assert!( + LockingColdkeys::::iter_prefix((net,)) + .next() + .is_none() + ); assert!(!HotkeyLock::::contains_key(net, hot_1)); assert!(!HotkeyLock::::contains_key(net, hot_2)); @@ -2786,6 +2799,10 @@ fn dissolve_clears_all_lock_maps_for_removed_network() { assert!(LockingColdkeys::::contains_key(( other_net, hot_1, cold_1 ))); + assert_eq!( + LockingColdkeys::::iter_prefix((other_net, hot_1)).count(), + 1 + ); assert!(HotkeyLock::::contains_key(other_net, hot_1)); assert!(DecayingHotkeyLock::::contains_key(other_net, hot_1)); assert!(OwnerLock::::contains_key(other_net)); diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index a8ccbb9996..01a4b916e2 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2,16 +2,16 @@ //! Autogenerated weights for `pallet_subtensor` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `moncks-MacBook-Pro-5.local`, CPU: `` +//! HOSTNAME: `Grigoris-MBP.lan`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// /Users/const/everything/subtensor/target/production/node-subtensor +// /Users/grigorizaitsev/development/subtensor/target/production/node-subtensor // benchmark // pallet -// --runtime=/Users/const/everything/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm +// --runtime=/Users/grigorizaitsev/development/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm // --genesis-builder=runtime // --genesis-builder-preset=benchmark // --wasm-execution=compiled @@ -22,8 +22,8 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/Users/const/everything/subtensor/pallets/subtensor/src/weights.rs -// --template=/Users/const/everything/subtensor/.maintain/frame-weight-template.hbs +// --output=/Users/grigorizaitsev/development/subtensor/pallets/subtensor/src/weights.rs +// --template=/Users/grigorizaitsev/development/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -84,13 +84,12 @@ pub trait WeightInfo { fn remove_stake_full_limit() -> Weight; fn register_leased_network(k: u32, ) -> Weight; fn terminate_lease(k: u32, ) -> Weight; + fn transition_subnet_owner_locks(l: u32, ) -> Weight; fn update_symbol() -> Weight; fn commit_timelocked_weights() -> Weight; fn set_coldkey_auto_stake_hotkey() -> Weight; - fn set_root_claim_type() -> Weight; fn claim_root(h: u32, ) -> Weight; fn claim_root_scan(h: u32, ) -> Weight; - fn sudo_set_num_root_claims() -> Weight; fn sudo_set_root_claim_threshold() -> Weight; fn set_auto_parent_delegation_enabled() -> Weight; fn add_stake_burn() -> Weight; @@ -228,6 +227,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:0 w:1) @@ -236,10 +237,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `289875` // Estimated: `926940` - // Minimum execution time: 2_761_000_000 picoseconds. - Weight::from_parts(364_683_000, 6148) - .saturating_add(T::DbWeight::get().reads(34_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Minimum execution time: 2_950_000_000 picoseconds. + Weight::from_parts(3_170_000_000, 926940) + .saturating_add(T::DbWeight::get().reads(814_u64)) + .saturating_add(T::DbWeight::get().writes(294_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) /// Proof: `SubtensorModule::CommitRevealWeightsEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -279,8 +280,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `188820` // Estimated: `10327410` - // Minimum execution time: 7_637_000_000 picoseconds. - Weight::from_parts(8_632_000_000, 10327410) + // Minimum execution time: 7_042_000_000 picoseconds. + Weight::from_parts(7_349_000_000, 10327410) .saturating_add(T::DbWeight::get().reads(4112_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -292,12 +293,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:3 w:3) @@ -342,18 +343,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2304` + // Measured: `2319` // Estimated: `8727` - // Minimum execution time: 301_000_000 picoseconds. - Weight::from_parts(310_000_000, 8727) - .saturating_add(T::DbWeight::get().reads(32_u64)) - .saturating_add(T::DbWeight::get().writes(16_u64)) + // Minimum execution time: 261_000_000 picoseconds. + Weight::from_parts(273_000_000, 8727) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(14_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -367,8 +366,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4293) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4293) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -384,8 +383,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4392` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4392) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(22_000_000, 4392) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -435,10 +434,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapBalancer` (r:1 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -461,6 +462,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -505,20 +508,18 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) - /// Storage: `Swap::SwapBalancer` (r:0 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn burned_register() -> Weight { // Proof Size summary in bytes: // Measured: `289277` // Estimated: `926342` - // Minimum execution time: 2_807_000_000 picoseconds. - Weight::from_parts(365_124_000, 6148) - .saturating_add(T::DbWeight::get().reads(34_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Minimum execution time: 2_979_000_000 picoseconds. + Weight::from_parts(3_072_000_000, 926342) + .saturating_add(T::DbWeight::get().reads(825_u64)) + .saturating_add(T::DbWeight::get().writes(299_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -530,13 +531,13 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::RegistrationsThisInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TargetRegistrationsPerInterval` (r:1 w:0) /// Proof: `SubtensorModule::TargetRegistrationsPerInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:1 w:2) + /// Storage: `SubtensorModule::Uids` (r:2 w:2) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetworkN` (r:1 w:0) /// Proof: `SubtensorModule::SubnetworkN` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -544,10 +545,30 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:65 w:1) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:65 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:64 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Burn` (r:1 w:1) + /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) + /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:1 w:1) + /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BurnIncreaseMult` (r:1 w:0) + /// Proof: `SubtensorModule::BurnIncreaseMult` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinBurn` (r:1 w:0) + /// Proof: `SubtensorModule::MinBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MaxBurn` (r:1 w:0) + /// Proof: `SubtensorModule::MaxBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AssociatedEvmAddress` (r:1 w:0) /// Proof: `SubtensorModule::AssociatedEvmAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:1 w:1) @@ -584,16 +605,18 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_register() -> Weight { // Proof Size summary in bytes: - // Measured: `29210` - // Estimated: `191075` - // Minimum execution time: 566_000_000 picoseconds. - Weight::from_parts(621_000_000, 191075) - .saturating_add(T::DbWeight::get().reads(219_u64)) - .saturating_add(T::DbWeight::get().writes(88_u64)) + // Measured: `46222` + // Estimated: `208087` + // Minimum execution time: 633_000_000 picoseconds. + Weight::from_parts(672_000_000, 208087) + .saturating_add(T::DbWeight::get().reads(229_u64)) + .saturating_add(T::DbWeight::get().writes(94_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -705,6 +728,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -713,10 +738,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1532` // Estimated: `9947` - // Minimum execution time: 145_000_000 picoseconds. - Weight::from_parts(153_000_000, 9947) - .saturating_add(T::DbWeight::get().reads(42_u64)) - .saturating_add(T::DbWeight::get().writes(48_u64)) + // Minimum execution time: 168_000_000 picoseconds. + Weight::from_parts(186_000_000, 9947) + .saturating_add(T::DbWeight::get().reads(41_u64)) + .saturating_add(T::DbWeight::get().writes(49_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -748,8 +773,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1249` // Estimated: `4714` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 4714) + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(42_000_000, 4714) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -795,8 +820,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(58_000_000, 7590) + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(71_000_000, 7590) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -806,8 +831,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -830,8 +855,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1033` // Estimated: `4498` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 4498) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(34_000_000, 4498) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -847,13 +872,17 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4159) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(30_000_000, 4159) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -878,8 +907,18 @@ 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::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -892,21 +931,27 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) + /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey_announced() -> Weight { - // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral - // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `2110` - // Estimated: `100000` - // Minimum execution time: 450_000_000 picoseconds. - Weight::from_parts(450_000_000, 100000) - .saturating_add(T::DbWeight::get().reads(250_u64)) - .saturating_add(T::DbWeight::get().writes(200_u64)) + // Measured: `8414` + // Estimated: `167804` + // Minimum execution time: 883_000_000 picoseconds. + Weight::from_parts(921_000_000, 167804) + .saturating_add(T::DbWeight::get().reads(114_u64)) + .saturating_add(T::DbWeight::get().writes(87_u64)) } /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -931,8 +976,18 @@ 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::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -943,20 +998,22 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::DecayingLock` (r:1 w:0) /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapDisputes` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapDisputes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) + /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey() -> Weight { - // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral - // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `2166` - // Estimated: `100000` - // Minimum execution time: 480_000_000 picoseconds. - Weight::from_parts(480_000_000, 100000) - .saturating_add(T::DbWeight::get().reads(250_u64)) - .saturating_add(T::DbWeight::get().writes(210_u64)) + // Measured: `8417` + // Estimated: `167807` + // Minimum execution time: 911_000_000 picoseconds. + Weight::from_parts(951_000_000, 167807) + .saturating_add(T::DbWeight::get().reads(114_u64)) + .saturating_add(T::DbWeight::get().writes(91_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -966,8 +1023,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 4130) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 4130) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -979,8 +1036,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 4078) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4078) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -992,8 +1049,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(5_000_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -1038,8 +1095,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2155` // Estimated: `8095` - // Minimum execution time: 209_000_000 picoseconds. - Weight::from_parts(218_000_000, 8095) + // Minimum execution time: 233_000_000 picoseconds. + Weight::from_parts(247_000_000, 8095) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1077,8 +1134,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 94_000_000 picoseconds. - Weight::from_parts(98_000_000, 5219) + // Minimum execution time: 106_000_000 picoseconds. + Weight::from_parts(110_000_000, 5219) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -1114,13 +1171,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 92_000_000 picoseconds. - Weight::from_parts(102_000_000, 5219) + // Minimum execution time: 104_000_000 picoseconds. + Weight::from_parts(109_000_000, 5219) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: `System::ParentHash` (r:1 w:0) - /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:130 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:129 w:129) @@ -1165,6 +1220,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerBurned` (r:128 w:2) /// Proof: `SubtensorModule::MinerBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::EmissionGateBar` (r:1 w:1) + /// Proof: `SubtensorModule::EmissionGateBar` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::EmissionBarRank` (r:1 w:0) + /// Proof: `SubtensorModule::EmissionBarRank` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::EmissionGateExponent` (r:1 w:0) + /// Proof: `SubtensorModule::EmissionGateExponent` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetEmissionEnabled` (r:128 w:0) /// Proof: `SubtensorModule::SubnetEmissionEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:128 w:127) @@ -1215,7 +1276,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastUpdate` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::BlockAtRegistration` (r:512 w:0) /// Proof: `SubtensorModule::BlockAtRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:512) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ParentKeys` (r:512 w:0) /// Proof: `SubtensorModule::ParentKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1261,42 +1322,36 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MinChildkeyTakePerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:512 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:512 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:2 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:0) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:512 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:513 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:542 w:512) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:512 w:512) - /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:512 w:512) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootAlphaDividendsPerSubnet` (r:512 w:512) - /// Proof: `SubtensorModule::RootAlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:2 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketFlushCursor` (r:1 w:1) + /// Proof: `SubtensorModule::PendingBasketFlushCursor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:128 w:0) /// Proof: `SubtensorModule::EMAPriceHalvingBlocks` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:1 w:0) /// Proof: `SubtensorModule::SubnetMovingAlpha` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::PendingChildKeys` (r:129 w:0) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:0) - /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NumRootClaim` (r:1 w:0) - /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:1 w:0) - /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaMapLastKey` (r:1 w:0) /// Proof: `SubtensorModule::AlphaMapLastKey` (`max_values`: Some(1), `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::AlphaV2MapLastKey` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2MapLastKey` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:31 w:0) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootProp` (r:0 w:128) /// Proof: `SubtensorModule::RootProp` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:0 w:2) @@ -1327,12 +1382,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoInEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) fn block_step() -> Weight { // Proof Size summary in bytes: - // Measured: `35625441` - // Estimated: `38160831` - // Minimum execution time: 74_108_000_000 picoseconds. - Weight::from_parts(80_064_000_000, 38160831) - .saturating_add(T::DbWeight::get().reads(13414_u64)) - .saturating_add(T::DbWeight::get().writes(7064_u64)) + // Measured: `35120583` + // Estimated: `37655973` + // Minimum execution time: 49_851_000_000 picoseconds. + Weight::from_parts(53_672_000_000, 37655973) + .saturating_add(T::DbWeight::get().reads(10347_u64)) + .saturating_add(T::DbWeight::get().writes(3994_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1350,8 +1405,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 4583) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(27_000_000, 4583) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1359,12 +1414,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -1413,18 +1468,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2304` + // Measured: `2319` // Estimated: `8727` - // Minimum execution time: 382_000_000 picoseconds. - Weight::from_parts(395_000_000, 8727) - .saturating_add(T::DbWeight::get().reads(32_u64)) - .saturating_add(T::DbWeight::get().writes(16_u64)) + // Minimum execution time: 348_000_000 picoseconds. + Weight::from_parts(365_000_000, 8727) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(14_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1454,16 +1507,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `1979` - // Estimated: `7919` - // Minimum execution time: 106_000_000 picoseconds. - Weight::from_parts(110_000_000, 7919) + // Measured: `1978` + // Estimated: `7918` + // Minimum execution time: 123_000_000 picoseconds. + Weight::from_parts(130_000_000, 7918) .saturating_add(T::DbWeight::get().reads(20_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1483,12 +1534,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetAlphaIn` (`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::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -1515,27 +1566,25 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2142` - // Estimated: `10557` - // Minimum execution time: 292_000_000 picoseconds. - Weight::from_parts(299_000_000, 10557) + // Measured: `2028` + // Estimated: `10443` + // Minimum execution time: 276_000_000 picoseconds. + Weight::from_parts(291_000_000, 10443) .saturating_add(T::DbWeight::get().reads(30_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) + .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -1574,27 +1623,25 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2176` - // Estimated: `10591` - // Minimum execution time: 374_000_000 picoseconds. - Weight::from_parts(387_000_000, 10591) + // Measured: `2062` + // Estimated: `10477` + // Minimum execution time: 351_000_000 picoseconds. + Weight::from_parts(362_000_000, 10477) .saturating_add(T::DbWeight::get().reads(29_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) + .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) @@ -1649,18 +1696,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2662` - // Estimated: `11077` - // Minimum execution time: 457_000_000 picoseconds. - Weight::from_parts(484_000_000, 11077) - .saturating_add(T::DbWeight::get().reads(49_u64)) - .saturating_add(T::DbWeight::get().writes(24_u64)) + // Measured: `2663` + // Estimated: `11078` + // Minimum execution time: 464_000_000 picoseconds. + Weight::from_parts(483_000_000, 11078) + .saturating_add(T::DbWeight::get().reads(50_u64)) + .saturating_add(T::DbWeight::get().writes(22_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1698,16 +1743,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `2023` - // Estimated: `7963` - // Minimum execution time: 134_000_000 picoseconds. - Weight::from_parts(142_000_000, 7963) + // Measured: `1909` + // Estimated: `7849` + // Minimum execution time: 153_000_000 picoseconds. + Weight::from_parts(163_000_000, 7849) .saturating_add(T::DbWeight::get().reads(21_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1743,16 +1786,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_stake_and_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `2162` - // Estimated: `8102` - // Minimum execution time: 141_000_000 picoseconds. - Weight::from_parts(146_000_000, 8102) + // Measured: `2048` + // Estimated: `7988` + // Minimum execution time: 151_000_000 picoseconds. + Weight::from_parts(158_000_000, 7988) .saturating_add(T::DbWeight::get().reads(24_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1760,10 +1801,6 @@ impl WeightInfo for SubstrateWeight { /// 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::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMovingPrice` (`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) @@ -1776,14 +1813,18 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -1818,18 +1859,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `2602` - // Estimated: `8542` - // Minimum execution time: 351_000_000 picoseconds. - Weight::from_parts(371_000_000, 8542) - .saturating_add(T::DbWeight::get().reads(34_u64)) - .saturating_add(T::DbWeight::get().writes(17_u64)) + // Measured: `2650` + // Estimated: `8590` + // Minimum execution time: 421_000_000 picoseconds. + Weight::from_parts(433_000_000, 8590) + .saturating_add(T::DbWeight::get().reads(35_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1837,16 +1876,18 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_min_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `1015` - // Estimated: `4480` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 4480) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `1037` + // Estimated: `4502` + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 4502) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1866,14 +1907,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -1912,18 +1953,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2505` - // Estimated: `10920` - // Minimum execution time: 371_000_000 picoseconds. - Weight::from_parts(388_000_000, 10920) - .saturating_add(T::DbWeight::get().reads(49_u64)) - .saturating_add(T::DbWeight::get().writes(24_u64)) + // Measured: `2506` + // Estimated: `10921` + // Minimum execution time: 359_000_000 picoseconds. + Weight::from_parts(378_000_000, 10921) + .saturating_add(T::DbWeight::get().reads(50_u64)) + .saturating_add(T::DbWeight::get().writes(22_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1959,8 +1998,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1300` // Estimated: `4765` - // Minimum execution time: 77_000_000 picoseconds. - Weight::from_parts(79_000_000, 4765) + // Minimum execution time: 87_000_000 picoseconds. + Weight::from_parts(94_000_000, 4765) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2000,8 +2039,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1455` // Estimated: `7395` - // Minimum execution time: 51_000_000 picoseconds. - Weight::from_parts(54_000_000, 7395) + // Minimum execution time: 59_000_000 picoseconds. + Weight::from_parts(62_000_000, 7395) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2017,8 +2056,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `830` // Estimated: `4295` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4295) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4295) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2036,8 +2075,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `923` // Estimated: `4388` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 4388) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4388) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2151,6 +2190,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -2159,10 +2200,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1468` // Estimated: `9883` - // Minimum execution time: 143_000_000 picoseconds. - Weight::from_parts(148_000_000, 9883) - .saturating_add(T::DbWeight::get().reads(41_u64)) - .saturating_add(T::DbWeight::get().writes(47_u64)) + // Minimum execution time: 168_000_000 picoseconds. + Weight::from_parts(180_000_000, 9883) + .saturating_add(T::DbWeight::get().reads(40_u64)) + .saturating_add(T::DbWeight::get().writes(48_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2176,8 +2217,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4264) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4264) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2191,8 +2232,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `889` // Estimated: `6829` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 6829) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(20_000_000, 6829) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2206,29 +2247,37 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 4203) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 4203) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:18 w:34) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) + /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:33 w:32) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:2547 w:0) + /// Storage: `SubtensorModule::Alpha` (r:2548 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2547 w:2546) + /// Storage: `SubtensorModule::AlphaV2` (r:2548 w:2546) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:34 w:34) @@ -2259,6 +2308,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:17 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:16 w:32) @@ -2283,16 +2340,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyRoot` (r:16 w:16) + /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:16) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:32) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `219071` - // Estimated: `6523886` - // Minimum execution time: 83_390_000_000 picoseconds. - Weight::from_parts(87_695_000_000, 6523886) - .saturating_add(T::DbWeight::get().reads(6928_u64)) - .saturating_add(T::DbWeight::get().writes(4111_u64)) + // Measured: `219260` + // Estimated: `6526550` + // Minimum execution time: 88_389_000_000 picoseconds. + Weight::from_parts(93_978_000_000, 6526550) + .saturating_add(T::DbWeight::get().reads(6955_u64)) + .saturating_add(T::DbWeight::get().writes(4157_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2304,8 +2365,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `818` // Estimated: `4283` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 4283) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 4283) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -2319,10 +2380,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `774` // Estimated: `9189` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 9189) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 9189) .saturating_add(T::DbWeight::get().reads(6_u64)) } + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`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::NetworksAdded` (r:3 w:0) @@ -2341,14 +2406,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -2371,8 +2436,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `AlphaAssets::AlphaBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:1 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:1 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) @@ -2383,11 +2454,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unstake_all_alpha() -> Weight { // Proof Size summary in bytes: - // Measured: `2235` + // Measured: `2446` // Estimated: `11306` - // Minimum execution time: 380_000_000 picoseconds. + // Minimum execution time: 370_000_000 picoseconds. Weight::from_parts(384_000_000, 11306) - .saturating_add(T::DbWeight::get().reads(45_u64)) + .saturating_add(T::DbWeight::get().reads(50_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -2406,12 +2477,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2438,16 +2509,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2176` - // Estimated: `10591` - // Minimum execution time: 388_000_000 picoseconds. - Weight::from_parts(415_000_000, 10591) + // Measured: `2062` + // Estimated: `10477` + // Minimum execution time: 366_000_000 picoseconds. + Weight::from_parts(380_000_000, 10477) .saturating_add(T::DbWeight::get().reads(29_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) + .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:0) /// Proof: `Crowdloan::CurrentCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -2577,6 +2646,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -2586,13 +2657,13 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1835 + k * (44 ±0)` // Estimated: `10256 + k * (2579 ±0)` - // Minimum execution time: 259_000_000 picoseconds. - Weight::from_parts(171_942_062, 10256) - // Standard Error: 74_270 - .saturating_add(Weight::from_parts(29_141_808, 0).saturating_mul(k.into())) + // Minimum execution time: 306_000_000 picoseconds. + Weight::from_parts(199_755_086, 10256) + // Standard Error: 64_460 + .saturating_add(Weight::from_parts(32_306_685, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(50_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(53_u64)) + .saturating_add(T::DbWeight::get().writes(54_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) } @@ -2606,14 +2677,8 @@ 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::OwnerLock` (r:1 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LockingColdkeys` (r:2 w:0) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetLeaseShares` (r:499 w:499) @@ -2626,23 +2691,64 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AccumulatedLeaseDividends` (r:0 w:1) /// Proof: `SubtensorModule::AccumulatedLeaseDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[2, 500]`. fn terminate_lease(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2111 + k * (53 ±0)` - // Estimated: `8054 + k * (2529 ±0)` - // Minimum execution time: 87_000_000 picoseconds. - Weight::from_parts(93_461_390, 8054) - // Standard Error: 4_516 - .saturating_add(Weight::from_parts(1_356_955, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(13_u64)) + // Measured: `1836 + k * (53 ±0)` + // Estimated: `7778 + k * (2529 ±0)` + // Minimum execution time: 88_000_000 picoseconds. + Weight::from_parts(98_396_469, 7778) + // Standard Error: 6_969 + .saturating_add(Weight::from_parts(1_324_962, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(14_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) } + /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) + /// 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::LockingColdkeys` (r:130 w:128) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Lock` (r:128 w:128) + /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingLock` (r:128 w:0) + /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `l` is `[1, 128]`. + fn transition_subnet_owner_locks(l: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1018 + l * (190 ±0)` + // Estimated: `6952 + l * (2665 ±0)` + // Minimum execution time: 59_000_000 picoseconds. + Weight::from_parts(41_965_196, 6952) + // Standard Error: 77_595 + .saturating_add(Weight::from_parts(29_329_722, 0).saturating_mul(l.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(l.into()))) + .saturating_add(T::DbWeight::get().writes(8_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(l.into()))) + .saturating_add(Weight::from_parts(0, 2665).saturating_mul(l.into())) + } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -2653,8 +2759,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `762` // Estimated: `9177` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 9177) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 9177) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2690,7 +2796,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1248` // Estimated: `4713` - // Minimum execution time: 46_000_000 picoseconds. + // Minimum execution time: 49_000_000 picoseconds. Weight::from_parts(51_000_000, 4713) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -2707,91 +2813,147 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 4274) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4274) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) - /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) - /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimType` (r:0 w:1) - /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:0 w:1) - /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_root_claim_type() -> Weight { - // Proof Size summary in bytes: - // Measured: `476` - // Estimated: `3941` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 3941) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingColdkeys` (`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::RootClaimType` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DissolveCleanupQueue` (r:1 w:0) - /// Proof: `SubtensorModule::DissolveCleanupQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:256 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:768 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:1) + /// Storage: `SubtensorModule::AlphaV2` (r:768 w:512) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:512) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:1) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimed` (r:1 w:1) - /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:256) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:256 w:256) + /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:1) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetProtocolFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetProtocolFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetRootSellTao` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetRootSellTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRedeemedTao` (r:256 w:256) + /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) + /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) + /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:0 w:1) + /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:256) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapBalancer` (r:0 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// The range of component `h` is `[1, 256]`. fn claim_root(h: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1969` - // Estimated: `7909` - // Minimum execution time: 66_000_000 picoseconds. - Weight::from_parts(70_000_000, 7909) - .saturating_add(T::DbWeight::get().reads(17_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_mul(h.into()) + // Measured: `2324 + h * (571 ±0)` + // Estimated: `8264 + h * (7997 ±0)` + // Minimum execution time: 292_000_000 picoseconds. + Weight::from_parts(295_000_000, 8264) + // Standard Error: 254_309 + .saturating_add(Weight::from_parts(234_093_735, 0).saturating_mul(h.into())) + .saturating_add(T::DbWeight::get().reads(22_u64)) + .saturating_add(T::DbWeight::get().reads((18_u64).saturating_mul(h.into()))) + .saturating_add(T::DbWeight::get().writes(16_u64)) + .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(h.into()))) + .saturating_add(Weight::from_parts(0, 7997).saturating_mul(h.into())) } - /// Per holding row a claim scans without redeeming: one `sim_swap` valuation plus - /// stake reads (no swap execution, no writes). + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:256 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:768 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:768 w:0) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:0) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:0) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:256 w:0) + /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `h` is `[1, 256]`. fn claim_root_scan(h: u32, ) -> Weight { - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(6_000_000, 1000) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_mul(h.into()) - } - /// Storage: `SubtensorModule::NumRootClaim` (r:0 w:1) - /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn sudo_set_num_root_claims() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `1875 + h * (538 ±0)` + // Estimated: `5336 + h * (7964 ±0)` + // Minimum execution time: 190_000_000 picoseconds. + Weight::from_parts(193_000_000, 5336) + // Standard Error: 280_079 + .saturating_add(Weight::from_parts(168_979_287, 0).saturating_mul(h.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((17_u64).saturating_mul(h.into()))) + .saturating_add(Weight::from_parts(0, 7964).saturating_mul(h.into())) } - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_root_claim_threshold() -> Weight { // Proof Size summary in bytes: - // Measured: `652` - // Estimated: `4117` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(7_000_000, 4117) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2804,8 +2966,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 4364) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 4364) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2815,12 +2977,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) @@ -2867,24 +3029,22 @@ 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::LockingColdkeys` (r:1 w:0) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `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::LockingColdkeys` (r:0 w:1) - /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2307` + // Measured: `2322` // Estimated: `8727` - // Minimum execution time: 459_000_000 picoseconds. - Weight::from_parts(477_000_000, 8727) - .saturating_add(T::DbWeight::get().reads(35_u64)) - .saturating_add(T::DbWeight::get().writes(17_u64)) + // Minimum execution time: 425_000_000 picoseconds. + Weight::from_parts(443_000_000, 8727) + .saturating_add(T::DbWeight::get().reads(36_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -2893,7 +3053,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) + Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -2930,22 +3090,22 @@ 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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn lock_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `1830` - // Estimated: `7770` - // Minimum execution time: 61_000_000 picoseconds. - Weight::from_parts(63_000_000, 7770) - .saturating_add(T::DbWeight::get().reads(18_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `1842` + // Estimated: `7782` + // Minimum execution time: 73_000_000 picoseconds. + Weight::from_parts(75_000_000, 7782) + .saturating_add(T::DbWeight::get().reads(20_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`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::Lock` (r:2 w:2) + /// Storage: `SubtensorModule::Lock` (r:3 w:2) /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2963,16 +3123,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::LockingColdkeys` (r:0 w:2) + /// Storage: `SubtensorModule::LockingColdkeys` (r:2 w:2) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn move_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1515` - // Estimated: `7455` - // Minimum execution time: 80_000_000 picoseconds. - Weight::from_parts(84_000_000, 7455) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + // Measured: `1722` + // Estimated: `10137` + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(93_000_000, 10137) + .saturating_add(T::DbWeight::get().reads(20_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2988,8 +3148,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1157` // Estimated: `4622` - // Minimum execution time: 378_000_000 picoseconds. - Weight::from_parts(395_000_000, 4622) + // Minimum execution time: 370_000_000 picoseconds. + Weight::from_parts(377_000_000, 4622) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3013,7 +3173,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `982` // Estimated: `4447` - // Minimum execution time: 24_000_000 picoseconds. + // Minimum execution time: 26_000_000 picoseconds. Weight::from_parts(27_000_000, 4447) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -3026,8 +3186,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4198) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 4198) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) @@ -3054,8 +3214,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1731` // Estimated: `7671` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 7671) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(33_000_000, 7671) .saturating_add(T::DbWeight::get().reads(11_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3076,8 +3236,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1019` // Estimated: `4484` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 4484) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4484) .saturating_add(T::DbWeight::get().reads(7_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:1 w:0) @@ -3090,8 +3250,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `721` // Estimated: `4186` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 4186) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 4186) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -3104,8 +3264,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `647` // Estimated: `4112` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4112) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4112) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -3116,8 +3276,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 4117) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 4117) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3159,10 +3319,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `4079 + n * (45 ±0)` // Estimated: `9373 + n * (2520 ±0)` - // Minimum execution time: 53_000_000 picoseconds. - Weight::from_parts(56_000_000, 9373) - // Standard Error: 3_996 - .saturating_add(Weight::from_parts(1_961_926, 0).saturating_mul(n.into())) + // Minimum execution time: 61_000_000 picoseconds. + Weight::from_parts(99_046_630, 9373) + // Standard Error: 5_784 + .saturating_add(Weight::from_parts(1_804_489, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -3200,8 +3360,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `37406` // Estimated: `40871` - // Minimum execution time: 116_000_000 picoseconds. - Weight::from_parts(124_000_000, 40871) + // Minimum execution time: 101_000_000 picoseconds. + Weight::from_parts(129_000_000, 40871) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3250,10 +3410,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `4835 + n * (37 ±0)` // Estimated: `10114 + n * (2512 ±0)` - // Minimum execution time: 60_000_000 picoseconds. - Weight::from_parts(61_000_000, 10114) - // Standard Error: 4_010 - .saturating_add(Weight::from_parts(2_031_383, 0).saturating_mul(n.into())) + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(40_743_358, 10114) + // Standard Error: 6_939 + .saturating_add(Weight::from_parts(1_900_854, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -3291,8 +3451,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 117_000_000 picoseconds. - Weight::from_parts(132_000_000, 40392) + // Minimum execution time: 125_000_000 picoseconds. + Weight::from_parts(141_000_000, 40392) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3328,29 +3488,37 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 113_000_000 picoseconds. - Weight::from_parts(130_000_000, 40392) + // Minimum execution time: 112_000_000 picoseconds. + Weight::from_parts(137_000_000, 40392) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:4098 w:8194) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) + /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:8193 w:8192) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:8193 w:0) + /// Storage: `SubtensorModule::Alpha` (r:8194 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:8193 w:8192) + /// Storage: `SubtensorModule::AlphaV2` (r:8194 w:8192) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:8194 w:8194) @@ -3381,6 +3549,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:4097 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:4096 w:8192) @@ -3405,16 +3581,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyRoot` (r:4096 w:4096) + /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:4096) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:8192) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey_v2() -> Weight { // Proof Size summary in bytes: - // Measured: `542010` - // Estimated: `20823150` - // Minimum execution time: 572_681_000_000 picoseconds. - Weight::from_parts(594_286_000_000, 20823150) - .saturating_add(T::DbWeight::get().reads(151588_u64)) - .saturating_add(T::DbWeight::get().writes(77845_u64)) + // Measured: `544206` + // Estimated: `20825346` + // Minimum execution time: 739_639_000_000 picoseconds. + Weight::from_parts(773_406_000_000, 20825346) + .saturating_add(T::DbWeight::get().reads(155695_u64)) + .saturating_add(T::DbWeight::get().writes(90131_u64)) } /// Storage: `SubtensorModule::MinChildkeyTake` (r:0 w:1) /// Proof: `SubtensorModule::MinChildkeyTake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -3422,8 +3602,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxChildkeyTake` (r:0 w:1) @@ -3432,10 +3612,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -3452,13 +3636,17 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1080` - // Estimated: `4545` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(52_000_000, 4545) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1185` + // Estimated: `4650` + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(61_000_000, 4650) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -3475,11 +3663,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1080` - // Estimated: `4545` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(51_000_000, 4545) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1185` + // Estimated: `4650` + // Minimum execution time: 54_000_000 picoseconds. + Weight::from_parts(64_000_000, 4650) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::TransactionKeyLastBlock` (r:1 w:1) @@ -3511,12 +3699,14 @@ impl WeightInfo for SubstrateWeight { /// Storage: `SubtensorModule::PendingChildKeys` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[1, 5]`. - fn set_children(_c: u32, ) -> Weight { + fn set_children(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1536` // Estimated: `9951` - // Minimum execution time: 50_000_000 picoseconds. - Weight::from_parts(55_660_572, 9951) + // Minimum execution time: 56_000_000 picoseconds. + Weight::from_parts(62_257_943, 9951) + // Standard Error: 51_019 + .saturating_add(Weight::from_parts(73_831, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3539,8 +3729,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 4203) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(17_000_000, 4203) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3556,8 +3746,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4264) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(18_000_000, 4264) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -3569,8 +3759,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4084) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -3620,10 +3810,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapBalancer` (r:1 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -3646,6 +3838,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -3690,20 +3884,18 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) - /// Storage: `Swap::SwapBalancer` (r:0 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn register_limit() -> Weight { // Proof Size summary in bytes: // Measured: `289796` // Estimated: `926861` - // Minimum execution time: 2_829_000_000 picoseconds. - Weight::from_parts(345_012_000, 6148) - .saturating_add(T::DbWeight::get().reads(34_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Minimum execution time: 2_987_000_000 picoseconds. + Weight::from_parts(3_170_000_000, 926861) + .saturating_add(T::DbWeight::get().reads(825_u64)) + .saturating_add(T::DbWeight::get().writes(299_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3725,30 +3917,30 @@ 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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_perpetual_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1226` - // Estimated: `7166` - // Minimum execution time: 52_000_000 picoseconds. - Weight::from_parts(54_000_000, 7166) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `1241` + // Estimated: `7181` + // Minimum execution time: 64_000_000 picoseconds. + Weight::from_parts(69_000_000, 7181) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } fn set_tempo() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 783_000 picoseconds. - Weight::from_parts(887_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_000_000, 0) } fn set_activity_cutoff_factor() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 803_000 picoseconds. - Weight::from_parts(891_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_000_000, 0) } /// Storage: `SubtensorModule::AccountFlags` (r:1 w:1) /// Proof: `SubtensorModule::AccountFlags` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3756,8 +3948,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `562` // Estimated: `4027` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 4027) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 4027) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -3863,6 +4055,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:0 w:1) @@ -3871,10 +4065,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `289875` // Estimated: `926940` - // Minimum execution time: 2_761_000_000 picoseconds. - Weight::from_parts(364_683_000, 6148) - .saturating_add(RocksDbWeight::get().reads(34_u64)) - .saturating_add(RocksDbWeight::get().writes(29_u64)) + // Minimum execution time: 2_950_000_000 picoseconds. + Weight::from_parts(3_170_000_000, 926940) + .saturating_add(RocksDbWeight::get().reads(814_u64)) + .saturating_add(RocksDbWeight::get().writes(294_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) /// Proof: `SubtensorModule::CommitRevealWeightsEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3914,8 +4108,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `188820` // Estimated: `10327410` - // Minimum execution time: 7_637_000_000 picoseconds. - Weight::from_parts(8_632_000_000, 10327410) + // Minimum execution time: 7_042_000_000 picoseconds. + Weight::from_parts(7_349_000_000, 10327410) .saturating_add(RocksDbWeight::get().reads(4112_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3927,12 +4121,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:3 w:3) @@ -3977,18 +4171,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2304` + // Measured: `2319` // Estimated: `8727` - // Minimum execution time: 301_000_000 picoseconds. - Weight::from_parts(310_000_000, 8727) - .saturating_add(RocksDbWeight::get().reads(32_u64)) - .saturating_add(RocksDbWeight::get().writes(16_u64)) + // Minimum execution time: 261_000_000 picoseconds. + Weight::from_parts(273_000_000, 8727) + .saturating_add(RocksDbWeight::get().reads(33_u64)) + .saturating_add(RocksDbWeight::get().writes(14_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4002,8 +4194,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4293) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4293) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4019,8 +4211,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4392` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4392) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(22_000_000, 4392) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4070,10 +4262,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapBalancer` (r:1 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -4096,6 +4290,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -4140,20 +4336,18 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) - /// Storage: `Swap::SwapBalancer` (r:0 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn burned_register() -> Weight { // Proof Size summary in bytes: // Measured: `289277` // Estimated: `926342` - // Minimum execution time: 2_807_000_000 picoseconds. - Weight::from_parts(365_124_000, 6148) - .saturating_add(RocksDbWeight::get().reads(34_u64)) - .saturating_add(RocksDbWeight::get().writes(29_u64)) + // Minimum execution time: 2_979_000_000 picoseconds. + Weight::from_parts(3_072_000_000, 926342) + .saturating_add(RocksDbWeight::get().reads(825_u64)) + .saturating_add(RocksDbWeight::get().writes(299_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4165,13 +4359,13 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::RegistrationsThisInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TargetRegistrationsPerInterval` (r:1 w:0) /// Proof: `SubtensorModule::TargetRegistrationsPerInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:1 w:2) + /// Storage: `SubtensorModule::Uids` (r:2 w:2) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetworkN` (r:1 w:0) /// Proof: `SubtensorModule::SubnetworkN` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4179,10 +4373,30 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:65 w:1) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:65 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:64 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Burn` (r:1 w:1) + /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) + /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:1 w:1) + /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BurnIncreaseMult` (r:1 w:0) + /// Proof: `SubtensorModule::BurnIncreaseMult` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinBurn` (r:1 w:0) + /// Proof: `SubtensorModule::MinBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MaxBurn` (r:1 w:0) + /// Proof: `SubtensorModule::MaxBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AssociatedEvmAddress` (r:1 w:0) /// Proof: `SubtensorModule::AssociatedEvmAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:1 w:1) @@ -4219,16 +4433,18 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_register() -> Weight { // Proof Size summary in bytes: - // Measured: `29210` - // Estimated: `191075` - // Minimum execution time: 566_000_000 picoseconds. - Weight::from_parts(621_000_000, 191075) - .saturating_add(RocksDbWeight::get().reads(219_u64)) - .saturating_add(RocksDbWeight::get().writes(88_u64)) + // Measured: `46222` + // Estimated: `208087` + // Minimum execution time: 633_000_000 picoseconds. + Weight::from_parts(672_000_000, 208087) + .saturating_add(RocksDbWeight::get().reads(229_u64)) + .saturating_add(RocksDbWeight::get().writes(94_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4340,6 +4556,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -4348,10 +4566,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1532` // Estimated: `9947` - // Minimum execution time: 145_000_000 picoseconds. - Weight::from_parts(153_000_000, 9947) - .saturating_add(RocksDbWeight::get().reads(42_u64)) - .saturating_add(RocksDbWeight::get().writes(48_u64)) + // Minimum execution time: 168_000_000 picoseconds. + Weight::from_parts(186_000_000, 9947) + .saturating_add(RocksDbWeight::get().reads(41_u64)) + .saturating_add(RocksDbWeight::get().writes(49_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4383,8 +4601,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1249` // Estimated: `4714` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 4714) + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(42_000_000, 4714) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4430,8 +4648,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(58_000_000, 7590) + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(71_000_000, 7590) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4441,8 +4659,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4465,8 +4683,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1033` // Estimated: `4498` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 4498) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(34_000_000, 4498) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4482,13 +4700,17 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4159) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(30_000_000, 4159) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -4513,8 +4735,18 @@ 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::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -4527,21 +4759,27 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) + /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey_announced() -> Weight { - // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral - // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `2110` - // Estimated: `100000` - // Minimum execution time: 450_000_000 picoseconds. - Weight::from_parts(450_000_000, 100000) - .saturating_add(RocksDbWeight::get().reads(250_u64)) - .saturating_add(RocksDbWeight::get().writes(200_u64)) + // Measured: `8414` + // Estimated: `167804` + // Minimum execution time: 883_000_000 picoseconds. + Weight::from_parts(921_000_000, 167804) + .saturating_add(RocksDbWeight::get().reads(114_u64)) + .saturating_add(RocksDbWeight::get().writes(87_u64)) } /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -4566,8 +4804,18 @@ 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::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) + /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -4578,20 +4826,22 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::DecayingLock` (r:1 w:0) /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapDisputes` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapDisputes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) + /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey() -> Weight { - // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral - // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `2166` - // Estimated: `100000` - // Minimum execution time: 480_000_000 picoseconds. - Weight::from_parts(480_000_000, 100000) - .saturating_add(RocksDbWeight::get().reads(250_u64)) - .saturating_add(RocksDbWeight::get().writes(210_u64)) + // Measured: `8417` + // Estimated: `167807` + // Minimum execution time: 911_000_000 picoseconds. + Weight::from_parts(951_000_000, 167807) + .saturating_add(RocksDbWeight::get().reads(114_u64)) + .saturating_add(RocksDbWeight::get().writes(91_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4601,8 +4851,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 4130) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 4130) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4614,8 +4864,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 4078) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4078) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4627,8 +4877,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(5_000_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -4673,8 +4923,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2155` // Estimated: `8095` - // Minimum execution time: 209_000_000 picoseconds. - Weight::from_parts(218_000_000, 8095) + // Minimum execution time: 233_000_000 picoseconds. + Weight::from_parts(247_000_000, 8095) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4712,8 +4962,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 94_000_000 picoseconds. - Weight::from_parts(98_000_000, 5219) + // Minimum execution time: 106_000_000 picoseconds. + Weight::from_parts(110_000_000, 5219) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -4749,13 +4999,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 92_000_000 picoseconds. - Weight::from_parts(102_000_000, 5219) + // Minimum execution time: 104_000_000 picoseconds. + Weight::from_parts(109_000_000, 5219) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: `System::ParentHash` (r:1 w:0) - /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:130 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:129 w:129) @@ -4800,6 +5048,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerBurned` (r:128 w:2) /// Proof: `SubtensorModule::MinerBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::EmissionGateBar` (r:1 w:1) + /// Proof: `SubtensorModule::EmissionGateBar` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::EmissionBarRank` (r:1 w:0) + /// Proof: `SubtensorModule::EmissionBarRank` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::EmissionGateExponent` (r:1 w:0) + /// Proof: `SubtensorModule::EmissionGateExponent` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetEmissionEnabled` (r:128 w:0) /// Proof: `SubtensorModule::SubnetEmissionEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:128 w:127) @@ -4850,7 +5104,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastUpdate` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::BlockAtRegistration` (r:512 w:0) /// Proof: `SubtensorModule::BlockAtRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:512) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ParentKeys` (r:512 w:0) /// Proof: `SubtensorModule::ParentKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4896,42 +5150,36 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MinChildkeyTakePerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:512 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:512 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:2 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:0) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:512 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:513 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:542 w:512) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:512 w:512) - /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:512 w:512) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootAlphaDividendsPerSubnet` (r:512 w:512) - /// Proof: `SubtensorModule::RootAlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:2 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketFlushCursor` (r:1 w:1) + /// Proof: `SubtensorModule::PendingBasketFlushCursor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:128 w:0) /// Proof: `SubtensorModule::EMAPriceHalvingBlocks` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:1 w:0) /// Proof: `SubtensorModule::SubnetMovingAlpha` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::PendingChildKeys` (r:129 w:0) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:0) - /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NumRootClaim` (r:1 w:0) - /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:1 w:0) - /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaMapLastKey` (r:1 w:0) /// Proof: `SubtensorModule::AlphaMapLastKey` (`max_values`: Some(1), `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::AlphaV2MapLastKey` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2MapLastKey` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:31 w:0) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootProp` (r:0 w:128) /// Proof: `SubtensorModule::RootProp` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:0 w:2) @@ -4962,12 +5210,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoInEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) fn block_step() -> Weight { // Proof Size summary in bytes: - // Measured: `35625441` - // Estimated: `38160831` - // Minimum execution time: 74_108_000_000 picoseconds. - Weight::from_parts(80_064_000_000, 38160831) - .saturating_add(RocksDbWeight::get().reads(13414_u64)) - .saturating_add(RocksDbWeight::get().writes(7064_u64)) + // Measured: `35120583` + // Estimated: `37655973` + // Minimum execution time: 49_851_000_000 picoseconds. + Weight::from_parts(53_672_000_000, 37655973) + .saturating_add(RocksDbWeight::get().reads(10347_u64)) + .saturating_add(RocksDbWeight::get().writes(3994_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4985,8 +5233,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 4583) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(27_000_000, 4583) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4994,12 +5242,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -5048,18 +5296,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2304` + // Measured: `2319` // Estimated: `8727` - // Minimum execution time: 382_000_000 picoseconds. - Weight::from_parts(395_000_000, 8727) - .saturating_add(RocksDbWeight::get().reads(32_u64)) - .saturating_add(RocksDbWeight::get().writes(16_u64)) + // Minimum execution time: 348_000_000 picoseconds. + Weight::from_parts(365_000_000, 8727) + .saturating_add(RocksDbWeight::get().reads(33_u64)) + .saturating_add(RocksDbWeight::get().writes(14_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5089,16 +5335,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `1979` - // Estimated: `7919` - // Minimum execution time: 106_000_000 picoseconds. - Weight::from_parts(110_000_000, 7919) + // Measured: `1978` + // Estimated: `7918` + // Minimum execution time: 123_000_000 picoseconds. + Weight::from_parts(130_000_000, 7918) .saturating_add(RocksDbWeight::get().reads(20_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5118,12 +5362,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetAlphaIn` (`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::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -5150,27 +5394,25 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2142` - // Estimated: `10557` - // Minimum execution time: 292_000_000 picoseconds. - Weight::from_parts(299_000_000, 10557) + // Measured: `2028` + // Estimated: `10443` + // Minimum execution time: 276_000_000 picoseconds. + Weight::from_parts(291_000_000, 10443) .saturating_add(RocksDbWeight::get().reads(30_u64)) - .saturating_add(RocksDbWeight::get().writes(13_u64)) + .saturating_add(RocksDbWeight::get().writes(12_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -5209,27 +5451,25 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2176` - // Estimated: `10591` - // Minimum execution time: 374_000_000 picoseconds. - Weight::from_parts(387_000_000, 10591) + // Measured: `2062` + // Estimated: `10477` + // Minimum execution time: 351_000_000 picoseconds. + Weight::from_parts(362_000_000, 10477) .saturating_add(RocksDbWeight::get().reads(29_u64)) - .saturating_add(RocksDbWeight::get().writes(13_u64)) + .saturating_add(RocksDbWeight::get().writes(12_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) @@ -5284,18 +5524,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2662` - // Estimated: `11077` - // Minimum execution time: 457_000_000 picoseconds. - Weight::from_parts(484_000_000, 11077) - .saturating_add(RocksDbWeight::get().reads(49_u64)) - .saturating_add(RocksDbWeight::get().writes(24_u64)) + // Measured: `2663` + // Estimated: `11078` + // Minimum execution time: 464_000_000 picoseconds. + Weight::from_parts(483_000_000, 11078) + .saturating_add(RocksDbWeight::get().reads(50_u64)) + .saturating_add(RocksDbWeight::get().writes(22_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5333,16 +5571,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `2023` - // Estimated: `7963` - // Minimum execution time: 134_000_000 picoseconds. - Weight::from_parts(142_000_000, 7963) + // Measured: `1909` + // Estimated: `7849` + // Minimum execution time: 153_000_000 picoseconds. + Weight::from_parts(163_000_000, 7849) .saturating_add(RocksDbWeight::get().reads(21_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5378,16 +5614,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_stake_and_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `2162` - // Estimated: `8102` - // Minimum execution time: 141_000_000 picoseconds. - Weight::from_parts(146_000_000, 8102) + // Measured: `2048` + // Estimated: `7988` + // Minimum execution time: 151_000_000 picoseconds. + Weight::from_parts(158_000_000, 7988) .saturating_add(RocksDbWeight::get().reads(24_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5395,10 +5629,6 @@ impl WeightInfo for () { /// 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::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMovingPrice` (`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) @@ -5411,14 +5641,18 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -5453,18 +5687,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `2602` - // Estimated: `8542` - // Minimum execution time: 351_000_000 picoseconds. - Weight::from_parts(371_000_000, 8542) - .saturating_add(RocksDbWeight::get().reads(34_u64)) - .saturating_add(RocksDbWeight::get().writes(17_u64)) + // Measured: `2650` + // Estimated: `8590` + // Minimum execution time: 421_000_000 picoseconds. + Weight::from_parts(433_000_000, 8590) + .saturating_add(RocksDbWeight::get().reads(35_u64)) + .saturating_add(RocksDbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5472,16 +5704,18 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_min_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `1015` - // Estimated: `4480` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 4480) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `1037` + // Estimated: `4502` + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 4502) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5501,14 +5735,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -5547,18 +5781,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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2505` - // Estimated: `10920` - // Minimum execution time: 371_000_000 picoseconds. - Weight::from_parts(388_000_000, 10920) - .saturating_add(RocksDbWeight::get().reads(49_u64)) - .saturating_add(RocksDbWeight::get().writes(24_u64)) + // Measured: `2506` + // Estimated: `10921` + // Minimum execution time: 359_000_000 picoseconds. + Weight::from_parts(378_000_000, 10921) + .saturating_add(RocksDbWeight::get().reads(50_u64)) + .saturating_add(RocksDbWeight::get().writes(22_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5594,8 +5826,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1300` // Estimated: `4765` - // Minimum execution time: 77_000_000 picoseconds. - Weight::from_parts(79_000_000, 4765) + // Minimum execution time: 87_000_000 picoseconds. + Weight::from_parts(94_000_000, 4765) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5635,8 +5867,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1455` // Estimated: `7395` - // Minimum execution time: 51_000_000 picoseconds. - Weight::from_parts(54_000_000, 7395) + // Minimum execution time: 59_000_000 picoseconds. + Weight::from_parts(62_000_000, 7395) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5652,8 +5884,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `830` // Estimated: `4295` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4295) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4295) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5671,8 +5903,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `923` // Estimated: `4388` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 4388) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4388) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5786,6 +6018,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -5794,10 +6028,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1468` // Estimated: `9883` - // Minimum execution time: 143_000_000 picoseconds. - Weight::from_parts(148_000_000, 9883) - .saturating_add(RocksDbWeight::get().reads(41_u64)) - .saturating_add(RocksDbWeight::get().writes(47_u64)) + // Minimum execution time: 168_000_000 picoseconds. + Weight::from_parts(180_000_000, 9883) + .saturating_add(RocksDbWeight::get().reads(40_u64)) + .saturating_add(RocksDbWeight::get().writes(48_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5811,8 +6045,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4264) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 4264) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -5826,8 +6060,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `889` // Estimated: `6829` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 6829) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(20_000_000, 6829) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -5841,29 +6075,37 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 4203) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 4203) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:18 w:34) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) + /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:33 w:32) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:2547 w:0) + /// Storage: `SubtensorModule::Alpha` (r:2548 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2547 w:2546) + /// Storage: `SubtensorModule::AlphaV2` (r:2548 w:2546) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:34 w:34) @@ -5894,6 +6136,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:17 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:16 w:32) @@ -5918,16 +6168,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyRoot` (r:16 w:16) + /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:16) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:32) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `219071` - // Estimated: `6523886` - // Minimum execution time: 83_390_000_000 picoseconds. - Weight::from_parts(87_695_000_000, 6523886) - .saturating_add(RocksDbWeight::get().reads(6928_u64)) - .saturating_add(RocksDbWeight::get().writes(4111_u64)) + // Measured: `219260` + // Estimated: `6526550` + // Minimum execution time: 88_389_000_000 picoseconds. + Weight::from_parts(93_978_000_000, 6526550) + .saturating_add(RocksDbWeight::get().reads(6955_u64)) + .saturating_add(RocksDbWeight::get().writes(4157_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5939,8 +6193,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `818` // Estimated: `4283` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 4283) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 4283) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -5954,10 +6208,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `774` // Estimated: `9189` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 9189) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 9189) .saturating_add(RocksDbWeight::get().reads(6_u64)) } + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`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::NetworksAdded` (r:3 w:0) @@ -5976,14 +6234,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -6006,8 +6264,14 @@ impl WeightInfo for () { /// Proof: `AlphaAssets::AlphaBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:1 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:1 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) @@ -6018,11 +6282,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unstake_all_alpha() -> Weight { // Proof Size summary in bytes: - // Measured: `2235` + // Measured: `2446` // Estimated: `11306` - // Minimum execution time: 380_000_000 picoseconds. + // Minimum execution time: 370_000_000 picoseconds. Weight::from_parts(384_000_000, 11306) - .saturating_add(RocksDbWeight::get().reads(45_u64)) + .saturating_add(RocksDbWeight::get().reads(50_u64)) .saturating_add(RocksDbWeight::get().writes(25_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -6041,12 +6305,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -6073,16 +6337,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2176` - // Estimated: `10591` - // Minimum execution time: 388_000_000 picoseconds. - Weight::from_parts(415_000_000, 10591) + // Measured: `2062` + // Estimated: `10477` + // Minimum execution time: 366_000_000 picoseconds. + Weight::from_parts(380_000_000, 10477) .saturating_add(RocksDbWeight::get().reads(29_u64)) - .saturating_add(RocksDbWeight::get().writes(13_u64)) + .saturating_add(RocksDbWeight::get().writes(12_u64)) } /// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:0) /// Proof: `Crowdloan::CurrentCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -6212,6 +6474,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -6221,13 +6485,13 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1835 + k * (44 ±0)` // Estimated: `10256 + k * (2579 ±0)` - // Minimum execution time: 259_000_000 picoseconds. - Weight::from_parts(171_942_062, 10256) - // Standard Error: 74_270 - .saturating_add(Weight::from_parts(29_141_808, 0).saturating_mul(k.into())) + // Minimum execution time: 306_000_000 picoseconds. + Weight::from_parts(199_755_086, 10256) + // Standard Error: 64_460 + .saturating_add(Weight::from_parts(32_306_685, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(50_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into()))) - .saturating_add(RocksDbWeight::get().writes(53_u64)) + .saturating_add(RocksDbWeight::get().writes(54_u64)) .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) } @@ -6241,14 +6505,8 @@ 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::OwnerLock` (r:1 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:2 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:1 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:2 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LockingColdkeys` (r:2 w:0) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetLeaseShares` (r:499 w:499) @@ -6261,23 +6519,64 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AccumulatedLeaseDividends` (r:0 w:1) /// Proof: `SubtensorModule::AccumulatedLeaseDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[2, 500]`. fn terminate_lease(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2111 + k * (53 ±0)` - // Estimated: `8054 + k * (2529 ±0)` - // Minimum execution time: 87_000_000 picoseconds. - Weight::from_parts(93_461_390, 8054) - // Standard Error: 4_516 - .saturating_add(Weight::from_parts(1_356_955, 0).saturating_mul(k.into())) - .saturating_add(RocksDbWeight::get().reads(13_u64)) + // Measured: `1836 + k * (53 ±0)` + // Estimated: `7778 + k * (2529 ±0)` + // Minimum execution time: 88_000_000 picoseconds. + Weight::from_parts(98_396_469, 7778) + // Standard Error: 6_969 + .saturating_add(Weight::from_parts(1_324_962, 0).saturating_mul(k.into())) + .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(14_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) } + /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) + /// 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::LockingColdkeys` (r:130 w:128) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Lock` (r:128 w:128) + /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingLock` (r:128 w:0) + /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) + /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) + /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `l` is `[1, 128]`. + fn transition_subnet_owner_locks(l: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1018 + l * (190 ±0)` + // Estimated: `6952 + l * (2665 ±0)` + // Minimum execution time: 59_000_000 picoseconds. + Weight::from_parts(41_965_196, 6952) + // Standard Error: 77_595 + .saturating_add(Weight::from_parts(29_329_722, 0).saturating_mul(l.into())) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(l.into()))) + .saturating_add(RocksDbWeight::get().writes(8_u64)) + .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(l.into()))) + .saturating_add(Weight::from_parts(0, 2665).saturating_mul(l.into())) + } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -6288,8 +6587,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `762` // Estimated: `9177` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 9177) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 9177) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -6325,7 +6624,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1248` // Estimated: `4713` - // Minimum execution time: 46_000_000 picoseconds. + // Minimum execution time: 49_000_000 picoseconds. Weight::from_parts(51_000_000, 4713) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -6342,91 +6641,147 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 4274) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4274) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:256 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:768 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:768 w:512) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:512) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:256) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:256 w:256) + /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:1) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetAlphaOut` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) + /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetProtocolFlow` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetProtocolFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetRootSellTao` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetRootSellTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRedeemedTao` (r:256 w:256) + /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimType` (r:0 w:1) - /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:0 w:1) /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_root_claim_type() -> Weight { + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:256) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapBalancer` (r:0 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// The range of component `h` is `[1, 256]`. + fn claim_root(h: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `476` - // Estimated: `3941` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 3941) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `2324 + h * (571 ±0)` + // Estimated: `8264 + h * (7997 ±0)` + // Minimum execution time: 292_000_000 picoseconds. + Weight::from_parts(295_000_000, 8264) + // Standard Error: 254_309 + .saturating_add(Weight::from_parts(234_093_735, 0).saturating_mul(h.into())) + .saturating_add(RocksDbWeight::get().reads(22_u64)) + .saturating_add(RocksDbWeight::get().reads((18_u64).saturating_mul(h.into()))) + .saturating_add(RocksDbWeight::get().writes(16_u64)) + .saturating_add(RocksDbWeight::get().writes((10_u64).saturating_mul(h.into()))) + .saturating_add(Weight::from_parts(0, 7997).saturating_mul(h.into())) } - /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingColdkeys` (`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::RootClaimType` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DissolveCleanupQueue` (r:1 w:0) - /// Proof: `SubtensorModule::DissolveCleanupQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Uids` (r:256 w:0) + /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:768 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:1) + /// Storage: `SubtensorModule::AlphaV2` (r:768 w:0) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:1) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:0) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimed` (r:1 w:1) - /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn claim_root(h: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1969` - // Estimated: `7909` - // Minimum execution time: 66_000_000 picoseconds. - Weight::from_parts(70_000_000, 7909) - .saturating_add(RocksDbWeight::get().reads(17_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - .saturating_mul(h.into()) - } - /// Per holding row a claim scans without redeeming: one `sim_swap` valuation plus - /// stake reads (no swap execution, no writes). + /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:256 w:0) + /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `h` is `[1, 256]`. fn claim_root_scan(h: u32, ) -> Weight { - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(6_000_000, 1000) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_mul(h.into()) - } - /// Storage: `SubtensorModule::NumRootClaim` (r:0 w:1) - /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn sudo_set_num_root_claims() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `1875 + h * (538 ±0)` + // Estimated: `5336 + h * (7964 ±0)` + // Minimum execution time: 190_000_000 picoseconds. + Weight::from_parts(193_000_000, 5336) + // Standard Error: 280_079 + .saturating_add(Weight::from_parts(168_979_287, 0).saturating_mul(h.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().reads((17_u64).saturating_mul(h.into()))) + .saturating_add(Weight::from_parts(0, 7964).saturating_mul(h.into())) } - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_root_claim_threshold() -> Weight { // Proof Size summary in bytes: - // Measured: `652` - // Estimated: `4117` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(7_000_000, 4117) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -6439,8 +6794,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 4364) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 4364) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -6450,12 +6805,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) @@ -6502,24 +6857,22 @@ 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::LockingColdkeys` (r:1 w:0) + /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `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::LockingColdkeys` (r:0 w:1) - /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2307` + // Measured: `2322` // Estimated: `8727` - // Minimum execution time: 459_000_000 picoseconds. - Weight::from_parts(477_000_000, 8727) - .saturating_add(RocksDbWeight::get().reads(35_u64)) - .saturating_add(RocksDbWeight::get().writes(17_u64)) + // Minimum execution time: 425_000_000 picoseconds. + Weight::from_parts(443_000_000, 8727) + .saturating_add(RocksDbWeight::get().reads(36_u64)) + .saturating_add(RocksDbWeight::get().writes(15_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -6528,7 +6881,7 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) + Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -6565,22 +6918,22 @@ 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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn lock_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `1830` - // Estimated: `7770` - // Minimum execution time: 61_000_000 picoseconds. - Weight::from_parts(63_000_000, 7770) - .saturating_add(RocksDbWeight::get().reads(18_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `1842` + // Estimated: `7782` + // Minimum execution time: 73_000_000 picoseconds. + Weight::from_parts(75_000_000, 7782) + .saturating_add(RocksDbWeight::get().reads(20_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`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::Lock` (r:2 w:2) + /// Storage: `SubtensorModule::Lock` (r:3 w:2) /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -6598,16 +6951,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::LockingColdkeys` (r:0 w:2) + /// Storage: `SubtensorModule::LockingColdkeys` (r:2 w:2) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn move_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1515` - // Estimated: `7455` - // Minimum execution time: 80_000_000 picoseconds. - Weight::from_parts(84_000_000, 7455) - .saturating_add(RocksDbWeight::get().reads(15_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) + // Measured: `1722` + // Estimated: `10137` + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(93_000_000, 10137) + .saturating_add(RocksDbWeight::get().reads(20_u64)) + .saturating_add(RocksDbWeight::get().writes(8_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -6623,8 +6976,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1157` // Estimated: `4622` - // Minimum execution time: 378_000_000 picoseconds. - Weight::from_parts(395_000_000, 4622) + // Minimum execution time: 370_000_000 picoseconds. + Weight::from_parts(377_000_000, 4622) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -6648,7 +7001,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `982` // Estimated: `4447` - // Minimum execution time: 24_000_000 picoseconds. + // Minimum execution time: 26_000_000 picoseconds. Weight::from_parts(27_000_000, 4447) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -6661,8 +7014,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4198) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 4198) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) @@ -6689,8 +7042,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1731` // Estimated: `7671` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 7671) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(33_000_000, 7671) .saturating_add(RocksDbWeight::get().reads(11_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -6711,8 +7064,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1019` // Estimated: `4484` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 4484) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 4484) .saturating_add(RocksDbWeight::get().reads(7_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:1 w:0) @@ -6725,8 +7078,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `721` // Estimated: `4186` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 4186) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 4186) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -6739,8 +7092,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `647` // Estimated: `4112` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4112) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4112) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -6751,8 +7104,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 4117) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 4117) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -6794,10 +7147,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `4079 + n * (45 ±0)` // Estimated: `9373 + n * (2520 ±0)` - // Minimum execution time: 53_000_000 picoseconds. - Weight::from_parts(56_000_000, 9373) - // Standard Error: 3_996 - .saturating_add(Weight::from_parts(1_961_926, 0).saturating_mul(n.into())) + // Minimum execution time: 61_000_000 picoseconds. + Weight::from_parts(99_046_630, 9373) + // Standard Error: 5_784 + .saturating_add(Weight::from_parts(1_804_489, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -6835,8 +7188,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `37406` // Estimated: `40871` - // Minimum execution time: 116_000_000 picoseconds. - Weight::from_parts(124_000_000, 40871) + // Minimum execution time: 101_000_000 picoseconds. + Weight::from_parts(129_000_000, 40871) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -6885,10 +7238,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `4835 + n * (37 ±0)` // Estimated: `10114 + n * (2512 ±0)` - // Minimum execution time: 60_000_000 picoseconds. - Weight::from_parts(61_000_000, 10114) - // Standard Error: 4_010 - .saturating_add(Weight::from_parts(2_031_383, 0).saturating_mul(n.into())) + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(40_743_358, 10114) + // Standard Error: 6_939 + .saturating_add(Weight::from_parts(1_900_854, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -6926,8 +7279,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 117_000_000 picoseconds. - Weight::from_parts(132_000_000, 40392) + // Minimum execution time: 125_000_000 picoseconds. + Weight::from_parts(141_000_000, 40392) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -6963,29 +7316,37 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 113_000_000 picoseconds. - Weight::from_parts(130_000_000, 40392) + // Minimum execution time: 112_000_000 picoseconds. + Weight::from_parts(137_000_000, 40392) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:4098 w:8194) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) + /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) + /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:8193 w:8192) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:8193 w:0) + /// Storage: `SubtensorModule::Alpha` (r:8194 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:8193 w:8192) + /// Storage: `SubtensorModule::AlphaV2` (r:8194 w:8192) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:8194 w:8194) @@ -7016,6 +7377,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:4097 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) + /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) + /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) + /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:4096 w:8192) @@ -7040,16 +7409,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeyRoot` (r:4096 w:4096) + /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:4096) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:8192) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey_v2() -> Weight { // Proof Size summary in bytes: - // Measured: `542010` - // Estimated: `20823150` - // Minimum execution time: 572_681_000_000 picoseconds. - Weight::from_parts(594_286_000_000, 20823150) - .saturating_add(RocksDbWeight::get().reads(151588_u64)) - .saturating_add(RocksDbWeight::get().writes(77845_u64)) + // Measured: `544206` + // Estimated: `20825346` + // Minimum execution time: 739_639_000_000 picoseconds. + Weight::from_parts(773_406_000_000, 20825346) + .saturating_add(RocksDbWeight::get().reads(155695_u64)) + .saturating_add(RocksDbWeight::get().writes(90131_u64)) } /// Storage: `SubtensorModule::MinChildkeyTake` (r:0 w:1) /// Proof: `SubtensorModule::MinChildkeyTake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -7057,8 +7430,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxChildkeyTake` (r:0 w:1) @@ -7067,10 +7440,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -7087,13 +7464,17 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1080` - // Estimated: `4545` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(52_000_000, 4545) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1185` + // Estimated: `4650` + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(61_000_000, 4650) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } + /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) + /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) + /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -7110,11 +7491,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1080` - // Estimated: `4545` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(51_000_000, 4545) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1185` + // Estimated: `4650` + // Minimum execution time: 54_000_000 picoseconds. + Weight::from_parts(64_000_000, 4650) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::TransactionKeyLastBlock` (r:1 w:1) @@ -7146,12 +7527,14 @@ impl WeightInfo for () { /// Storage: `SubtensorModule::PendingChildKeys` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[1, 5]`. - fn set_children(_c: u32, ) -> Weight { + fn set_children(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1536` // Estimated: `9951` - // Minimum execution time: 50_000_000 picoseconds. - Weight::from_parts(55_660_572, 9951) + // Minimum execution time: 56_000_000 picoseconds. + Weight::from_parts(62_257_943, 9951) + // Standard Error: 51_019 + .saturating_add(Weight::from_parts(73_831, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7174,8 +7557,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 4203) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(17_000_000, 4203) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7191,8 +7574,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4264) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(18_000_000, 4264) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -7204,8 +7587,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4084) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -7255,10 +7638,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::SwapBalancer` (r:1 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -7281,6 +7666,8 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) + /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -7325,20 +7712,18 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) + /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) - /// Storage: `Swap::SwapBalancer` (r:0 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn register_limit() -> Weight { // Proof Size summary in bytes: // Measured: `289796` // Estimated: `926861` - // Minimum execution time: 2_829_000_000 picoseconds. - Weight::from_parts(345_012_000, 6148) - .saturating_add(RocksDbWeight::get().reads(34_u64)) - .saturating_add(RocksDbWeight::get().writes(29_u64)) + // Minimum execution time: 2_987_000_000 picoseconds. + Weight::from_parts(3_170_000_000, 926861) + .saturating_add(RocksDbWeight::get().reads(825_u64)) + .saturating_add(RocksDbWeight::get().writes(299_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -7360,30 +7745,30 @@ 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::LockingColdkeys` (r:0 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_perpetual_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1226` - // Estimated: `7166` - // Minimum execution time: 52_000_000 picoseconds. - Weight::from_parts(54_000_000, 7166) - .saturating_add(RocksDbWeight::get().reads(11_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `1241` + // Estimated: `7181` + // Minimum execution time: 64_000_000 picoseconds. + Weight::from_parts(69_000_000, 7181) + .saturating_add(RocksDbWeight::get().reads(12_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } fn set_tempo() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 783_000 picoseconds. - Weight::from_parts(887_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_000_000, 0) } fn set_activity_cutoff_factor() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 803_000 picoseconds. - Weight::from_parts(891_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_000_000, 0) } /// Storage: `SubtensorModule::AccountFlags` (r:1 w:1) /// Proof: `SubtensorModule::AccountFlags` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -7391,8 +7776,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `562` // Estimated: `4027` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 4027) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 4027) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/precompiles/src/staking.rs b/precompiles/src/staking.rs index 09dba7e93a..f4106301af 100644 --- a/precompiles/src/staking.rs +++ b/precompiles/src/staking.rs @@ -573,7 +573,7 @@ where let now = pallet_subtensor::Pallet::::get_current_block_as_u64(); let owner_lock = hotkey == pallet_subtensor::SubnetOwnerHotkey::::get(netuid); - let lock = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( + let lock = pallet_subtensor::staking::lock::roll_lock_state( lock, now, pallet_subtensor::UnlockRate::::get(), @@ -581,7 +581,7 @@ where owner_lock, perpetual, ); - let exists = !lock.is_zero(); + let exists = !lock.is_dust(); let hotkey: [u8; 32] = hotkey.into(); Ok(( @@ -618,7 +618,7 @@ where owner_lock: bool, perpetual_lock: bool| { if let Some(lock) = maybe_lock { - let lock = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( + let lock = pallet_subtensor::staking::lock::roll_lock_state( lock, now, unlock_rate, @@ -2920,7 +2920,7 @@ mod tests { frame_system::Pallet::::set_block_number(100); let raw_lock = pallet_subtensor::Lock::::get((&coldkey, netuid, &hotkey)) .expect("stale individual lock remains in storage"); - let rolled_lock = pallet_subtensor::staking::lock::ConvictionModel::roll_forward_lock( + let rolled_lock = pallet_subtensor::staking::lock::roll_lock_state( raw_lock, 100, pallet_subtensor::UnlockRate::::get(), @@ -2928,7 +2928,7 @@ mod tests { true, false, ); - assert!(rolled_lock.is_zero()); + assert!(rolled_lock.is_dust()); precompiles .prepare_test( From a21a04c7df7bfe92157fd9551cdcb985fd4a4caf Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Fri, 28 Aug 2026 16:47:01 -0400 Subject: [PATCH 12/14] Revert ownership transition weight accounting --- pallets/admin-utils/src/benchmarking.rs | 9 +- pallets/admin-utils/src/lib.rs | 12 +- pallets/admin-utils/src/weights.rs | 828 +++--- .../subtensor/src/benchmarks/benchmarks.rs | 48 - pallets/subtensor/src/coinbase/block_step.rs | 7 +- .../subtensor/src/coinbase/run_coinbase.rs | 24 +- pallets/subtensor/src/macros/dispatches.rs | 13 +- pallets/subtensor/src/macros/hooks.rs | 5 +- pallets/subtensor/src/staking/lock.rs | 90 +- pallets/subtensor/src/subnets/leasing.rs | 17 +- pallets/subtensor/src/tests/leasing.rs | 4 - pallets/subtensor/src/tests/locks.rs | 23 +- pallets/subtensor/src/weights.rs | 2323 +++++++---------- 13 files changed, 1353 insertions(+), 2050 deletions(-) diff --git a/pallets/admin-utils/src/benchmarking.rs b/pallets/admin-utils/src/benchmarking.rs index 913b049161..f168f8ba45 100644 --- a/pallets/admin-utils/src/benchmarking.rs +++ b/pallets/admin-utils/src/benchmarking.rs @@ -636,21 +636,14 @@ mod benchmarks { #[benchmark] fn sudo_set_sn_owner_hotkey() { let netuid = NetUid::from(1); - let old_hotkey: T::AccountId = account("OldOwner", 0, 1); let hotkey: T::AccountId = account("Alice", 0, 1); pallet_subtensor::Pallet::::init_new_network( netuid, 1u16, // tempo ); - pallet_subtensor::SubnetOwnerHotkey::::insert(netuid, &old_hotkey); #[extrinsic_call] - _(RawOrigin::Root, netuid, hotkey.clone()); - - assert_eq!( - pallet_subtensor::SubnetOwnerHotkey::::get(netuid), - hotkey - ); + _(RawOrigin::Root, netuid, hotkey); } #[benchmark] diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index bec53b079a..85d6cf7b07 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -1809,17 +1809,7 @@ pub mod pallet { /// # Rate Limiting /// This function is rate-limited to one call per subnet per interval (e.g., one week). #[pallet::call_index(67)] - #[pallet::weight({ - let member_count = - pallet_subtensor::Pallet::::owner_transition_member_count(*netuid, hotkey); - ::WeightInfo::sudo_set_sn_owner_hotkey().saturating_add( - <::WeightInfo as pallet_subtensor::weights::WeightInfo>::transition_subnet_owner_locks( - member_count, - ).saturating_add( - pallet_subtensor::Pallet::::owner_transition_member_count_weight(member_count), - ), - ) - })] + #[pallet::weight(::WeightInfo::sudo_set_sn_owner_hotkey())] pub fn sudo_set_sn_owner_hotkey( origin: OriginFor, netuid: NetUid, diff --git a/pallets/admin-utils/src/weights.rs b/pallets/admin-utils/src/weights.rs index 65d2e21edb..1e88c8d00a 100644 --- a/pallets/admin-utils/src/weights.rs +++ b/pallets/admin-utils/src/weights.rs @@ -2,16 +2,16 @@ //! Autogenerated weights for `pallet_admin_utils` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Grigoris-MBP.lan`, CPU: `` +//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// /Users/grigorizaitsev/development/subtensor/target/production/node-subtensor +// /home/runner/work/subtensor/subtensor/target/production/node-subtensor // benchmark // pallet -// --runtime=/Users/grigorizaitsev/development/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm +// --runtime=/home/runner/work/subtensor/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm // --genesis-builder=runtime // --genesis-builder-preset=benchmark // --wasm-execution=compiled @@ -22,8 +22,8 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/Users/grigorizaitsev/development/subtensor/pallets/admin-utils/src/weights.rs -// --template=/Users/grigorizaitsev/development/subtensor/.maintain/frame-weight-template.hbs +// --output=/tmp/tmp.iJZ8rYougD +// --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -119,10 +119,10 @@ pub trait WeightInfo { fn sudo_set_start_call_delay() -> Weight; fn sudo_set_burn_half_life() -> Weight; fn sudo_set_burn_increase_mult() -> Weight; - fn sudo_set_collateral_lock_share() -> Weight; - fn sudo_set_collateral_drain_ratio() -> Weight; fn sudo_set_owner_cut_enabled() -> Weight; fn sudo_set_owner_cut_auto_lock_enabled() -> Weight; + fn sudo_set_collateral_lock_share() -> Weight; + fn sudo_set_collateral_drain_ratio() -> Weight; fn sudo_set_root_weights_cap() -> Weight; } @@ -136,10 +136,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_608_495, 0) - // Standard Error: 1_565 - .saturating_add(Weight::from_parts(15_303, 0).saturating_mul(a.into())) + // Minimum execution time: 4_007_000 picoseconds. + Weight::from_parts(4_721_714, 0) + // Standard Error: 732 + .saturating_add(Weight::from_parts(25_072, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -164,8 +164,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_330_000 picoseconds. + Weight::from_parts(5_691_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -182,8 +182,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `747` // Estimated: `4212` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4212) + // Minimum execution time: 27_211_000 picoseconds. + Weight::from_parts(28_163_000, 4212) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -203,8 +203,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(24_000_000, 4383) + // Minimum execution time: 32_972_000 picoseconds. + Weight::from_parts(34_014_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -224,8 +224,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 32_831_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -237,8 +237,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4084) + // Minimum execution time: 15_810_000 picoseconds. + Weight::from_parts(16_350_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -258,8 +258,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 32_982_000 picoseconds. + Weight::from_parts(34_094_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -279,8 +279,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 32_911_000 picoseconds. + Weight::from_parts(33_944_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -300,8 +300,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_082_000 picoseconds. + Weight::from_parts(33_894_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -323,8 +323,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 34_535_000 picoseconds. + Weight::from_parts(35_477_000, 4383) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -344,8 +344,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 33_062_000 picoseconds. + Weight::from_parts(33_974_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -357,8 +357,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4084) + // Minimum execution time: 16_090_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -378,8 +378,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 33_452_000 picoseconds. + Weight::from_parts(34_194_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -401,8 +401,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_753_000 picoseconds. + Weight::from_parts(34_805_000, 4383) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -412,8 +412,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 6_993_000 picoseconds. + Weight::from_parts(7_354_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -432,8 +432,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_000_000, 4383) + // Minimum execution time: 29_966_000 picoseconds. + Weight::from_parts(30_948_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -445,8 +445,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4084) + // Minimum execution time: 16_040_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -470,8 +470,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4383) + // Minimum execution time: 35_977_000 picoseconds. + Weight::from_parts(37_299_000, 4383) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -497,8 +497,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4433` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(28_000_000, 4433) + // Minimum execution time: 41_067_000 picoseconds. + Weight::from_parts(42_269_000, 4433) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -518,8 +518,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 32_721_000 picoseconds. + Weight::from_parts(33_793_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -539,8 +539,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 32_601_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -560,8 +560,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 33_112_000 picoseconds. + Weight::from_parts(33_784_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -583,8 +583,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `945` // Estimated: `4410` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4410) + // Minimum execution time: 36_247_000 picoseconds. + Weight::from_parts(36_978_000, 4410) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -606,8 +606,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `920` // Estimated: `4385` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4385) + // Minimum execution time: 35_867_000 picoseconds. + Weight::from_parts(37_510_000, 4385) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -617,8 +617,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 6_752_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -639,8 +639,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 4440) + // Minimum execution time: 45_966_000 picoseconds. + Weight::from_parts(47_038_000, 4440) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -660,8 +660,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_763_000 picoseconds. + Weight::from_parts(34_514_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -681,8 +681,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_242_000 picoseconds. + Weight::from_parts(33_914_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -692,8 +692,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_971_000 picoseconds. + Weight::from_parts(6_352_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -702,16 +702,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_360_000 picoseconds. + Weight::from_parts(5_720_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn sudo_set_total_issuance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_790_000 picoseconds. + Weight::from_parts(6_021_000, 0) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -721,8 +721,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4084) + // Minimum execution time: 15_869_000 picoseconds. + Weight::from_parts(16_370_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -732,8 +732,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_661_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -748,8 +748,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `950` // Estimated: `6890` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 6890) + // Minimum execution time: 29_785_000 picoseconds. + Weight::from_parts(30_577_000, 6890) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -759,8 +759,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_561_000 picoseconds. + Weight::from_parts(5_721_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -769,8 +769,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_410_000 picoseconds. + Weight::from_parts(5_671_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -793,8 +793,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `954` // Estimated: `4419` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4419) + // Minimum execution time: 36_419_000 picoseconds. + Weight::from_parts(37_621_000, 4419) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -812,8 +812,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4280) + // Minimum execution time: 24_436_000 picoseconds. + Weight::from_parts(25_598_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -833,8 +833,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `962` // Estimated: `4427` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4427) + // Minimum execution time: 33_122_000 picoseconds. + Weight::from_parts(33_783_000, 4427) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -844,8 +844,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_791_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -854,8 +854,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_760_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -864,8 +864,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_240_000 picoseconds. + Weight::from_parts(5_660_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -882,8 +882,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4280) + // Minimum execution time: 27_180_000 picoseconds. + Weight::from_parts(28_282_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -893,8 +893,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 3507) + // Minimum execution time: 6_051_000 picoseconds. + Weight::from_parts(6_202_000, 3507) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -903,8 +903,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_875_000 picoseconds. + Weight::from_parts(2_985_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -913,8 +913,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 3_877_000 picoseconds. + Weight::from_parts(4_238_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -933,8 +933,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 4383) + // Minimum execution time: 29_776_000 picoseconds. + Weight::from_parts(30_897_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -952,8 +952,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4280) + // Minimum execution time: 27_751_000 picoseconds. + Weight::from_parts(28_463_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -971,8 +971,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 4280) + // Minimum execution time: 29_636_000 picoseconds. + Weight::from_parts(30_025_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -984,8 +984,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4084) + // Minimum execution time: 15_900_000 picoseconds. + Weight::from_parts(16_401_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -993,30 +993,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:1) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) - /// 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::LockingColdkeys` (r:2 w:0) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_sn_owner_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `925` - // Estimated: `6865` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(41_000_000, 6865) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) + // Measured: `712` + // Estimated: `4177` + // Minimum execution time: 24_415_000 picoseconds. + Weight::from_parts(25_167_000, 4177) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1032,8 +1018,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 4280) + // Minimum execution time: 24_125_000 picoseconds. + Weight::from_parts(24_847_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1043,8 +1029,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_500_000 picoseconds. + Weight::from_parts(5_731_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -1053,8 +1039,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_600_000 picoseconds. + Weight::from_parts(5_831_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1071,8 +1057,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4280) + // Minimum execution time: 24_045_000 picoseconds. + Weight::from_parts(24_967_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1096,8 +1082,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `933` // Estimated: `4398` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4398) + // Minimum execution time: 36_298_000 picoseconds. + Weight::from_parts(37_260_000, 4398) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1107,8 +1093,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 6_904_000 picoseconds. + Weight::from_parts(7_203_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxEpochsPerBlock` (r:0 w:1) @@ -1117,8 +1103,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_460_000 picoseconds. + Weight::from_parts(5_740_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1143,8 +1129,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 4467) + // Minimum execution time: 41_231_000 picoseconds. + Weight::from_parts(42_292_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1152,8 +1138,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_692_000 picoseconds. + Weight::from_parts(1_913_000, 0) } /// Storage: `SubtensorModule::SubnetOwnerCut` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwnerCut` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -1161,8 +1147,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_996_000 picoseconds. + Weight::from_parts(4_416_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkRateLimit` (r:0 w:1) @@ -1171,8 +1157,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_996_000 picoseconds. + Weight::from_parts(4_267_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkImmunityPeriod` (r:0 w:1) @@ -1181,8 +1167,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_996_000 picoseconds. + Weight::from_parts(4_347_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkMinLockCost` (r:0 w:1) @@ -1191,8 +1177,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_896_000 picoseconds. + Weight::from_parts(4_166_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetLimit` (r:0 w:1) @@ -1201,8 +1187,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_896_000 picoseconds. + Weight::from_parts(4_246_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkLockReductionInterval` (r:0 w:1) @@ -1211,8 +1197,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_925_000 picoseconds. + Weight::from_parts(4_257_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `EVMChainId::ChainId` (r:0 w:1) @@ -1221,8 +1207,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_655_000 picoseconds. + Weight::from_parts(2_875_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1245,8 +1231,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4364) + // Minimum execution time: 32_888_000 picoseconds. + Weight::from_parts(33_720_000, 4364) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1256,8 +1242,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_903_000 picoseconds. + Weight::from_parts(2_083_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1286,8 +1272,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1132` // Estimated: `4597` - // Minimum execution time: 34_000_000 picoseconds. - Weight::from_parts(35_000_000, 4597) + // Minimum execution time: 51_307_000 picoseconds. + Weight::from_parts(52_768_000, 4597) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1313,8 +1299,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1039` // Estimated: `4504` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 4504) + // Minimum execution time: 44_135_000 picoseconds. + Weight::from_parts(45_668_000, 4504) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1324,8 +1310,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_993_000 picoseconds. + Weight::from_parts(2_173_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::FlowNormExponent` (r:0 w:1) @@ -1334,8 +1320,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_083_000 picoseconds. + Weight::from_parts(2_204_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EmissionGateBar` (r:0 w:1) @@ -1346,7 +1332,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. + // Minimum execution time: 1_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1378,8 +1364,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_943_000 picoseconds. + Weight::from_parts(2_093_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetTaoFlowEnabled` (r:0 w:1) @@ -1388,8 +1374,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_952_000 picoseconds. + Weight::from_parts(2_073_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxMechanismCount` (r:0 w:1) @@ -1398,8 +1384,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_674_000 picoseconds. + Weight::from_parts(2_835_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::StartCallDelay` (r:0 w:1) @@ -1408,8 +1394,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 4_026_000 picoseconds. + Weight::from_parts(4_166_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -1434,8 +1420,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 4467) + // Minimum execution time: 41_282_000 picoseconds. + Weight::from_parts(42_653_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1461,62 +1447,22 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 4467) + // Minimum execution time: 41_972_000 picoseconds. + Weight::from_parts(42_884_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) - /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Tempo` (r:1 w:0) - /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) - /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) - /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) - /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralLockShare` (r:0 w:1) - /// Proof: `SubtensorModule::CollateralLockShare` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Same owner-hyperparameter guard path and single insert as + /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. fn sudo_set_collateral_lock_share() -> Weight { - // Proof Size summary in bytes: - // Measured: `1002` - // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 4467) + Weight::from_parts(42_884_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) - /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Tempo` (r:1 w:0) - /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) - /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) - /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) - /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralDrainRatio` (r:0 w:1) - /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Same owner-hyperparameter guard path and single insert as + /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. fn sudo_set_collateral_drain_ratio() -> Weight { - // Proof Size summary in bytes: - // Measured: `1002` - // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 4467) + Weight::from_parts(42_884_000, 4467) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1546,8 +1492,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4440) + // Minimum execution time: 31_937_000 picoseconds. + Weight::from_parts(32_729_000, 4440) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1569,8 +1515,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(24_000_000, 4440) + // Minimum execution time: 31_918_000 picoseconds. + Weight::from_parts(32_919_000, 4440) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1585,10 +1531,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_608_495, 0) - // Standard Error: 1_565 - .saturating_add(Weight::from_parts(15_303, 0).saturating_mul(a.into())) + // Minimum execution time: 4_007_000 picoseconds. + Weight::from_parts(4_721_714, 0) + // Standard Error: 732 + .saturating_add(Weight::from_parts(25_072, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -1613,8 +1559,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_330_000 picoseconds. + Weight::from_parts(5_691_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1631,8 +1577,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `747` // Estimated: `4212` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4212) + // Minimum execution time: 27_211_000 picoseconds. + Weight::from_parts(28_163_000, 4212) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1652,8 +1598,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(24_000_000, 4383) + // Minimum execution time: 32_972_000 picoseconds. + Weight::from_parts(34_014_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1673,8 +1619,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 32_831_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1686,8 +1632,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4084) + // Minimum execution time: 15_810_000 picoseconds. + Weight::from_parts(16_350_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1707,8 +1653,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 32_982_000 picoseconds. + Weight::from_parts(34_094_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1728,8 +1674,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 32_911_000 picoseconds. + Weight::from_parts(33_944_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1749,8 +1695,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_082_000 picoseconds. + Weight::from_parts(33_894_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1772,8 +1718,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 34_535_000 picoseconds. + Weight::from_parts(35_477_000, 4383) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1793,8 +1739,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 33_062_000 picoseconds. + Weight::from_parts(33_974_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1806,8 +1752,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4084) + // Minimum execution time: 16_090_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1827,8 +1773,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 33_452_000 picoseconds. + Weight::from_parts(34_194_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1850,8 +1796,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_753_000 picoseconds. + Weight::from_parts(34_805_000, 4383) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1861,8 +1807,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 6_993_000 picoseconds. + Weight::from_parts(7_354_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1881,8 +1827,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_000_000, 4383) + // Minimum execution time: 29_966_000 picoseconds. + Weight::from_parts(30_948_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1894,8 +1840,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 4084) + // Minimum execution time: 16_040_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1919,8 +1865,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4383) + // Minimum execution time: 35_977_000 picoseconds. + Weight::from_parts(37_299_000, 4383) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1946,8 +1892,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4433` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(28_000_000, 4433) + // Minimum execution time: 41_067_000 picoseconds. + Weight::from_parts(42_269_000, 4433) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1967,8 +1913,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 32_721_000 picoseconds. + Weight::from_parts(33_793_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1988,8 +1934,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 32_601_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2009,8 +1955,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4383) + // Minimum execution time: 33_112_000 picoseconds. + Weight::from_parts(33_784_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2032,8 +1978,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `945` // Estimated: `4410` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4410) + // Minimum execution time: 36_247_000 picoseconds. + Weight::from_parts(36_978_000, 4410) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2055,8 +2001,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `920` // Estimated: `4385` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4385) + // Minimum execution time: 35_867_000 picoseconds. + Weight::from_parts(37_510_000, 4385) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2066,8 +2012,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 6_752_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2088,8 +2034,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 4440) + // Minimum execution time: 45_966_000 picoseconds. + Weight::from_parts(47_038_000, 4440) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -2109,8 +2055,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_763_000 picoseconds. + Weight::from_parts(34_514_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2130,8 +2076,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4383) + // Minimum execution time: 33_242_000 picoseconds. + Weight::from_parts(33_914_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2141,8 +2087,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_971_000 picoseconds. + Weight::from_parts(6_352_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -2151,16 +2097,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_360_000 picoseconds. + Weight::from_parts(5_720_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn sudo_set_total_issuance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_790_000 picoseconds. + Weight::from_parts(6_021_000, 0) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2170,8 +2116,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4084) + // Minimum execution time: 15_869_000 picoseconds. + Weight::from_parts(16_370_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2181,8 +2127,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_661_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -2197,8 +2143,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `950` // Estimated: `6890` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 6890) + // Minimum execution time: 29_785_000 picoseconds. + Weight::from_parts(30_577_000, 6890) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2208,8 +2154,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_561_000 picoseconds. + Weight::from_parts(5_721_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -2218,8 +2164,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_410_000 picoseconds. + Weight::from_parts(5_671_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2242,8 +2188,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `954` // Estimated: `4419` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4419) + // Minimum execution time: 36_419_000 picoseconds. + Weight::from_parts(37_621_000, 4419) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2261,8 +2207,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4280) + // Minimum execution time: 24_436_000 picoseconds. + Weight::from_parts(25_598_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2282,8 +2228,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `962` // Estimated: `4427` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4427) + // Minimum execution time: 33_122_000 picoseconds. + Weight::from_parts(33_783_000, 4427) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2293,8 +2239,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_791_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -2303,8 +2249,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_760_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -2313,8 +2259,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_240_000 picoseconds. + Weight::from_parts(5_660_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2331,8 +2277,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4280) + // Minimum execution time: 27_180_000 picoseconds. + Weight::from_parts(28_282_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2342,8 +2288,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 3507) + // Minimum execution time: 6_051_000 picoseconds. + Weight::from_parts(6_202_000, 3507) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -2352,8 +2298,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_875_000 picoseconds. + Weight::from_parts(2_985_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -2362,8 +2308,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 3_877_000 picoseconds. + Weight::from_parts(4_238_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2382,8 +2328,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 4383) + // Minimum execution time: 29_776_000 picoseconds. + Weight::from_parts(30_897_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2401,8 +2347,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4280) + // Minimum execution time: 27_751_000 picoseconds. + Weight::from_parts(28_463_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2420,8 +2366,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 4280) + // Minimum execution time: 29_636_000 picoseconds. + Weight::from_parts(30_025_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2433,8 +2379,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 4084) + // Minimum execution time: 15_900_000 picoseconds. + Weight::from_parts(16_401_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2442,30 +2388,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:1) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) - /// 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::LockingColdkeys` (r:2 w:0) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_sn_owner_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `925` - // Estimated: `6865` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(41_000_000, 6865) - .saturating_add(RocksDbWeight::get().reads(9_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) + // Measured: `712` + // Estimated: `4177` + // Minimum execution time: 24_415_000 picoseconds. + Weight::from_parts(25_167_000, 4177) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2481,8 +2413,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 4280) + // Minimum execution time: 24_125_000 picoseconds. + Weight::from_parts(24_847_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2492,8 +2424,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 5_500_000 picoseconds. + Weight::from_parts(5_731_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -2502,8 +2434,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_600_000 picoseconds. + Weight::from_parts(5_831_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2520,8 +2452,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 4280) + // Minimum execution time: 24_045_000 picoseconds. + Weight::from_parts(24_967_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2545,8 +2477,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `933` // Estimated: `4398` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4398) + // Minimum execution time: 36_298_000 picoseconds. + Weight::from_parts(37_260_000, 4398) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2556,8 +2488,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 6_904_000 picoseconds. + Weight::from_parts(7_203_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxEpochsPerBlock` (r:0 w:1) @@ -2566,8 +2498,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_460_000 picoseconds. + Weight::from_parts(5_740_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2592,8 +2524,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 4467) + // Minimum execution time: 41_231_000 picoseconds. + Weight::from_parts(42_292_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2601,8 +2533,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_692_000 picoseconds. + Weight::from_parts(1_913_000, 0) } /// Storage: `SubtensorModule::SubnetOwnerCut` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwnerCut` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -2610,8 +2542,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_996_000 picoseconds. + Weight::from_parts(4_416_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkRateLimit` (r:0 w:1) @@ -2620,8 +2552,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_996_000 picoseconds. + Weight::from_parts(4_267_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkImmunityPeriod` (r:0 w:1) @@ -2630,8 +2562,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_996_000 picoseconds. + Weight::from_parts(4_347_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkMinLockCost` (r:0 w:1) @@ -2640,8 +2572,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_896_000 picoseconds. + Weight::from_parts(4_166_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetLimit` (r:0 w:1) @@ -2650,8 +2582,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_896_000 picoseconds. + Weight::from_parts(4_246_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworkLockReductionInterval` (r:0 w:1) @@ -2660,8 +2592,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 3_925_000 picoseconds. + Weight::from_parts(4_257_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `EVMChainId::ChainId` (r:0 w:1) @@ -2670,8 +2602,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_655_000 picoseconds. + Weight::from_parts(2_875_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2694,8 +2626,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4364) + // Minimum execution time: 32_888_000 picoseconds. + Weight::from_parts(33_720_000, 4364) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2705,8 +2637,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_903_000 picoseconds. + Weight::from_parts(2_083_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2735,8 +2667,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1132` // Estimated: `4597` - // Minimum execution time: 34_000_000 picoseconds. - Weight::from_parts(35_000_000, 4597) + // Minimum execution time: 51_307_000 picoseconds. + Weight::from_parts(52_768_000, 4597) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -2762,8 +2694,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1039` // Estimated: `4504` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 4504) + // Minimum execution time: 44_135_000 picoseconds. + Weight::from_parts(45_668_000, 4504) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2773,8 +2705,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_993_000 picoseconds. + Weight::from_parts(2_173_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::FlowNormExponent` (r:0 w:1) @@ -2783,8 +2715,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_083_000 picoseconds. + Weight::from_parts(2_204_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EmissionGateBar` (r:0 w:1) @@ -2795,7 +2727,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. + // Minimum execution time: 1_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2827,8 +2759,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_943_000 picoseconds. + Weight::from_parts(2_093_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetTaoFlowEnabled` (r:0 w:1) @@ -2837,8 +2769,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 1_952_000 picoseconds. + Weight::from_parts(2_073_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxMechanismCount` (r:0 w:1) @@ -2847,8 +2779,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Minimum execution time: 2_674_000 picoseconds. + Weight::from_parts(2_835_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::StartCallDelay` (r:0 w:1) @@ -2857,8 +2789,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 4_026_000 picoseconds. + Weight::from_parts(4_166_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) @@ -2883,8 +2815,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(30_000_000, 4467) + // Minimum execution time: 41_282_000 picoseconds. + Weight::from_parts(42_653_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2910,62 +2842,22 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1002` // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 4467) + // Minimum execution time: 41_972_000 picoseconds. + Weight::from_parts(42_884_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) - /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Tempo` (r:1 w:0) - /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) - /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) - /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) - /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralLockShare` (r:0 w:1) - /// Proof: `SubtensorModule::CollateralLockShare` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Same owner-hyperparameter guard path and single insert as + /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. fn sudo_set_collateral_lock_share() -> Weight { - // Proof Size summary in bytes: - // Measured: `1002` - // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 4467) + Weight::from_parts(42_884_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) - /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Tempo` (r:1 w:0) - /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) - /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) - /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) - /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `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::CollateralDrainRatio` (r:0 w:1) - /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Same owner-hyperparameter guard path and single insert as + /// `sudo_set_burn_increase_mult`; estimate reused pending a measured run. fn sudo_set_collateral_drain_ratio() -> Weight { - // Proof Size summary in bytes: - // Measured: `1002` - // Estimated: `4467` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 4467) + Weight::from_parts(42_884_000, 4467) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2995,8 +2887,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 4440) + // Minimum execution time: 31_937_000 picoseconds. + Weight::from_parts(32_729_000, 4440) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3018,8 +2910,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `975` // Estimated: `4440` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(24_000_000, 4440) + // Minimum execution time: 31_918_000 picoseconds. + Weight::from_parts(32_919_000, 4440) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/subtensor/src/benchmarks/benchmarks.rs b/pallets/subtensor/src/benchmarks/benchmarks.rs index b0b0a84fb4..0c137a6363 100644 --- a/pallets/subtensor/src/benchmarks/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks/benchmarks.rs @@ -1973,54 +1973,6 @@ mod pallet_benchmarks { assert!(!AccumulatedLeaseDividends::::contains_key(lease_id)); } - #[benchmark] - fn transition_subnet_owner_locks(l: Linear<1, 128>) { - let netuid = NetUid::from(1); - let old_owner_hotkey = account::("old_owner", 0, 0); - let new_owner_hotkey = account::("new_owner", 0, 0); - let benchmark_block: BlockNumberFor = 100u32.into(); - - Subtensor::::init_new_network(netuid, 1); - SubnetOwnerHotkey::::insert(netuid, &old_owner_hotkey); - UnlockRate::::put(1); - MaturityRate::::put(1); - frame_system::Pallet::::set_block_number(benchmark_block); - - for i in 0..l { - let coldkey = account::("locker", i, 0); - let hotkey = if i % 2 == 0 { - &old_owner_hotkey - } else { - &new_owner_hotkey - }; - Subtensor::::insert_lock_state( - &coldkey, - netuid, - hotkey, - LockState { - locked_mass: 1_000u64.into(), - conviction: U64F64::from_num(1_000), - last_update: 0, - }, - ); - } - - #[block] - { - let transitioned = Subtensor::::transition_subnet_owner_lock_aggregates( - netuid, - &old_owner_hotkey, - &new_owner_hotkey, - ); - assert_eq!(transitioned, l); - } - - assert_eq!( - Subtensor::::owner_transition_member_count(netuid, &new_owner_hotkey), - 0 - ); - } - #[benchmark] fn update_symbol() { let coldkey: T::AccountId = whitelisted_caller(); diff --git a/pallets/subtensor/src/coinbase/block_step.rs b/pallets/subtensor/src/coinbase/block_step.rs index eee6511ae9..db3f9c842c 100644 --- a/pallets/subtensor/src/coinbase/block_step.rs +++ b/pallets/subtensor/src/coinbase/block_step.rs @@ -1,11 +1,10 @@ use super::*; -use frame_support::weights::Weight; use substrate_fixed::types::U96F32; use subtensor_runtime_common::NetUid; impl Pallet { /// Executes the necessary operations for each block. - pub fn block_step() -> Result { + pub fn block_step() -> Result<(), &'static str> { let block_number: u64 = Self::get_current_block_as_u64(); // --- 1. Update registration burn prices. @@ -18,7 +17,7 @@ impl Pallet { // --- 3. Reveal matured weights. Self::reveal_crv3_commits(); // --- 4. Run emission through network. - let owner_transition_weight = Self::run_coinbase(block_emission); + Self::run_coinbase(block_emission); // --- 4b. Flush queued root-dividend basket deposits: one hotkey per block, // round-robin. Runs right after coinbase (and before the price EMA update) so a // flush lands where the epoch-inline deposits used to happen. @@ -40,7 +39,7 @@ impl Pallet { } // Return ok. - Ok(owner_transition_weight) + Ok(()) } fn try_set_pending_children(block_number: u64) { diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 0dc5588b4a..2e00ba3b55 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -2,7 +2,6 @@ use super::*; use crate::coinbase::tao::CreditOf; use alloc::collections::{BTreeMap, BTreeSet}; use frame_support::traits::Imbalance; -use frame_support::weights::Weight; use safe_math::*; use substrate_fixed::types::{U64F64, U96F32}; use subtensor_runtime_common::{AlphaBalance, NetUid, TaoBalance, Token}; @@ -22,7 +21,7 @@ macro_rules! tou64 { } impl Pallet { - pub fn run_coinbase(block_emission_credit: CreditOf) -> Weight { + pub fn run_coinbase(block_emission_credit: CreditOf) { // --- 0. Get current block. let current_block: u64 = Self::get_current_block_as_u64(); let block_emission = U96F32::saturating_from_num(block_emission_credit.peek()); @@ -62,13 +61,10 @@ impl Pallet { ); // --- 5. Drain pending emissions. - let (emissions_to_distribute, owner_transition_weight) = - Self::drain_pending_with_weight(&subnets, current_block); + let emissions_to_distribute = Self::drain_pending(&subnets, current_block); // --- 6. Distribute the emissions to the subnets. Self::distribute_emissions_to_subnets(&emissions_to_distribute); - - owner_transition_weight } pub fn inject_and_maybe_swap( @@ -384,22 +380,11 @@ impl Pallet { subnets: &[NetUid], current_block: u64, ) -> BTreeMap { - Self::drain_pending_with_weight(subnets, current_block).0 - } - - fn drain_pending_with_weight( - subnets: &[NetUid], - current_block: u64, - ) -> ( - BTreeMap, - Weight, - ) { // Map of netuid to (pending_server_alpha, pending_validator_alpha, pending_root_alpha, pending_owner_cut). let mut emissions_to_distribute: BTreeMap< NetUid, (AlphaBalance, AlphaBalance, AlphaBalance, AlphaBalance), > = BTreeMap::new(); - let mut owner_transition_weight = Weight::zero(); // Per-block cap on number of epochs that may run; the rest are deferred 1 block forward // by setting `PendingEpochAt`. let max_epochs_per_block = Self::get_max_epochs_per_block() as u32; @@ -467,8 +452,7 @@ impl Pallet { epochs_run_this_block = epochs_run_this_block.saturating_add(1); // Change subnet owner based on conviction. - owner_transition_weight - .saturating_accrue(Self::change_subnet_owner_if_needed(netuid)); + Self::change_subnet_owner_if_needed(netuid); } else { // Schedule advances below; execution skipped. Pending emissions accumulate // and will be drained by the next successful epoch. @@ -483,7 +467,7 @@ impl Pallet { PendingEpochAt::::insert(netuid, 0); SubnetEpochIndex::::mutate(netuid, |idx| *idx = idx.saturating_add(1)); } - (emissions_to_distribute, owner_transition_weight) + emissions_to_distribute } pub fn distribute_emissions_to_subnets( diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index ce10acf869..06cab7436f 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -1762,18 +1762,7 @@ mod dispatches { /// /// * `hotkey`: The hotkey of the beneficiary to mark as subnet owner hotkey. #[pallet::call_index(111)] - #[pallet::weight({ - let member_count = - Pallet::::lease_owner_transition_member_count(*lease_id, hotkey); - ::WeightInfo::terminate_lease(T::MaxContributors::get()) - .saturating_add( - ::WeightInfo::transition_subnet_owner_locks( - member_count, - ).saturating_add( - Pallet::::lease_owner_transition_member_count_weight(member_count), - ), - ) - })] + #[pallet::weight(::WeightInfo::terminate_lease(T::MaxContributors::get()))] pub fn terminate_lease( origin: OriginFor, lease_id: LeaseId, diff --git a/pallets/subtensor/src/macros/hooks.rs b/pallets/subtensor/src/macros/hooks.rs index cf850d6f27..21083cee07 100644 --- a/pallets/subtensor/src/macros/hooks.rs +++ b/pallets/subtensor/src/macros/hooks.rs @@ -23,12 +23,11 @@ mod hooks { // queue drained), charging its bounded page into the hook weight. let beta_index_sweep_weight = Self::advance_beta_index_sweep_weight(); match block_step_result { - Ok(owner_transition_weight) => { + Ok(_) => { // --- If the block step was successful, return the weight. log::debug!("Successfully ran block step."); <::WeightInfo as crate::weights::WeightInfo>::block_step() .saturating_add(hotkey_swap_clean_up_weight) - .saturating_add(owner_transition_weight) .saturating_add(beta_index_sweep_weight) } Err(e) => { @@ -181,8 +180,6 @@ mod hooks { .saturating_add(migrations::migrate_tao_in_refund_deployment_block::migrate_tao_in_refund_deployment_block::()) // Fix lock state left behind by subnet-scoped hotkey swaps. .saturating_add(migrations::migrate_fix_subnet_hotkey_lock_swaps::migrate_fix_subnet_hotkey_lock_swaps::()) - // Rebuild conviction aggregates after every migration that can rewrite lock rows. - .saturating_add(migrations::migrate_rebuild_conviction_aggregates::migrate_rebuild_conviction_aggregates::()) // Populate reverse lookup index for EVM address associations. .saturating_add(migrations::migrate_associated_evm_address_index::migrate_associated_evm_address_index::()) // Fold deprecated SubnetTaoProvided / SubnetAlphaInProvided residuals into the diff --git a/pallets/subtensor/src/staking/lock.rs b/pallets/subtensor/src/staking/lock.rs index 6372486bad..95d6b589b1 100644 --- a/pallets/subtensor/src/staking/lock.rs +++ b/pallets/subtensor/src/staking/lock.rs @@ -1,8 +1,6 @@ use super::*; -use crate::subnets::leasing::LeaseId; -use crate::weights::WeightInfo; use codec::{Decode, DecodeWithMemTracking, Encode}; -use frame_support::weights::{Weight, WeightMeter}; +use frame_support::weights::WeightMeter; use pallet_alpha_assets::AlphaAssetsInterface; use safe_math::FixedExt; use scale_info::TypeInfo; @@ -611,51 +609,6 @@ impl Pallet { let _ = LockingColdkeys::::take((netuid, hotkey, coldkey)); } - /// Number of indexed individual locks touched by an ownership transition. - /// - /// REVIEW NOTE: This scan is intentionally unbounded. Ownership transitions are - /// exceptionally rare (expected only a few times per year), and the mainnet scan - /// performed for the conviction migration found at most 44 lock rows on one subnet. - /// Reviewers should not request a maintained counter or staged transition solely - /// because this iterator is unbounded; the deliberate tradeoff is to charge the - /// complete member-scaled work instead of adding permanent storage bookkeeping. - pub fn owner_transition_member_count(netuid: NetUid, new_owner_hotkey: &T::AccountId) -> u32 { - let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); - let old_owner_members = LockingColdkeys::::iter_prefix((netuid, &old_owner_hotkey)) - .fold(0u32, |count, _| count.saturating_add(1)); - - if &old_owner_hotkey == new_owner_hotkey { - return old_owner_members; - } - - LockingColdkeys::::iter_prefix((netuid, new_owner_hotkey)) - .fold(old_owner_members, |count, _| count.saturating_add(1)) - } - - /// Database cost of looking up an ownership transition's member count before dispatch. - pub fn owner_transition_member_count_weight(member_count: u32) -> Weight { - // One SubnetOwnerHotkey read, one read per indexed member, and one terminal - // read for each of the two LockingColdkeys prefix iterators. This slightly - // overcharges the no-op same-hotkey case, which only runs one iterator. - T::DbWeight::get().reads(u64::from(member_count).saturating_add(3)) - } - - /// Number of indexed individual locks touched when terminating a lease. - pub fn lease_owner_transition_member_count( - lease_id: LeaseId, - new_owner_hotkey: &T::AccountId, - ) -> u32 { - SubnetLeases::::get(lease_id) - .map(|lease| Self::owner_transition_member_count(lease.netuid, new_owner_hotkey)) - .unwrap_or(0) - } - - /// Database cost of looking up a lease ownership transition's member count before dispatch. - pub fn lease_owner_transition_member_count_weight(member_count: u32) -> Weight { - // SubnetLeases plus the ordinary ownership-transition count lookup. - T::DbWeight::get().reads(u64::from(member_count).saturating_add(4)) - } - pub fn account_rejects_locked_alpha(coldkey: &T::AccountId) -> bool { AccountFlags::::get(coldkey) & crate::ACCOUNT_FLAGS_ACCEPT_LOCKED_ALPHA != 1 } @@ -1252,14 +1205,10 @@ impl Pallet { now: u64, unlock_rate: u64, maturity_rate: u64, - ) -> u32 { - // Intentionally unbounded: ownership changes are rare, and the full - // member-scaled work is charged. See owner_transition_member_count for - // the operational rationale and observed mainnet size. + ) { let coldkeys: Vec = LockingColdkeys::::iter_prefix((netuid, hotkey)) .map(|(coldkey, ())| coldkey) .collect(); - let mut transitioned = 0u32; for coldkey in coldkeys { if !Lock::::contains_key((&coldkey, netuid, hotkey)) { @@ -1291,11 +1240,7 @@ impl Pallet { destination.roll_forward(now, unlock_rate, maturity_rate); destination.merge(&contribution); Self::save_conviction_model(&coldkey, netuid, hotkey, destination); - - transitioned = transitioned.saturating_add(1); } - - transitioned } /// Reclassify canonical individual locks and their aggregate buckets when a @@ -1309,15 +1254,15 @@ impl Pallet { netuid: NetUid, old_owner_hotkey: &T::AccountId, new_owner_hotkey: &T::AccountId, - ) -> u32 { + ) { let now = Self::get_current_block_as_u64(); let unlock_rate = UnlockRate::::get(); let maturity_rate = MaturityRate::::get(); if old_owner_hotkey == new_owner_hotkey { - return 0; + return; } - let demoted = Self::transition_hotkey_lock_owner_class( + Self::transition_hotkey_lock_owner_class( netuid, old_owner_hotkey, true, @@ -1326,7 +1271,7 @@ impl Pallet { unlock_rate, maturity_rate, ); - let promoted = Self::transition_hotkey_lock_owner_class( + Self::transition_hotkey_lock_owner_class( netuid, new_owner_hotkey, false, @@ -1335,8 +1280,6 @@ impl Pallet { unlock_rate, maturity_rate, ); - - demoted.saturating_add(promoted) } /// Reassigns subnet ownership to the current lock-conviction leader when the subnet @@ -1356,7 +1299,7 @@ impl Pallet { /// incumbent owner included) supply a challenger's quorum. Gating on the winner's own /// conviction closes that path. Coalitions are unaffected: backers lock to the /// challenger's hotkey, so their conviction lands in that hotkey's aggregate. - pub fn change_subnet_owner_if_needed(netuid: NetUid) -> Weight { + pub fn change_subnet_owner_if_needed(netuid: NetUid) { // Protocol-owned and burned alpha cannot support a challenger, so exclude both // from the ownership threshold. Saturation keeps inconsistent accounting from // wrapping the threshold to a very large value. @@ -1364,20 +1307,20 @@ impl Pallet { .saturating_sub(SubnetProtocolAlpha::::get(netuid)) .saturating_sub(T::AlphaAssets::alpha_burned(netuid)); if eligible_alpha.is_zero() { - return Weight::zero(); + return; } // Ownership can only be reassigned after the subnet has aged for one year. let now = Self::get_current_block_as_u64(); let registered_at = NetworkRegisteredAt::::get(netuid); if now < registered_at.saturating_add(ONE_YEAR) { - return Weight::zero(); + return; } // Pick the hotkey with the highest rolled aggregate conviction, keeping the // score that selection already computed. let Some((king_hotkey, king_conviction)) = Self::subnet_king_with_conviction(netuid) else { - return Weight::zero(); + return; }; // Require that hotkey's own rolled aggregate conviction to be more than 18% of @@ -1396,19 +1339,19 @@ impl Pallet { .saturating_mul(sp_core::U256::from(18u64)) .saturating_mul(one); if lhs <= rhs { - return Weight::zero(); + return; } // The king hotkey must resolve to a real coldkey owner. let new_owner_coldkey = Self::get_owning_coldkey_for_hotkey(&king_hotkey); if new_owner_coldkey == DefaultAccount::::get() { - return Weight::zero(); + return; } // If the winning hotkey already belongs to the current owner, nothing changes. let current_owner_coldkey = SubnetOwner::::get(netuid); if new_owner_coldkey == current_owner_coldkey { - return Weight::zero(); + return; } let old_owner_hotkey = SubnetOwnerHotkey::::get(netuid); @@ -1416,11 +1359,10 @@ impl Pallet { if Self::get_uid_for_net_and_hotkey(netuid, &king_hotkey).is_err() && Self::register_neuron(netuid, &king_hotkey).is_err() { - return Weight::zero(); + return; } - let transitioned_members = - Self::transition_subnet_owner_lock_aggregates(netuid, &old_owner_hotkey, &king_hotkey); + Self::transition_subnet_owner_lock_aggregates(netuid, &old_owner_hotkey, &king_hotkey); // Reassign subnet owner coldkey and owner hotkey. SubnetOwner::::insert(netuid, new_owner_coldkey.clone()); @@ -1431,8 +1373,6 @@ impl Pallet { old_coldkey: current_owner_coldkey, new_coldkey: new_owner_coldkey, }); - - ::WeightInfo::transition_subnet_owner_locks(transitioned_members) } /// Ensure the coldkey does not have an active lock on any subnets. diff --git a/pallets/subtensor/src/subnets/leasing.rs b/pallets/subtensor/src/subnets/leasing.rs index 38e816b726..a462e4b895 100644 --- a/pallets/subtensor/src/subnets/leasing.rs +++ b/pallets/subtensor/src/subnets/leasing.rs @@ -207,8 +207,7 @@ impl Pallet { Error::::CannotUseSystemAccount ); let old_owner_hotkey = SubnetOwnerHotkey::::get(lease.netuid); - let transitioned_members = - Self::transition_subnet_owner_lock_aggregates(lease.netuid, &old_owner_hotkey, &hotkey); + Self::transition_subnet_owner_lock_aggregates(lease.netuid, &old_owner_hotkey, &hotkey); SubnetOwner::::insert(lease.netuid, lease.beneficiary.clone()); Self::set_subnet_owner_hotkey(lease.netuid, &hotkey)?; @@ -233,14 +232,14 @@ impl Pallet { // Lease shares exclude the beneficiary, while the benchmark's `k` includes them. let contributors_count = clear_result.unique.saturating_add(1); - let actual_weight = ::WeightInfo::terminate_lease(contributors_count) - .saturating_add(::WeightInfo::transition_subnet_owner_locks( - transitioned_members, + if contributors_count < T::MaxContributors::get() { + Ok(Some(::WeightInfo::terminate_lease( + contributors_count, )) - .saturating_add(Self::lease_owner_transition_member_count_weight( - transitioned_members, - )); - Ok(Some(actual_weight).into()) + .into()) + } else { + Ok(().into()) + } } /// Hook used when the subnet owner's cut is distributed to split the amount into dividends diff --git a/pallets/subtensor/src/tests/leasing.rs b/pallets/subtensor/src/tests/leasing.rs index 172ce86325..3ade72b37a 100644 --- a/pallets/subtensor/src/tests/leasing.rs +++ b/pallets/subtensor/src/tests/leasing.rs @@ -301,10 +301,6 @@ fn test_terminate_lease_works() { <::WeightInfo as crate::weights::WeightInfo>::terminate_lease( contributors_count, ) - .saturating_add( - <::WeightInfo as crate::weights::WeightInfo>::transition_subnet_owner_locks(0), - ) - .saturating_add(SubtensorModule::lease_owner_transition_member_count_weight(0)), ) ); diff --git a/pallets/subtensor/src/tests/locks.rs b/pallets/subtensor/src/tests/locks.rs index 31d379dfbd..e41cc948d9 100644 --- a/pallets/subtensor/src/tests/locks.rs +++ b/pallets/subtensor/src/tests/locks.rs @@ -3411,32 +3411,14 @@ fn test_run_coinbase_reassigns_subnet_owner_by_conviction_on_epoch() { assert_eq!(SubnetOwner::::get(netuid), old_owner_coldkey); assert_eq!(SubnetOwnerHotkey::::get(netuid), old_owner_hotkey); - let owner_transition_weight = - SubtensorModule::run_coinbase(SubtensorModule::mint_tao(0.into())); + SubtensorModule::run_coinbase(SubtensorModule::mint_tao(0.into())); assert_eq!(SubnetOwner::::get(netuid), new_owner_coldkey); assert_eq!(SubnetOwnerHotkey::::get(netuid), king_hotkey); assert_eq!(LastEpochBlock::::get(netuid), now); - assert_eq!( - owner_transition_weight, - <::WeightInfo as crate::weights::WeightInfo>::transition_subnet_owner_locks(1), - ); }); } -#[test] -fn test_owner_transition_count_lookup_weight_scales_with_members() { - let member_count = 7; - assert_eq!( - SubtensorModule::owner_transition_member_count_weight(member_count), - ::DbWeight::get().reads(u64::from(member_count) + 3), - ); - assert_eq!( - SubtensorModule::lease_owner_transition_member_count_weight(member_count), - ::DbWeight::get().reads(u64::from(member_count) + 4), - ); -} - #[test] fn test_change_subnet_owner_rebuilds_old_owner_hotkey_by_lock_mode() { new_test_ext(1).execute_with(|| { @@ -3637,13 +3619,12 @@ fn test_decaying_owner_is_rolled_as_owner_before_demotion() { let expected = roll_lock_state(lock, now, unlock_rate, maturity_rate, true, false); - let transitioned = SubtensorModule::transition_subnet_owner_lock_aggregates( + SubtensorModule::transition_subnet_owner_lock_aggregates( netuid, &old_owner_hotkey, &new_owner_hotkey, ); - assert_eq!(transitioned, 1); assert_eq!( Lock::::get((coldkey, netuid, old_owner_hotkey)), Some(expected.clone()) diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index df4abdcaaf..e65583c2b1 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2,16 +2,16 @@ //! Autogenerated weights for `pallet_subtensor` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Grigoris-MBP.lan`, CPU: `` +//! HOSTNAME: `moncks-MacBook-Pro-5.local`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// /Users/grigorizaitsev/development/subtensor/target/production/node-subtensor +// /Users/const/everything/subtensor/target/production/node-subtensor // benchmark // pallet -// --runtime=/Users/grigorizaitsev/development/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm +// --runtime=/Users/const/everything/subtensor/target/production/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm // --genesis-builder=runtime // --genesis-builder-preset=benchmark // --wasm-execution=compiled @@ -22,8 +22,8 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/Users/grigorizaitsev/development/subtensor/pallets/subtensor/src/weights.rs -// --template=/Users/grigorizaitsev/development/subtensor/.maintain/frame-weight-template.hbs +// --output=/Users/const/everything/subtensor/pallets/subtensor/src/weights.rs +// --template=/Users/const/everything/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -85,12 +85,13 @@ pub trait WeightInfo { fn remove_stake_full_limit() -> Weight; fn register_leased_network(k: u32, ) -> Weight; fn terminate_lease(k: u32, ) -> Weight; - fn transition_subnet_owner_locks(l: u32, ) -> Weight; fn update_symbol() -> Weight; fn commit_timelocked_weights() -> Weight; fn set_coldkey_auto_stake_hotkey() -> Weight; + fn set_root_claim_type() -> Weight; fn claim_root(h: u32, ) -> Weight; fn claim_root_scan(h: u32, ) -> Weight; + fn sudo_set_num_root_claims() -> Weight; fn sudo_set_root_claim_threshold() -> Weight; fn set_auto_parent_delegation_enabled() -> Weight; fn add_stake_burn() -> Weight; @@ -228,8 +229,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:0 w:1) @@ -238,10 +237,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `289875` // Estimated: `926940` - // Minimum execution time: 2_950_000_000 picoseconds. - Weight::from_parts(3_170_000_000, 926940) - .saturating_add(T::DbWeight::get().reads(814_u64)) - .saturating_add(T::DbWeight::get().writes(294_u64)) + // Minimum execution time: 2_761_000_000 picoseconds. + Weight::from_parts(364_683_000, 6148) + .saturating_add(T::DbWeight::get().reads(34_u64)) + .saturating_add(T::DbWeight::get().writes(29_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) /// Proof: `SubtensorModule::CommitRevealWeightsEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -281,8 +280,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `188820` // Estimated: `10327410` - // Minimum execution time: 7_042_000_000 picoseconds. - Weight::from_parts(7_349_000_000, 10327410) + // Minimum execution time: 7_637_000_000 picoseconds. + Weight::from_parts(8_632_000_000, 10327410) .saturating_add(T::DbWeight::get().reads(4112_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -294,12 +293,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:3 w:3) @@ -344,16 +343,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2319` + // Measured: `2304` // Estimated: `8727` - // Minimum execution time: 261_000_000 picoseconds. - Weight::from_parts(273_000_000, 8727) - .saturating_add(T::DbWeight::get().reads(33_u64)) - .saturating_add(T::DbWeight::get().writes(14_u64)) + // Minimum execution time: 301_000_000 picoseconds. + Weight::from_parts(310_000_000, 8727) + .saturating_add(T::DbWeight::get().reads(32_u64)) + .saturating_add(T::DbWeight::get().writes(16_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -367,8 +368,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4293) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4293) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -384,8 +385,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4392` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(22_000_000, 4392) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4392) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -435,12 +436,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapBalancer` (r:1 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -463,8 +462,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -509,18 +506,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) + /// Storage: `Swap::SwapBalancer` (r:0 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn burned_register() -> Weight { // Proof Size summary in bytes: // Measured: `289277` // Estimated: `926342` - // Minimum execution time: 2_979_000_000 picoseconds. - Weight::from_parts(3_072_000_000, 926342) - .saturating_add(T::DbWeight::get().reads(825_u64)) - .saturating_add(T::DbWeight::get().writes(299_u64)) + // Minimum execution time: 2_807_000_000 picoseconds. + Weight::from_parts(365_124_000, 6148) + .saturating_add(T::DbWeight::get().reads(34_u64)) + .saturating_add(T::DbWeight::get().writes(29_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -532,13 +531,13 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::RegistrationsThisInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TargetRegistrationsPerInterval` (r:1 w:0) /// Proof: `SubtensorModule::TargetRegistrationsPerInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:2 w:2) + /// Storage: `SubtensorModule::Uids` (r:1 w:2) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetworkN` (r:1 w:0) /// Proof: `SubtensorModule::SubnetworkN` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -546,30 +545,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:65 w:1) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:64 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:65 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Burn` (r:1 w:1) - /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:1 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BurnIncreaseMult` (r:1 w:0) - /// Proof: `SubtensorModule::BurnIncreaseMult` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinBurn` (r:1 w:0) - /// Proof: `SubtensorModule::MinBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MaxBurn` (r:1 w:0) - /// Proof: `SubtensorModule::MaxBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AssociatedEvmAddress` (r:1 w:0) /// Proof: `SubtensorModule::AssociatedEvmAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:1 w:1) @@ -606,18 +585,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_register() -> Weight { // Proof Size summary in bytes: - // Measured: `46222` - // Estimated: `208087` - // Minimum execution time: 633_000_000 picoseconds. - Weight::from_parts(672_000_000, 208087) - .saturating_add(T::DbWeight::get().reads(229_u64)) - .saturating_add(T::DbWeight::get().writes(94_u64)) + // Measured: `29210` + // Estimated: `191075` + // Minimum execution time: 566_000_000 picoseconds. + Weight::from_parts(621_000_000, 191075) + .saturating_add(T::DbWeight::get().reads(219_u64)) + .saturating_add(T::DbWeight::get().writes(88_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -729,8 +706,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -739,10 +714,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1532` // Estimated: `9947` - // Minimum execution time: 168_000_000 picoseconds. - Weight::from_parts(186_000_000, 9947) - .saturating_add(T::DbWeight::get().reads(41_u64)) - .saturating_add(T::DbWeight::get().writes(49_u64)) + // Minimum execution time: 145_000_000 picoseconds. + Weight::from_parts(153_000_000, 9947) + .saturating_add(T::DbWeight::get().reads(42_u64)) + .saturating_add(T::DbWeight::get().writes(48_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -774,8 +749,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1249` // Estimated: `4714` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(42_000_000, 4714) + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(36_000_000, 4714) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -821,8 +796,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 66_000_000 picoseconds. - Weight::from_parts(71_000_000, 7590) + // Minimum execution time: 56_000_000 picoseconds. + Weight::from_parts(58_000_000, 7590) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -832,8 +807,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -856,8 +831,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1033` // Estimated: `4498` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(34_000_000, 4498) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 4498) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -873,17 +848,13 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 4159) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4159) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -908,18 +879,8 @@ 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::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -932,27 +893,21 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) - /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey_announced() -> Weight { + // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral + // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `8414` - // Estimated: `167804` - // Minimum execution time: 883_000_000 picoseconds. - Weight::from_parts(921_000_000, 167804) - .saturating_add(T::DbWeight::get().reads(114_u64)) - .saturating_add(T::DbWeight::get().writes(87_u64)) + // Measured: `2110` + // Estimated: `100000` + // Minimum execution time: 450_000_000 picoseconds. + Weight::from_parts(450_000_000, 100000) + .saturating_add(T::DbWeight::get().reads(250_u64)) + .saturating_add(T::DbWeight::get().writes(200_u64)) } /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -977,18 +932,8 @@ 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::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -999,22 +944,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::DecayingLock` (r:1 w:0) /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapDisputes` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapDisputes` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) - /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey() -> Weight { + // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral + // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `8417` - // Estimated: `167807` - // Minimum execution time: 911_000_000 picoseconds. - Weight::from_parts(951_000_000, 167807) - .saturating_add(T::DbWeight::get().reads(114_u64)) - .saturating_add(T::DbWeight::get().writes(91_u64)) + // Measured: `2166` + // Estimated: `100000` + // Minimum execution time: 480_000_000 picoseconds. + Weight::from_parts(480_000_000, 100000) + .saturating_add(T::DbWeight::get().reads(250_u64)) + .saturating_add(T::DbWeight::get().writes(210_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1024,8 +967,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 4130) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 4130) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1037,8 +980,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4078) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 4078) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1050,8 +993,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -1096,8 +1039,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2155` // Estimated: `8095` - // Minimum execution time: 233_000_000 picoseconds. - Weight::from_parts(247_000_000, 8095) + // Minimum execution time: 209_000_000 picoseconds. + Weight::from_parts(218_000_000, 8095) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1135,8 +1078,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 106_000_000 picoseconds. - Weight::from_parts(110_000_000, 5219) + // Minimum execution time: 94_000_000 picoseconds. + Weight::from_parts(98_000_000, 5219) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -1172,11 +1115,13 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 104_000_000 picoseconds. - Weight::from_parts(109_000_000, 5219) + // Minimum execution time: 92_000_000 picoseconds. + Weight::from_parts(102_000_000, 5219) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } + /// Storage: `System::ParentHash` (r:1 w:0) + /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:130 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:129 w:129) @@ -1221,12 +1166,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerBurned` (r:128 w:2) /// Proof: `SubtensorModule::MinerBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::EmissionGateBar` (r:1 w:1) - /// Proof: `SubtensorModule::EmissionGateBar` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::EmissionBarRank` (r:1 w:0) - /// Proof: `SubtensorModule::EmissionBarRank` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::EmissionGateExponent` (r:1 w:0) - /// Proof: `SubtensorModule::EmissionGateExponent` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetEmissionEnabled` (r:128 w:0) /// Proof: `SubtensorModule::SubnetEmissionEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:128 w:127) @@ -1277,7 +1216,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastUpdate` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::BlockAtRegistration` (r:512 w:0) /// Proof: `SubtensorModule::BlockAtRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:512) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ParentKeys` (r:512 w:0) /// Proof: `SubtensorModule::ParentKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1323,36 +1262,42 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MinChildkeyTakePerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:512 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:512 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:2 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:0) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:512 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:2 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketFlushCursor` (r:1 w:1) - /// Proof: `SubtensorModule::PendingBasketFlushCursor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:513 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:542 w:512) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:512 w:512) + /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:512 w:512) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootAlphaDividendsPerSubnet` (r:512 w:512) + /// Proof: `SubtensorModule::RootAlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:128 w:0) /// Proof: `SubtensorModule::EMAPriceHalvingBlocks` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:1 w:0) /// Proof: `SubtensorModule::SubnetMovingAlpha` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::PendingChildKeys` (r:129 w:0) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:0) + /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NumRootClaim` (r:1 w:0) + /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:1 w:0) + /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaMapLastKey` (r:1 w:0) /// Proof: `SubtensorModule::AlphaMapLastKey` (`max_values`: Some(1), `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::AlphaV2MapLastKey` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2MapLastKey` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:31 w:0) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootProp` (r:0 w:128) /// Proof: `SubtensorModule::RootProp` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:0 w:2) @@ -1383,12 +1328,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoInEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) fn block_step() -> Weight { // Proof Size summary in bytes: - // Measured: `35120583` - // Estimated: `37655973` - // Minimum execution time: 49_851_000_000 picoseconds. - Weight::from_parts(53_672_000_000, 37655973) - .saturating_add(T::DbWeight::get().reads(10347_u64)) - .saturating_add(T::DbWeight::get().writes(3994_u64)) + // Measured: `35625441` + // Estimated: `38160831` + // Minimum execution time: 74_108_000_000 picoseconds. + Weight::from_parts(80_064_000_000, 38160831) + .saturating_add(T::DbWeight::get().reads(13414_u64)) + .saturating_add(T::DbWeight::get().writes(7064_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1406,8 +1351,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(27_000_000, 4583) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 4583) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1415,12 +1360,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -1469,16 +1414,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2319` + // Measured: `2304` // Estimated: `8727` - // Minimum execution time: 348_000_000 picoseconds. - Weight::from_parts(365_000_000, 8727) - .saturating_add(T::DbWeight::get().reads(33_u64)) - .saturating_add(T::DbWeight::get().writes(14_u64)) + // Minimum execution time: 382_000_000 picoseconds. + Weight::from_parts(395_000_000, 8727) + .saturating_add(T::DbWeight::get().reads(32_u64)) + .saturating_add(T::DbWeight::get().writes(16_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1508,14 +1455,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `1978` - // Estimated: `7918` - // Minimum execution time: 123_000_000 picoseconds. - Weight::from_parts(130_000_000, 7918) + // Measured: `1979` + // Estimated: `7919` + // Minimum execution time: 106_000_000 picoseconds. + Weight::from_parts(110_000_000, 7919) .saturating_add(T::DbWeight::get().reads(20_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1535,12 +1484,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetAlphaIn` (`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: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -1567,25 +1516,27 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2028` - // Estimated: `10443` - // Minimum execution time: 276_000_000 picoseconds. - Weight::from_parts(291_000_000, 10443) + // Measured: `2142` + // Estimated: `10557` + // Minimum execution time: 292_000_000 picoseconds. + Weight::from_parts(299_000_000, 10557) .saturating_add(T::DbWeight::get().reads(30_u64)) - .saturating_add(T::DbWeight::get().writes(12_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -1624,25 +1575,27 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2062` - // Estimated: `10477` - // Minimum execution time: 351_000_000 picoseconds. - Weight::from_parts(362_000_000, 10477) + // Measured: `2176` + // Estimated: `10591` + // Minimum execution time: 374_000_000 picoseconds. + Weight::from_parts(387_000_000, 10591) .saturating_add(T::DbWeight::get().reads(29_u64)) - .saturating_add(T::DbWeight::get().writes(12_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) @@ -1697,16 +1650,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2663` - // Estimated: `11078` - // Minimum execution time: 464_000_000 picoseconds. - Weight::from_parts(483_000_000, 11078) - .saturating_add(T::DbWeight::get().reads(50_u64)) - .saturating_add(T::DbWeight::get().writes(22_u64)) + // Measured: `2662` + // Estimated: `11077` + // Minimum execution time: 457_000_000 picoseconds. + Weight::from_parts(484_000_000, 11077) + .saturating_add(T::DbWeight::get().reads(49_u64)) + .saturating_add(T::DbWeight::get().writes(24_u64)) } fn move_stake_limit() -> Weight { // Same swap path as `swap_stake_limit`, plus the distinct destination @@ -1751,14 +1706,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `1909` - // Estimated: `7849` - // Minimum execution time: 153_000_000 picoseconds. - Weight::from_parts(163_000_000, 7849) + // Measured: `2023` + // Estimated: `7963` + // Minimum execution time: 134_000_000 picoseconds. + Weight::from_parts(142_000_000, 7963) .saturating_add(T::DbWeight::get().reads(21_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1794,14 +1751,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_stake_and_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `2048` - // Estimated: `7988` - // Minimum execution time: 151_000_000 picoseconds. - Weight::from_parts(158_000_000, 7988) + // Measured: `2162` + // Estimated: `8102` + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(146_000_000, 8102) .saturating_add(T::DbWeight::get().reads(24_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1809,6 +1768,10 @@ impl WeightInfo for SubstrateWeight { /// 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::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMovingPrice` (`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) @@ -1821,18 +1784,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -1867,16 +1826,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `2650` - // Estimated: `8590` - // Minimum execution time: 421_000_000 picoseconds. - Weight::from_parts(433_000_000, 8590) - .saturating_add(T::DbWeight::get().reads(35_u64)) - .saturating_add(T::DbWeight::get().writes(15_u64)) + // Measured: `2602` + // Estimated: `8542` + // Minimum execution time: 351_000_000 picoseconds. + Weight::from_parts(371_000_000, 8542) + .saturating_add(T::DbWeight::get().reads(34_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1884,18 +1845,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_min_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `1037` - // Estimated: `4502` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 4502) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `1015` + // Estimated: `4480` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 4480) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1915,14 +1874,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -1961,16 +1920,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2506` - // Estimated: `10921` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(378_000_000, 10921) - .saturating_add(T::DbWeight::get().reads(50_u64)) - .saturating_add(T::DbWeight::get().writes(22_u64)) + // Measured: `2505` + // Estimated: `10920` + // Minimum execution time: 371_000_000 picoseconds. + Weight::from_parts(388_000_000, 10920) + .saturating_add(T::DbWeight::get().reads(49_u64)) + .saturating_add(T::DbWeight::get().writes(24_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2006,8 +1967,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1300` // Estimated: `4765` - // Minimum execution time: 87_000_000 picoseconds. - Weight::from_parts(94_000_000, 4765) + // Minimum execution time: 77_000_000 picoseconds. + Weight::from_parts(79_000_000, 4765) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2047,8 +2008,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1455` // Estimated: `7395` - // Minimum execution time: 59_000_000 picoseconds. - Weight::from_parts(62_000_000, 7395) + // Minimum execution time: 51_000_000 picoseconds. + Weight::from_parts(54_000_000, 7395) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2064,8 +2025,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `830` // Estimated: `4295` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4295) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4295) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2083,8 +2044,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `923` // Estimated: `4388` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4388) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(19_000_000, 4388) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2198,8 +2159,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -2208,10 +2167,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1468` // Estimated: `9883` - // Minimum execution time: 168_000_000 picoseconds. - Weight::from_parts(180_000_000, 9883) - .saturating_add(T::DbWeight::get().reads(40_u64)) - .saturating_add(T::DbWeight::get().writes(48_u64)) + // Minimum execution time: 143_000_000 picoseconds. + Weight::from_parts(148_000_000, 9883) + .saturating_add(T::DbWeight::get().reads(41_u64)) + .saturating_add(T::DbWeight::get().writes(47_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2225,8 +2184,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4264) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4264) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2240,8 +2199,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `889` // Estimated: `6829` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(20_000_000, 6829) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 6829) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2255,37 +2214,29 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(16_000_000, 4203) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 4203) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:18 w:34) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) - /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:33 w:32) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:2548 w:0) + /// Storage: `SubtensorModule::Alpha` (r:2547 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2548 w:2546) + /// Storage: `SubtensorModule::AlphaV2` (r:2547 w:2546) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:34 w:34) @@ -2316,14 +2267,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:17 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:16 w:32) @@ -2348,20 +2291,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyRoot` (r:16 w:16) - /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:16) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:32) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `219260` - // Estimated: `6526550` - // Minimum execution time: 88_389_000_000 picoseconds. - Weight::from_parts(93_978_000_000, 6526550) - .saturating_add(T::DbWeight::get().reads(6955_u64)) - .saturating_add(T::DbWeight::get().writes(4157_u64)) + // Measured: `219071` + // Estimated: `6523886` + // Minimum execution time: 83_390_000_000 picoseconds. + Weight::from_parts(87_695_000_000, 6523886) + .saturating_add(T::DbWeight::get().reads(6928_u64)) + .saturating_add(T::DbWeight::get().writes(4111_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2373,8 +2312,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `818` // Estimated: `4283` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 4283) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 4283) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -2388,14 +2327,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `774` // Estimated: `9189` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 9189) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 9189) .saturating_add(T::DbWeight::get().reads(6_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`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::NetworksAdded` (r:3 w:0) @@ -2414,14 +2349,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -2444,14 +2379,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `AlphaAssets::AlphaBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:1 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:1 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) @@ -2462,11 +2391,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unstake_all_alpha() -> Weight { // Proof Size summary in bytes: - // Measured: `2446` + // Measured: `2235` // Estimated: `11306` - // Minimum execution time: 370_000_000 picoseconds. + // Minimum execution time: 380_000_000 picoseconds. Weight::from_parts(384_000_000, 11306) - .saturating_add(T::DbWeight::get().reads(50_u64)) + .saturating_add(T::DbWeight::get().reads(45_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -2485,12 +2414,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2517,14 +2446,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2062` - // Estimated: `10477` - // Minimum execution time: 366_000_000 picoseconds. - Weight::from_parts(380_000_000, 10477) + // Measured: `2176` + // Estimated: `10591` + // Minimum execution time: 388_000_000 picoseconds. + Weight::from_parts(415_000_000, 10591) .saturating_add(T::DbWeight::get().reads(29_u64)) - .saturating_add(T::DbWeight::get().writes(12_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } /// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:0) /// Proof: `Crowdloan::CurrentCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -2654,8 +2585,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -2665,13 +2594,13 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1835 + k * (44 ±0)` // Estimated: `10256 + k * (2579 ±0)` - // Minimum execution time: 306_000_000 picoseconds. - Weight::from_parts(199_755_086, 10256) - // Standard Error: 64_460 - .saturating_add(Weight::from_parts(32_306_685, 0).saturating_mul(k.into())) + // Minimum execution time: 259_000_000 picoseconds. + Weight::from_parts(171_942_062, 10256) + // Standard Error: 74_270 + .saturating_add(Weight::from_parts(29_141_808, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(50_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(54_u64)) + .saturating_add(T::DbWeight::get().writes(53_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) } @@ -2679,14 +2608,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetLeases` (`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::SubnetOwnerHotkey` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) - /// 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::LockingColdkeys` (r:2 w:0) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetLeaseShares` (r:499 w:499) @@ -2699,64 +2620,25 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) + /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AccumulatedLeaseDividends` (r:0 w:1) /// Proof: `SubtensorModule::AccumulatedLeaseDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[2, 500]`. fn terminate_lease(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1836 + k * (53 ±0)` - // Estimated: `7778 + k * (2529 ±0)` - // Minimum execution time: 88_000_000 picoseconds. - Weight::from_parts(98_396_469, 7778) - // Standard Error: 6_969 - .saturating_add(Weight::from_parts(1_324_962, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) + // Measured: `1501 + k * (53 ±0)` + // Estimated: `6148 + k * (2529 ±0)` + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(50_239_437, 6148) + // Standard Error: 5_020 + .saturating_add(Weight::from_parts(1_091_523, 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(14_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) } - /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) - /// 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::LockingColdkeys` (r:130 w:128) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Lock` (r:128 w:128) - /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingLock` (r:128 w:0) - /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `l` is `[1, 128]`. - fn transition_subnet_owner_locks(l: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1018 + l * (190 ±0)` - // Estimated: `6952 + l * (2665 ±0)` - // Minimum execution time: 59_000_000 picoseconds. - Weight::from_parts(41_965_196, 6952) - // Standard Error: 77_595 - .saturating_add(Weight::from_parts(29_329_722, 0).saturating_mul(l.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(l.into()))) - .saturating_add(T::DbWeight::get().writes(8_u64)) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(l.into()))) - .saturating_add(Weight::from_parts(0, 2665).saturating_mul(l.into())) - } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -2767,8 +2649,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `762` // Estimated: `9177` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 9177) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 9177) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2804,7 +2686,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1248` // Estimated: `4713` - // Minimum execution time: 49_000_000 picoseconds. + // Minimum execution time: 46_000_000 picoseconds. Weight::from_parts(51_000_000, 4713) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -2821,147 +2703,91 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4274) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 4274) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:256 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:768 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:768 w:512) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:512) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:256) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:256 w:256) - /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:1) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetProtocolFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetProtocolFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetRootSellTao` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetRootSellTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRedeemedTao` (r:256 w:256) - /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimType` (r:0 w:1) + /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:0 w:1) /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:256) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapBalancer` (r:0 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// The range of component `h` is `[1, 256]`. - fn claim_root(h: u32, ) -> Weight { + fn set_root_claim_type() -> Weight { // Proof Size summary in bytes: - // Measured: `2324 + h * (571 ±0)` - // Estimated: `8264 + h * (7997 ±0)` - // Minimum execution time: 292_000_000 picoseconds. - Weight::from_parts(295_000_000, 8264) - // Standard Error: 254_309 - .saturating_add(Weight::from_parts(234_093_735, 0).saturating_mul(h.into())) - .saturating_add(T::DbWeight::get().reads(22_u64)) - .saturating_add(T::DbWeight::get().reads((18_u64).saturating_mul(h.into()))) - .saturating_add(T::DbWeight::get().writes(16_u64)) - .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(h.into()))) - .saturating_add(Weight::from_parts(0, 7997).saturating_mul(h.into())) + // Measured: `476` + // Estimated: `3941` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 3941) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:256 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:768 w:0) + /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingColdkeys` (`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::RootClaimType` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DissolveCleanupQueue` (r:1 w:0) + /// Proof: `SubtensorModule::DissolveCleanupQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:768 w:0) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:0) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:1) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:256 w:0) - /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `h` is `[1, 256]`. + /// Storage: `SubtensorModule::RootClaimed` (r:1 w:1) + /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_root(h: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1969` + // Estimated: `7909` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(70_000_000, 7909) + .saturating_add(T::DbWeight::get().reads(17_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_mul(h.into()) + } + /// Per holding row a claim scans without redeeming: one `sim_swap` valuation plus + /// stake reads (no swap execution, no writes). fn claim_root_scan(h: u32, ) -> Weight { + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(6_000_000, 1000) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_mul(h.into()) + } + /// Storage: `SubtensorModule::NumRootClaim` (r:0 w:1) + /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn sudo_set_num_root_claims() -> Weight { // Proof Size summary in bytes: - // Measured: `1875 + h * (538 ±0)` - // Estimated: `5336 + h * (7964 ±0)` - // Minimum execution time: 190_000_000 picoseconds. - Weight::from_parts(193_000_000, 5336) - // Standard Error: 280_079 - .saturating_add(Weight::from_parts(168_979_287, 0).saturating_mul(h.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().reads((17_u64).saturating_mul(h.into()))) - .saturating_add(Weight::from_parts(0, 7964).saturating_mul(h.into())) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_000_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_root_claim_threshold() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Measured: `652` + // Estimated: `4117` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 4117) + .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -2974,8 +2800,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_000_000, 4364) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 4364) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2985,12 +2811,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) @@ -3037,22 +2863,24 @@ 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::LockingColdkeys` (r:1 w:0) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `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::LockingColdkeys` (r:0 w:1) + /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2322` + // Measured: `2307` // Estimated: `8727` - // Minimum execution time: 425_000_000 picoseconds. - Weight::from_parts(443_000_000, 8727) - .saturating_add(T::DbWeight::get().reads(36_u64)) - .saturating_add(T::DbWeight::get().writes(15_u64)) + // Minimum execution time: 459_000_000 picoseconds. + Weight::from_parts(477_000_000, 8727) + .saturating_add(T::DbWeight::get().reads(35_u64)) + .saturating_add(T::DbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -3061,7 +2889,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(1_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -3098,22 +2926,22 @@ 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::LockingColdkeys` (r:1 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn lock_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `1842` - // Estimated: `7782` - // Minimum execution time: 73_000_000 picoseconds. - Weight::from_parts(75_000_000, 7782) - .saturating_add(T::DbWeight::get().reads(20_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `1830` + // Estimated: `7770` + // Minimum execution time: 61_000_000 picoseconds. + Weight::from_parts(63_000_000, 7770) + .saturating_add(T::DbWeight::get().reads(18_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`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::Lock` (r:3 w:2) + /// Storage: `SubtensorModule::Lock` (r:2 w:2) /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3131,16 +2959,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::LockingColdkeys` (r:2 w:2) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:2) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn move_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1722` - // Estimated: `10137` - // Minimum execution time: 90_000_000 picoseconds. - Weight::from_parts(93_000_000, 10137) - .saturating_add(T::DbWeight::get().reads(20_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) + // Measured: `1515` + // Estimated: `7455` + // Minimum execution time: 80_000_000 picoseconds. + Weight::from_parts(84_000_000, 7455) + .saturating_add(T::DbWeight::get().reads(15_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3156,8 +2984,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1157` // Estimated: `4622` - // Minimum execution time: 370_000_000 picoseconds. - Weight::from_parts(377_000_000, 4622) + // Minimum execution time: 378_000_000 picoseconds. + Weight::from_parts(395_000_000, 4622) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3181,7 +3009,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `982` // Estimated: `4447` - // Minimum execution time: 26_000_000 picoseconds. + // Minimum execution time: 24_000_000 picoseconds. Weight::from_parts(27_000_000, 4447) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -3194,8 +3022,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 4198) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4198) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) @@ -3222,8 +3050,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1731` // Estimated: `7671` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(33_000_000, 7671) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(30_000_000, 7671) .saturating_add(T::DbWeight::get().reads(11_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3244,8 +3072,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1019` // Estimated: `4484` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4484) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 4484) .saturating_add(T::DbWeight::get().reads(7_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:1 w:0) @@ -3258,8 +3086,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `721` // Estimated: `4186` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 4186) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 4186) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -3272,8 +3100,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `647` // Estimated: `4112` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4112) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4112) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -3284,8 +3112,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 4117) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 4117) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -3327,10 +3155,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `4079 + n * (45 ±0)` // Estimated: `9373 + n * (2520 ±0)` - // Minimum execution time: 61_000_000 picoseconds. - Weight::from_parts(99_046_630, 9373) - // Standard Error: 5_784 - .saturating_add(Weight::from_parts(1_804_489, 0).saturating_mul(n.into())) + // Minimum execution time: 53_000_000 picoseconds. + Weight::from_parts(56_000_000, 9373) + // Standard Error: 3_996 + .saturating_add(Weight::from_parts(1_961_926, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -3368,8 +3196,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `37406` // Estimated: `40871` - // Minimum execution time: 101_000_000 picoseconds. - Weight::from_parts(129_000_000, 40871) + // Minimum execution time: 116_000_000 picoseconds. + Weight::from_parts(124_000_000, 40871) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3418,10 +3246,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `4835 + n * (37 ±0)` // Estimated: `10114 + n * (2512 ±0)` - // Minimum execution time: 70_000_000 picoseconds. - Weight::from_parts(40_743_358, 10114) - // Standard Error: 6_939 - .saturating_add(Weight::from_parts(1_900_854, 0).saturating_mul(n.into())) + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(61_000_000, 10114) + // Standard Error: 4_010 + .saturating_add(Weight::from_parts(2_031_383, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -3459,8 +3287,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 125_000_000 picoseconds. - Weight::from_parts(141_000_000, 40392) + // Minimum execution time: 117_000_000 picoseconds. + Weight::from_parts(132_000_000, 40392) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3496,37 +3324,29 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 112_000_000 picoseconds. - Weight::from_parts(137_000_000, 40392) + // Minimum execution time: 113_000_000 picoseconds. + Weight::from_parts(130_000_000, 40392) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:4098 w:8194) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) - /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:8193 w:8192) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:8194 w:0) + /// Storage: `SubtensorModule::Alpha` (r:8193 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:8194 w:8192) + /// Storage: `SubtensorModule::AlphaV2` (r:8193 w:8192) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:8194 w:8194) @@ -3557,14 +3377,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:4097 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:4096 w:8192) @@ -3589,20 +3401,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyRoot` (r:4096 w:4096) - /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:4096) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:8192) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey_v2() -> Weight { // Proof Size summary in bytes: - // Measured: `544206` - // Estimated: `20825346` - // Minimum execution time: 739_639_000_000 picoseconds. - Weight::from_parts(773_406_000_000, 20825346) - .saturating_add(T::DbWeight::get().reads(155695_u64)) - .saturating_add(T::DbWeight::get().writes(90131_u64)) + // Measured: `542010` + // Estimated: `20823150` + // Minimum execution time: 572_681_000_000 picoseconds. + Weight::from_parts(594_286_000_000, 20823150) + .saturating_add(T::DbWeight::get().reads(151588_u64)) + .saturating_add(T::DbWeight::get().writes(77845_u64)) } /// Storage: `SubtensorModule::MinChildkeyTake` (r:0 w:1) /// Proof: `SubtensorModule::MinChildkeyTake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -3610,8 +3418,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxChildkeyTake` (r:0 w:1) @@ -3620,14 +3428,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -3644,17 +3448,13 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1185` - // Estimated: `4650` - // Minimum execution time: 55_000_000 picoseconds. - Weight::from_parts(61_000_000, 4650) - .saturating_add(T::DbWeight::get().reads(9_u64)) + // Measured: `1080` + // Estimated: `4545` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(52_000_000, 4545) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -3671,11 +3471,11 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1185` - // Estimated: `4650` - // Minimum execution time: 54_000_000 picoseconds. - Weight::from_parts(64_000_000, 4650) - .saturating_add(T::DbWeight::get().reads(9_u64)) + // Measured: `1080` + // Estimated: `4545` + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(51_000_000, 4545) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::TransactionKeyLastBlock` (r:1 w:1) @@ -3707,14 +3507,12 @@ impl WeightInfo for SubstrateWeight { /// Storage: `SubtensorModule::PendingChildKeys` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[1, 5]`. - fn set_children(c: u32, ) -> Weight { + fn set_children(_c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1536` // Estimated: `9951` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(62_257_943, 9951) - // Standard Error: 51_019 - .saturating_add(Weight::from_parts(73_831, 0).saturating_mul(c.into())) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(55_660_572, 9951) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3737,8 +3535,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(17_000_000, 4203) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 4203) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -3754,8 +3552,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(18_000_000, 4264) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4264) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -3767,8 +3565,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -3818,12 +3616,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapBalancer` (r:1 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -3846,8 +3642,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -3892,18 +3686,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) + /// Storage: `Swap::SwapBalancer` (r:0 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn register_limit() -> Weight { // Proof Size summary in bytes: // Measured: `289796` // Estimated: `926861` - // Minimum execution time: 2_987_000_000 picoseconds. - Weight::from_parts(3_170_000_000, 926861) - .saturating_add(T::DbWeight::get().reads(825_u64)) - .saturating_add(T::DbWeight::get().writes(299_u64)) + // Minimum execution time: 2_829_000_000 picoseconds. + Weight::from_parts(345_012_000, 6148) + .saturating_add(T::DbWeight::get().reads(34_u64)) + .saturating_add(T::DbWeight::get().writes(29_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3925,30 +3721,30 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_perpetual_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1241` - // Estimated: `7181` - // Minimum execution time: 64_000_000 picoseconds. - Weight::from_parts(69_000_000, 7181) - .saturating_add(T::DbWeight::get().reads(12_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `1226` + // Estimated: `7166` + // Minimum execution time: 52_000_000 picoseconds. + Weight::from_parts(54_000_000, 7166) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } fn set_tempo() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) + // Minimum execution time: 783_000 picoseconds. + Weight::from_parts(887_000, 0) } fn set_activity_cutoff_factor() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) + // Minimum execution time: 803_000 picoseconds. + Weight::from_parts(891_000, 0) } /// Storage: `SubtensorModule::AccountFlags` (r:1 w:1) /// Proof: `SubtensorModule::AccountFlags` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -3956,8 +3752,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `562` // Estimated: `4027` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 4027) + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_000_000, 4027) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -4063,8 +3859,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:0 w:1) @@ -4073,10 +3867,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `289875` // Estimated: `926940` - // Minimum execution time: 2_950_000_000 picoseconds. - Weight::from_parts(3_170_000_000, 926940) - .saturating_add(RocksDbWeight::get().reads(814_u64)) - .saturating_add(RocksDbWeight::get().writes(294_u64)) + // Minimum execution time: 2_761_000_000 picoseconds. + Weight::from_parts(364_683_000, 6148) + .saturating_add(RocksDbWeight::get().reads(34_u64)) + .saturating_add(RocksDbWeight::get().writes(29_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) /// Proof: `SubtensorModule::CommitRevealWeightsEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4116,8 +3910,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `188820` // Estimated: `10327410` - // Minimum execution time: 7_042_000_000 picoseconds. - Weight::from_parts(7_349_000_000, 10327410) + // Minimum execution time: 7_637_000_000 picoseconds. + Weight::from_parts(8_632_000_000, 10327410) .saturating_add(RocksDbWeight::get().reads(4112_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4129,12 +3923,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:3 w:3) @@ -4179,16 +3973,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2319` + // Measured: `2304` // Estimated: `8727` - // Minimum execution time: 261_000_000 picoseconds. - Weight::from_parts(273_000_000, 8727) - .saturating_add(RocksDbWeight::get().reads(33_u64)) - .saturating_add(RocksDbWeight::get().writes(14_u64)) + // Minimum execution time: 301_000_000 picoseconds. + Weight::from_parts(310_000_000, 8727) + .saturating_add(RocksDbWeight::get().reads(32_u64)) + .saturating_add(RocksDbWeight::get().writes(16_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4202,8 +3998,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4293) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4293) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4219,8 +4015,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4392` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(22_000_000, 4392) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 4392) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4270,12 +4066,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapBalancer` (r:1 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -4298,8 +4092,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -4344,18 +4136,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) + /// Storage: `Swap::SwapBalancer` (r:0 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn burned_register() -> Weight { // Proof Size summary in bytes: // Measured: `289277` // Estimated: `926342` - // Minimum execution time: 2_979_000_000 picoseconds. - Weight::from_parts(3_072_000_000, 926342) - .saturating_add(RocksDbWeight::get().reads(825_u64)) - .saturating_add(RocksDbWeight::get().writes(299_u64)) + // Minimum execution time: 2_807_000_000 picoseconds. + Weight::from_parts(365_124_000, 6148) + .saturating_add(RocksDbWeight::get().reads(34_u64)) + .saturating_add(RocksDbWeight::get().writes(29_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4367,13 +4161,13 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::RegistrationsThisInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TargetRegistrationsPerInterval` (r:1 w:0) /// Proof: `SubtensorModule::TargetRegistrationsPerInterval` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:2 w:2) + /// Storage: `SubtensorModule::Uids` (r:1 w:2) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetworkN` (r:1 w:0) /// Proof: `SubtensorModule::SubnetworkN` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4381,30 +4175,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MaxAllowedUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:65 w:1) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:64 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:65 w:0) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Burn` (r:1 w:1) - /// Proof: `SubtensorModule::Burn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) - /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RAORecycledForRegistration` (r:1 w:1) - /// Proof: `SubtensorModule::RAORecycledForRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BurnIncreaseMult` (r:1 w:0) - /// Proof: `SubtensorModule::BurnIncreaseMult` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinBurn` (r:1 w:0) - /// Proof: `SubtensorModule::MinBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MaxBurn` (r:1 w:0) - /// Proof: `SubtensorModule::MaxBurn` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AssociatedEvmAddress` (r:1 w:0) /// Proof: `SubtensorModule::AssociatedEvmAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:1 w:1) @@ -4441,18 +4215,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_register() -> Weight { // Proof Size summary in bytes: - // Measured: `46222` - // Estimated: `208087` - // Minimum execution time: 633_000_000 picoseconds. - Weight::from_parts(672_000_000, 208087) - .saturating_add(RocksDbWeight::get().reads(229_u64)) - .saturating_add(RocksDbWeight::get().writes(94_u64)) + // Measured: `29210` + // Estimated: `191075` + // Minimum execution time: 566_000_000 picoseconds. + Weight::from_parts(621_000_000, 191075) + .saturating_add(RocksDbWeight::get().reads(219_u64)) + .saturating_add(RocksDbWeight::get().writes(88_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4564,8 +4336,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -4574,10 +4344,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1532` // Estimated: `9947` - // Minimum execution time: 168_000_000 picoseconds. - Weight::from_parts(186_000_000, 9947) - .saturating_add(RocksDbWeight::get().reads(41_u64)) - .saturating_add(RocksDbWeight::get().writes(49_u64)) + // Minimum execution time: 145_000_000 picoseconds. + Weight::from_parts(153_000_000, 9947) + .saturating_add(RocksDbWeight::get().reads(42_u64)) + .saturating_add(RocksDbWeight::get().writes(48_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4609,8 +4379,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1249` // Estimated: `4714` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(42_000_000, 4714) + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(36_000_000, 4714) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4656,8 +4426,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 66_000_000 picoseconds. - Weight::from_parts(71_000_000, 7590) + // Minimum execution time: 56_000_000 picoseconds. + Weight::from_parts(58_000_000, 7590) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4667,8 +4437,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4691,8 +4461,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1033` // Estimated: `4498` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(34_000_000, 4498) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 4498) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4708,17 +4478,13 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 4159) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4159) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -4743,18 +4509,8 @@ 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::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -4767,27 +4523,21 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) - /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey_announced() -> Weight { + // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral + // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `8414` - // Estimated: `167804` - // Minimum execution time: 883_000_000 picoseconds. - Weight::from_parts(921_000_000, 167804) - .saturating_add(RocksDbWeight::get().reads(114_u64)) - .saturating_add(RocksDbWeight::get().writes(87_u64)) + // Measured: `2110` + // Estimated: `100000` + // Minimum execution time: 450_000_000 picoseconds. + Weight::from_parts(450_000_000, 100000) + .saturating_add(RocksDbWeight::get().reads(250_u64)) + .saturating_add(RocksDbWeight::get().writes(200_u64)) } /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:1) @@ -4812,18 +4562,8 @@ 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::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:3 w:2) - /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:64 w:64) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:2) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) @@ -4834,22 +4574,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::DecayingLock` (r:1 w:0) /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyRoot` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeySwapDisputes` (r:0 w:1) /// Proof: `SubtensorModule::ColdkeySwapDisputes` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeySuccessor` (r:0 w:2) - /// Proof: `SubtensorModule::ColdkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_coldkey() -> Weight { + // Worst case includes migrating MAX_COLDKEY_COLLATERAL_HOTKEYS collateral + // positions via ColdkeyCollateralHotkeys plus coldkey lineage writes. // Proof Size summary in bytes: - // Measured: `8417` - // Estimated: `167807` - // Minimum execution time: 911_000_000 picoseconds. - Weight::from_parts(951_000_000, 167807) - .saturating_add(RocksDbWeight::get().reads(114_u64)) - .saturating_add(RocksDbWeight::get().writes(91_u64)) + // Measured: `2166` + // Estimated: `100000` + // Minimum execution time: 480_000_000 picoseconds. + Weight::from_parts(480_000_000, 100000) + .saturating_add(RocksDbWeight::get().reads(250_u64)) + .saturating_add(RocksDbWeight::get().writes(210_u64)) } /// Storage: `SubtensorModule::ColdkeySwapAnnouncements` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeySwapAnnouncements` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4859,8 +4597,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 4130) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 4130) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4872,8 +4610,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4078) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 4078) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4885,8 +4623,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -4931,8 +4669,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2155` // Estimated: `8095` - // Minimum execution time: 233_000_000 picoseconds. - Weight::from_parts(247_000_000, 8095) + // Minimum execution time: 209_000_000 picoseconds. + Weight::from_parts(218_000_000, 8095) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4970,8 +4708,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 106_000_000 picoseconds. - Weight::from_parts(110_000_000, 5219) + // Minimum execution time: 94_000_000 picoseconds. + Weight::from_parts(98_000_000, 5219) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -5007,11 +4745,13 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 104_000_000 picoseconds. - Weight::from_parts(109_000_000, 5219) + // Minimum execution time: 92_000_000 picoseconds. + Weight::from_parts(102_000_000, 5219) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } + /// Storage: `System::ParentHash` (r:1 w:0) + /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:130 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Burn` (r:129 w:129) @@ -5056,12 +4796,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerBurned` (r:128 w:2) /// Proof: `SubtensorModule::MinerBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::EmissionGateBar` (r:1 w:1) - /// Proof: `SubtensorModule::EmissionGateBar` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::EmissionBarRank` (r:1 w:0) - /// Proof: `SubtensorModule::EmissionBarRank` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::EmissionGateExponent` (r:1 w:0) - /// Proof: `SubtensorModule::EmissionGateExponent` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetEmissionEnabled` (r:128 w:0) /// Proof: `SubtensorModule::SubnetEmissionEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:128 w:127) @@ -5112,7 +4846,7 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastUpdate` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::BlockAtRegistration` (r:512 w:0) /// Proof: `SubtensorModule::BlockAtRegistration` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:1024 w:512) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ParentKeys` (r:512 w:0) /// Proof: `SubtensorModule::ParentKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5158,36 +4892,42 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MinChildkeyTakePerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:512 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:512 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:2 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:2 w:0) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:512 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:2 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketFlushCursor` (r:1 w:1) - /// Proof: `SubtensorModule::PendingBasketFlushCursor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:513 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:542 w:512) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:512 w:512) + /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:512 w:512) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootAlphaDividendsPerSubnet` (r:512 w:512) + /// Proof: `SubtensorModule::RootAlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:128 w:0) /// Proof: `SubtensorModule::EMAPriceHalvingBlocks` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:1 w:0) /// Proof: `SubtensorModule::SubnetMovingAlpha` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::PendingChildKeys` (r:129 w:0) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:0) + /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NumRootClaim` (r:1 w:0) + /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:1 w:0) + /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaMapLastKey` (r:1 w:0) /// Proof: `SubtensorModule::AlphaMapLastKey` (`max_values`: Some(1), `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::AlphaV2MapLastKey` (r:1 w:1) /// Proof: `SubtensorModule::AlphaV2MapLastKey` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:31 w:0) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootProp` (r:0 w:128) /// Proof: `SubtensorModule::RootProp` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Active` (r:0 w:2) @@ -5218,12 +4958,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoInEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) fn block_step() -> Weight { // Proof Size summary in bytes: - // Measured: `35120583` - // Estimated: `37655973` - // Minimum execution time: 49_851_000_000 picoseconds. - Weight::from_parts(53_672_000_000, 37655973) - .saturating_add(RocksDbWeight::get().reads(10347_u64)) - .saturating_add(RocksDbWeight::get().writes(3994_u64)) + // Measured: `35625441` + // Estimated: `38160831` + // Minimum execution time: 74_108_000_000 picoseconds. + Weight::from_parts(80_064_000_000, 38160831) + .saturating_add(RocksDbWeight::get().reads(13414_u64)) + .saturating_add(RocksDbWeight::get().writes(7064_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5241,8 +4981,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(27_000_000, 4583) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 4583) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5250,12 +4990,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -5304,16 +5044,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2319` + // Measured: `2304` // Estimated: `8727` - // Minimum execution time: 348_000_000 picoseconds. - Weight::from_parts(365_000_000, 8727) - .saturating_add(RocksDbWeight::get().reads(33_u64)) - .saturating_add(RocksDbWeight::get().writes(14_u64)) + // Minimum execution time: 382_000_000 picoseconds. + Weight::from_parts(395_000_000, 8727) + .saturating_add(RocksDbWeight::get().reads(32_u64)) + .saturating_add(RocksDbWeight::get().writes(16_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5343,14 +5085,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `1978` - // Estimated: `7918` - // Minimum execution time: 123_000_000 picoseconds. - Weight::from_parts(130_000_000, 7918) + // Measured: `1979` + // Estimated: `7919` + // Minimum execution time: 106_000_000 picoseconds. + Weight::from_parts(110_000_000, 7919) .saturating_add(RocksDbWeight::get().reads(20_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) } /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5370,12 +5114,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetAlphaIn` (`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: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -5402,25 +5146,27 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2028` - // Estimated: `10443` - // Minimum execution time: 276_000_000 picoseconds. - Weight::from_parts(291_000_000, 10443) + // Measured: `2142` + // Estimated: `10557` + // Minimum execution time: 292_000_000 picoseconds. + Weight::from_parts(299_000_000, 10557) .saturating_add(RocksDbWeight::get().reads(30_u64)) - .saturating_add(RocksDbWeight::get().writes(12_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -5459,25 +5205,27 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn remove_stake_limit() -> Weight { + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2062` - // Estimated: `10477` - // Minimum execution time: 351_000_000 picoseconds. - Weight::from_parts(362_000_000, 10477) + // Measured: `2176` + // Estimated: `10591` + // Minimum execution time: 374_000_000 picoseconds. + Weight::from_parts(387_000_000, 10591) .saturating_add(RocksDbWeight::get().reads(29_u64)) - .saturating_add(RocksDbWeight::get().writes(12_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) } /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) @@ -5532,16 +5280,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2663` - // Estimated: `11078` - // Minimum execution time: 464_000_000 picoseconds. - Weight::from_parts(483_000_000, 11078) - .saturating_add(RocksDbWeight::get().reads(50_u64)) - .saturating_add(RocksDbWeight::get().writes(22_u64)) + // Measured: `2662` + // Estimated: `11077` + // Minimum execution time: 457_000_000 picoseconds. + Weight::from_parts(484_000_000, 11077) + .saturating_add(RocksDbWeight::get().reads(49_u64)) + .saturating_add(RocksDbWeight::get().writes(24_u64)) } fn move_stake_limit() -> Weight { Self::swap_stake_limit() @@ -5584,14 +5334,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, 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: `1909` - // Estimated: `7849` - // Minimum execution time: 153_000_000 picoseconds. - Weight::from_parts(163_000_000, 7849) + // Measured: `2023` + // Estimated: `7963` + // Minimum execution time: 134_000_000 picoseconds. + Weight::from_parts(142_000_000, 7963) .saturating_add(RocksDbWeight::get().reads(21_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5627,14 +5379,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_stake_and_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `2048` - // Estimated: `7988` - // Minimum execution time: 151_000_000 picoseconds. - Weight::from_parts(158_000_000, 7988) + // Measured: `2162` + // Estimated: `8102` + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(146_000_000, 8102) .saturating_add(RocksDbWeight::get().reads(24_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5642,6 +5396,10 @@ impl WeightInfo for () { /// 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::SubnetMechanism` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetMovingPrice` (`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) @@ -5654,18 +5412,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetMovingPrice` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetMovingPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -5700,16 +5454,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `2650` - // Estimated: `8590` - // Minimum execution time: 421_000_000 picoseconds. - Weight::from_parts(433_000_000, 8590) - .saturating_add(RocksDbWeight::get().reads(35_u64)) - .saturating_add(RocksDbWeight::get().writes(15_u64)) + // Measured: `2602` + // Estimated: `8542` + // Minimum execution time: 351_000_000 picoseconds. + Weight::from_parts(371_000_000, 8542) + .saturating_add(RocksDbWeight::get().reads(34_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5717,18 +5473,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:1) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ColdkeyCollateralHotkeys` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_min_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `1037` - // Estimated: `4502` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 4502) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Measured: `1015` + // Estimated: `4480` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 4480) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5748,14 +5502,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -5794,16 +5548,18 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`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 swap_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `2506` - // Estimated: `10921` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(378_000_000, 10921) - .saturating_add(RocksDbWeight::get().reads(50_u64)) - .saturating_add(RocksDbWeight::get().writes(22_u64)) + // Measured: `2505` + // Estimated: `10920` + // Minimum execution time: 371_000_000 picoseconds. + Weight::from_parts(388_000_000, 10920) + .saturating_add(RocksDbWeight::get().reads(49_u64)) + .saturating_add(RocksDbWeight::get().writes(24_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -5839,8 +5595,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1300` // Estimated: `4765` - // Minimum execution time: 87_000_000 picoseconds. - Weight::from_parts(94_000_000, 4765) + // Minimum execution time: 77_000_000 picoseconds. + Weight::from_parts(79_000_000, 4765) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5880,8 +5636,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1455` // Estimated: `7395` - // Minimum execution time: 59_000_000 picoseconds. - Weight::from_parts(62_000_000, 7395) + // Minimum execution time: 51_000_000 picoseconds. + Weight::from_parts(54_000_000, 7395) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5897,8 +5653,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `830` // Estimated: `4295` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 4295) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4295) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -5916,8 +5672,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `923` // Estimated: `4388` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4388) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(19_000_000, 4388) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -6031,8 +5787,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -6041,10 +5795,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1468` // Estimated: `9883` - // Minimum execution time: 168_000_000 picoseconds. - Weight::from_parts(180_000_000, 9883) - .saturating_add(RocksDbWeight::get().reads(40_u64)) - .saturating_add(RocksDbWeight::get().writes(48_u64)) + // Minimum execution time: 143_000_000 picoseconds. + Weight::from_parts(148_000_000, 9883) + .saturating_add(RocksDbWeight::get().reads(41_u64)) + .saturating_add(RocksDbWeight::get().writes(47_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -6058,8 +5812,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(23_000_000, 4264) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 4264) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -6073,8 +5827,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `889` // Estimated: `6829` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(20_000_000, 6829) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 6829) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -6088,37 +5842,29 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(16_000_000, 4203) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 4203) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:18 w:34) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) - /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:33 w:32) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:2548 w:0) + /// Storage: `SubtensorModule::Alpha` (r:2547 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2548 w:2546) + /// Storage: `SubtensorModule::AlphaV2` (r:2547 w:2546) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:17 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:34 w:34) @@ -6149,14 +5895,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:17 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:16 w:32) @@ -6181,20 +5919,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyRoot` (r:16 w:16) - /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:16) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:32) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `219260` - // Estimated: `6526550` - // Minimum execution time: 88_389_000_000 picoseconds. - Weight::from_parts(93_978_000_000, 6526550) - .saturating_add(RocksDbWeight::get().reads(6955_u64)) - .saturating_add(RocksDbWeight::get().writes(4157_u64)) + // Measured: `219071` + // Estimated: `6523886` + // Minimum execution time: 83_390_000_000 picoseconds. + Weight::from_parts(87_695_000_000, 6523886) + .saturating_add(RocksDbWeight::get().reads(6928_u64)) + .saturating_add(RocksDbWeight::get().writes(4111_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -6206,8 +5940,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `818` // Estimated: `4283` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 4283) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 4283) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -6221,14 +5955,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `774` // Estimated: `9189` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 9189) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 9189) .saturating_add(RocksDbWeight::get().reads(6_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`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::NetworksAdded` (r:3 w:0) @@ -6247,14 +5977,14 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`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: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) @@ -6277,14 +6007,8 @@ impl WeightInfo for () { /// Proof: `AlphaAssets::AlphaBurned` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTaoFlow` (r:2 w:2) /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:1 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:1 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) @@ -6295,11 +6019,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unstake_all_alpha() -> Weight { // Proof Size summary in bytes: - // Measured: `2446` + // Measured: `2235` // Estimated: `11306` - // Minimum execution time: 370_000_000 picoseconds. + // Minimum execution time: 380_000_000 picoseconds. Weight::from_parts(384_000_000, 11306) - .saturating_add(RocksDbWeight::get().reads(50_u64)) + .saturating_add(RocksDbWeight::get().reads(45_u64)) .saturating_add(RocksDbWeight::get().writes(25_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:3 w:0) @@ -6318,12 +6042,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -6350,14 +6074,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTaoFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakeThreshold` (r:1 w:0) /// Proof: `SubtensorModule::StakeThreshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:1) + /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_stake_full_limit() -> Weight { // Proof Size summary in bytes: - // Measured: `2062` - // Estimated: `10477` - // Minimum execution time: 366_000_000 picoseconds. - Weight::from_parts(380_000_000, 10477) + // Measured: `2176` + // Estimated: `10591` + // Minimum execution time: 388_000_000 picoseconds. + Weight::from_parts(415_000_000, 10591) .saturating_add(RocksDbWeight::get().reads(29_u64)) - .saturating_add(RocksDbWeight::get().writes(12_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) } /// Storage: `Crowdloan::CurrentCrowdloanId` (r:1 w:0) /// Proof: `Crowdloan::CurrentCrowdloanId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -6487,8 +6213,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::NetworkRegistrationAllowed` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Yuma3On` (r:0 w:1) /// Proof: `SubtensorModule::Yuma3On` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:1) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MaxAllowedUids` (r:0 w:1) @@ -6498,13 +6222,13 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1835 + k * (44 ±0)` // Estimated: `10256 + k * (2579 ±0)` - // Minimum execution time: 306_000_000 picoseconds. - Weight::from_parts(199_755_086, 10256) - // Standard Error: 64_460 - .saturating_add(Weight::from_parts(32_306_685, 0).saturating_mul(k.into())) + // Minimum execution time: 259_000_000 picoseconds. + Weight::from_parts(171_942_062, 10256) + // Standard Error: 74_270 + .saturating_add(Weight::from_parts(29_141_808, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(50_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into()))) - .saturating_add(RocksDbWeight::get().writes(54_u64)) + .saturating_add(RocksDbWeight::get().writes(53_u64)) .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) } @@ -6512,14 +6236,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetLeases` (`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::SubnetOwnerHotkey` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) - /// 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::LockingColdkeys` (r:2 w:0) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetLeaseShares` (r:499 w:499) @@ -6532,64 +6248,25 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetUidToLeaseId` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwner` (r:0 w:1) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:0 w:1) + /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AccumulatedLeaseDividends` (r:0 w:1) /// Proof: `SubtensorModule::AccumulatedLeaseDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[2, 500]`. fn terminate_lease(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1836 + k * (53 ±0)` - // Estimated: `7778 + k * (2529 ±0)` - // Minimum execution time: 88_000_000 picoseconds. - Weight::from_parts(98_396_469, 7778) - // Standard Error: 6_969 - .saturating_add(Weight::from_parts(1_324_962, 0).saturating_mul(k.into())) - .saturating_add(RocksDbWeight::get().reads(11_u64)) + // Measured: `1501 + k * (53 ±0)` + // Estimated: `6148 + k * (2529 ±0)` + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(50_239_437, 6148) + // Standard Error: 5_020 + .saturating_add(Weight::from_parts(1_091_523, 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(14_u64)) + .saturating_add(RocksDbWeight::get().writes(8_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) } - /// Storage: `SubtensorModule::UnlockRate` (r:1 w:0) - /// 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::LockingColdkeys` (r:130 w:128) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Lock` (r:128 w:128) - /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingLock` (r:128 w:0) - /// Proof: `SubtensorModule::DecayingLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingOwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::DecayingOwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerLock` (r:0 w:1) - /// Proof: `SubtensorModule::OwnerLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:0 w:2) - /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `l` is `[1, 128]`. - fn transition_subnet_owner_locks(l: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1018 + l * (190 ±0)` - // Estimated: `6952 + l * (2665 ±0)` - // Minimum execution time: 59_000_000 picoseconds. - Weight::from_parts(41_965_196, 6952) - // Standard Error: 77_595 - .saturating_add(Weight::from_parts(29_329_722, 0).saturating_mul(l.into())) - .saturating_add(RocksDbWeight::get().reads(6_u64)) - .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(l.into()))) - .saturating_add(RocksDbWeight::get().writes(8_u64)) - .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(l.into()))) - .saturating_add(Weight::from_parts(0, 2665).saturating_mul(l.into())) - } /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -6600,8 +6277,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `762` // Estimated: `9177` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 9177) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 9177) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -6637,7 +6314,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1248` // Estimated: `4713` - // Minimum execution time: 49_000_000 picoseconds. + // Minimum execution time: 46_000_000 picoseconds. Weight::from_parts(51_000_000, 4713) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -6654,147 +6331,91 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 4274) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 4274) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) - /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:256 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:768 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:768 w:512) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:512) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:512) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:256) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:256 w:256) - /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:1) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetAlphaOut` (r:2 w:2) - /// Proof: `SubtensorModule::SubnetAlphaOut` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalStake` (r:1 w:1) - /// Proof: `SubtensorModule::TotalStake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetVolume` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetVolume` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetProtocolFlow` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetProtocolFlow` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetRootSellTao` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetRootSellTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRedeemedTao` (r:256 w:256) - /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::StakingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NumStakingColdkeys` (r:1 w:1) /// Proof: `SubtensorModule::NumStakingColdkeys` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimType` (r:0 w:1) + /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingColdkeysByIndex` (r:0 w:1) /// Proof: `SubtensorModule::StakingColdkeysByIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (r:0 w:256) - /// Proof: `SubtensorModule::LastColdkeyHotkeyStakeBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapBalancer` (r:0 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) - /// The range of component `h` is `[1, 256]`. - fn claim_root(h: u32, ) -> Weight { + fn set_root_claim_type() -> Weight { // Proof Size summary in bytes: - // Measured: `2324 + h * (571 ±0)` - // Estimated: `8264 + h * (7997 ±0)` - // Minimum execution time: 292_000_000 picoseconds. - Weight::from_parts(295_000_000, 8264) - // Standard Error: 254_309 - .saturating_add(Weight::from_parts(234_093_735, 0).saturating_mul(h.into())) - .saturating_add(RocksDbWeight::get().reads(22_u64)) - .saturating_add(RocksDbWeight::get().reads((18_u64).saturating_mul(h.into()))) - .saturating_add(RocksDbWeight::get().writes(16_u64)) - .saturating_add(RocksDbWeight::get().writes((10_u64).saturating_mul(h.into()))) - .saturating_add(Weight::from_parts(0, 7997).saturating_mul(h.into())) + // Measured: `476` + // Estimated: `3941` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 3941) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:256 w:0) - /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:256 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:768 w:0) + /// Storage: `SubtensorModule::StakingColdkeys` (r:1 w:0) + /// Proof: `SubtensorModule::StakingColdkeys` (`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::RootClaimType` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimType` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::DissolveCleanupQueue` (r:1 w:0) + /// Proof: `SubtensorModule::DissolveCleanupQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:768 w:0) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:1) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:512 w:0) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:1) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:512 w:0) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:512 w:0) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:1) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:256 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:256 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:256 w:0) - /// Proof: `SubtensorModule::BasketShares` (`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::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) - /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `h` is `[1, 256]`. + /// Storage: `SubtensorModule::RootClaimed` (r:1 w:1) + /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimableThreshold` (r:1 w:0) + /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_root(h: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1969` + // Estimated: `7909` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(70_000_000, 7909) + .saturating_add(RocksDbWeight::get().reads(17_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + .saturating_mul(h.into()) + } + /// Per holding row a claim scans without redeeming: one `sim_swap` valuation plus + /// stake reads (no swap execution, no writes). fn claim_root_scan(h: u32, ) -> Weight { + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(6_000_000, 1000) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_mul(h.into()) + } + /// Storage: `SubtensorModule::NumRootClaim` (r:0 w:1) + /// Proof: `SubtensorModule::NumRootClaim` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn sudo_set_num_root_claims() -> Weight { // Proof Size summary in bytes: - // Measured: `1875 + h * (538 ±0)` - // Estimated: `5336 + h * (7964 ±0)` - // Minimum execution time: 190_000_000 picoseconds. - Weight::from_parts(193_000_000, 5336) - // Standard Error: 280_079 - .saturating_add(Weight::from_parts(168_979_287, 0).saturating_mul(h.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().reads((17_u64).saturating_mul(h.into()))) - .saturating_add(Weight::from_parts(0, 7964).saturating_mul(h.into())) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_000_000, 0) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimableThreshold` (r:0 w:1) /// Proof: `SubtensorModule::RootClaimableThreshold` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_root_claim_threshold() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + // Measured: `652` + // Estimated: `4117` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 4117) + .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -6807,8 +6428,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_000_000, 4364) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 4364) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -6818,12 +6439,12 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) - /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) - /// Storage: `Swap::FeeRate` (r:1 w:0) - /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Swap::FeeRate` (r:1 w:0) + /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `Swap::PalSwapInitialized` (r:1 w:0) + /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `Swap::SwapBalancer` (r:1 w:0) /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) @@ -6870,22 +6491,24 @@ 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::LockingColdkeys` (r:1 w:0) - /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::ColdkeyMinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::MinerCollateral` (r:1 w:0) /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `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::LockingColdkeys` (r:0 w:1) + /// Proof: `SubtensorModule::LockingColdkeys` (`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: `2322` + // Measured: `2307` // Estimated: `8727` - // Minimum execution time: 425_000_000 picoseconds. - Weight::from_parts(443_000_000, 8727) - .saturating_add(RocksDbWeight::get().reads(36_u64)) - .saturating_add(RocksDbWeight::get().writes(15_u64)) + // Minimum execution time: 459_000_000 picoseconds. + Weight::from_parts(477_000_000, 8727) + .saturating_add(RocksDbWeight::get().reads(35_u64)) + .saturating_add(RocksDbWeight::get().writes(17_u64)) } /// Storage: `SubtensorModule::PendingChildKeyCooldown` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeyCooldown` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -6894,7 +6517,7 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(1_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -6931,22 +6554,22 @@ 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::LockingColdkeys` (r:1 w:1) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn lock_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `1842` - // Estimated: `7782` - // Minimum execution time: 73_000_000 picoseconds. - Weight::from_parts(75_000_000, 7782) - .saturating_add(RocksDbWeight::get().reads(20_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `1830` + // Estimated: `7770` + // Minimum execution time: 61_000_000 picoseconds. + Weight::from_parts(63_000_000, 7770) + .saturating_add(RocksDbWeight::get().reads(18_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`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::Lock` (r:3 w:2) + /// Storage: `SubtensorModule::Lock` (r:2 w:2) /// Proof: `SubtensorModule::Lock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -6964,16 +6587,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::LockingColdkeys` (r:2 w:2) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:2) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn move_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1722` - // Estimated: `10137` - // Minimum execution time: 90_000_000 picoseconds. - Weight::from_parts(93_000_000, 10137) - .saturating_add(RocksDbWeight::get().reads(20_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) + // Measured: `1515` + // Estimated: `7455` + // Minimum execution time: 80_000_000 picoseconds. + Weight::from_parts(84_000_000, 7455) + .saturating_add(RocksDbWeight::get().reads(15_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -6989,8 +6612,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1157` // Estimated: `4622` - // Minimum execution time: 370_000_000 picoseconds. - Weight::from_parts(377_000_000, 4622) + // Minimum execution time: 378_000_000 picoseconds. + Weight::from_parts(395_000_000, 4622) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7014,7 +6637,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `982` // Estimated: `4447` - // Minimum execution time: 26_000_000 picoseconds. + // Minimum execution time: 24_000_000 picoseconds. Weight::from_parts(27_000_000, 4447) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -7027,8 +6650,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 4198) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4198) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) @@ -7055,8 +6678,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1731` // Estimated: `7671` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(33_000_000, 7671) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(30_000_000, 7671) .saturating_add(RocksDbWeight::get().reads(11_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -7077,8 +6700,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1019` // Estimated: `4484` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 4484) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 4484) .saturating_add(RocksDbWeight::get().reads(7_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:1 w:0) @@ -7091,8 +6714,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `721` // Estimated: `4186` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 4186) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 4186) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -7105,8 +6728,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `647` // Estimated: `4112` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4112) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 4112) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -7117,8 +6740,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 4117) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 4117) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -7160,10 +6783,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `4079 + n * (45 ±0)` // Estimated: `9373 + n * (2520 ±0)` - // Minimum execution time: 61_000_000 picoseconds. - Weight::from_parts(99_046_630, 9373) - // Standard Error: 5_784 - .saturating_add(Weight::from_parts(1_804_489, 0).saturating_mul(n.into())) + // Minimum execution time: 53_000_000 picoseconds. + Weight::from_parts(56_000_000, 9373) + // Standard Error: 3_996 + .saturating_add(Weight::from_parts(1_961_926, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -7201,8 +6824,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `37406` // Estimated: `40871` - // Minimum execution time: 101_000_000 picoseconds. - Weight::from_parts(129_000_000, 40871) + // Minimum execution time: 116_000_000 picoseconds. + Weight::from_parts(124_000_000, 40871) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7251,10 +6874,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `4835 + n * (37 ±0)` // Estimated: `10114 + n * (2512 ±0)` - // Minimum execution time: 70_000_000 picoseconds. - Weight::from_parts(40_743_358, 10114) - // Standard Error: 6_939 - .saturating_add(Weight::from_parts(1_900_854, 0).saturating_mul(n.into())) + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(61_000_000, 10114) + // Standard Error: 4_010 + .saturating_add(Weight::from_parts(2_031_383, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -7292,8 +6915,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 125_000_000 picoseconds. - Weight::from_parts(141_000_000, 40392) + // Minimum execution time: 117_000_000 picoseconds. + Weight::from_parts(132_000_000, 40392) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7329,37 +6952,29 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `36927` // Estimated: `40392` - // Minimum execution time: 112_000_000 picoseconds. - Weight::from_parts(137_000_000, 40392) + // Minimum execution time: 113_000_000 picoseconds. + Weight::from_parts(130_000_000, 40392) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) + /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:4098 w:8194) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRate` (r:2 w:0) - /// Proof: `SubtensorModule::BasketRate` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketShares` (r:2 w:0) - /// Proof: `SubtensorModule::BasketShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) + /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:8193 w:8192) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::RootClaimable` (r:1 w:0) - /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:8194 w:0) + /// Storage: `SubtensorModule::Alpha` (r:8193 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:8194 w:8192) + /// Storage: `SubtensorModule::AlphaV2` (r:8193 w:8192) /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:4098 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MinerCollateral` (r:4097 w:0) - /// Proof: `SubtensorModule::MinerCollateral` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ChildKeys` (r:8194 w:8194) @@ -7390,14 +7005,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::VotingPower` (r:4097 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketDepositedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketDepositedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketRedeemedTao` (r:1 w:0) - /// Proof: `SubtensorModule::BasketRedeemedTao` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::BasketClaimed` (r:1 w:0) - /// Proof: `SubtensorModule::BasketClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingBasketDeposits` (r:1 w:0) - /// Proof: `SubtensorModule::PendingBasketDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Uids` (r:4096 w:8192) @@ -7422,20 +7029,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyRoot` (r:4096 w:4096) - /// Proof: `SubtensorModule::HotkeyRoot` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Keys` (r:0 w:4096) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:8192) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey_v2() -> Weight { // Proof Size summary in bytes: - // Measured: `544206` - // Estimated: `20825346` - // Minimum execution time: 739_639_000_000 picoseconds. - Weight::from_parts(773_406_000_000, 20825346) - .saturating_add(RocksDbWeight::get().reads(155695_u64)) - .saturating_add(RocksDbWeight::get().writes(90131_u64)) + // Measured: `542010` + // Estimated: `20823150` + // Minimum execution time: 572_681_000_000 picoseconds. + Weight::from_parts(594_286_000_000, 20823150) + .saturating_add(RocksDbWeight::get().reads(151588_u64)) + .saturating_add(RocksDbWeight::get().writes(77845_u64)) } /// Storage: `SubtensorModule::MinChildkeyTake` (r:0 w:1) /// Proof: `SubtensorModule::MinChildkeyTake` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -7443,8 +7046,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxChildkeyTake` (r:0 w:1) @@ -7453,14 +7056,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -7477,17 +7076,13 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1185` - // Estimated: `4650` - // Minimum execution time: 55_000_000 picoseconds. - Weight::from_parts(61_000_000, 4650) - .saturating_add(RocksDbWeight::get().reads(9_u64)) + // Measured: `1080` + // Estimated: `4545` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(52_000_000, 4545) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } - /// Storage: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x658faa385070e074c85bf6b568cf0555396cec59f418eabc5c59acdbc165c0ab` (r:1 w:0) - /// Storage: `SubtensorModule::DeferredRootAlphaDividends` (r:1 w:0) - /// Proof: `SubtensorModule::DeferredRootAlphaDividends` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:1) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::BalancerTaoReservoir` (r:1 w:1) @@ -7504,11 +7099,11 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) fn root_dissolve_network() -> Weight { // Proof Size summary in bytes: - // Measured: `1185` - // Estimated: `4650` - // Minimum execution time: 54_000_000 picoseconds. - Weight::from_parts(64_000_000, 4650) - .saturating_add(RocksDbWeight::get().reads(9_u64)) + // Measured: `1080` + // Estimated: `4545` + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(51_000_000, 4545) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `SubtensorModule::TransactionKeyLastBlock` (r:1 w:1) @@ -7540,14 +7135,12 @@ impl WeightInfo for () { /// Storage: `SubtensorModule::PendingChildKeys` (r:0 w:1) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[1, 5]`. - fn set_children(c: u32, ) -> Weight { + fn set_children(_c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1536` // Estimated: `9951` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(62_257_943, 9951) - // Standard Error: 51_019 - .saturating_add(Weight::from_parts(73_831, 0).saturating_mul(c.into())) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(55_660_572, 9951) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7570,8 +7163,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(17_000_000, 4203) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 4203) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -7587,8 +7180,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(18_000_000, 4264) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4264) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -7600,8 +7193,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 4084) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -7651,12 +7244,10 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::MinNonImmuneUids` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:1 w:1) /// Proof: `SubtensorModule::SubnetAlphaIn` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) - /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Swap::SwapBalancer` (r:1 w:1) - /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) /// Storage: `Swap::FeeRate` (r:1 w:0) /// Proof: `Swap::FeeRate` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`) + /// Storage: `SubtensorModule::SubnetTAO` (r:1 w:1) + /// Proof: `SubtensorModule::SubnetTAO` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Swap::PalSwapInitialized` (r:1 w:1) /// Proof: `Swap::PalSwapInitialized` (`max_values`: None, `max_size`: Some(11), added: 2486, mode: `MaxEncodedLen`) /// Storage: `SubtensorModule::SubnetAlphaOut` (r:1 w:1) @@ -7679,8 +7270,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::AlphaV2` (`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::ColdkeyCollateralHotkeys` (r:1 w:1) - /// Proof: `SubtensorModule::ColdkeyCollateralHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::CollateralDrainRatio` (r:1 w:0) /// Proof: `SubtensorModule::CollateralDrainRatio` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ColdkeyMinerCollateral` (r:1 w:1) @@ -7725,18 +7314,20 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Prometheus` (r:0 w:1) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeySuccessor` (r:0 w:1) - /// Proof: `SubtensorModule::HotkeySuccessor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::IsNetworkMember` (r:0 w:2) /// Proof: `SubtensorModule::IsNetworkMember` (`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`) + /// Storage: `Swap::SwapBalancer` (r:0 w:1) + /// Proof: `Swap::SwapBalancer` (`max_values`: None, `max_size`: Some(18), added: 2493, mode: `MaxEncodedLen`) fn register_limit() -> Weight { // Proof Size summary in bytes: // Measured: `289796` // Estimated: `926861` - // Minimum execution time: 2_987_000_000 picoseconds. - Weight::from_parts(3_170_000_000, 926861) - .saturating_add(RocksDbWeight::get().reads(825_u64)) - .saturating_add(RocksDbWeight::get().writes(299_u64)) + // Minimum execution time: 2_829_000_000 picoseconds. + Weight::from_parts(345_012_000, 6148) + .saturating_add(RocksDbWeight::get().reads(34_u64)) + .saturating_add(RocksDbWeight::get().writes(29_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -7758,30 +7349,30 @@ 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::LockingColdkeys` (r:1 w:0) + /// Storage: `SubtensorModule::LockingColdkeys` (r:0 w:1) /// Proof: `SubtensorModule::LockingColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_perpetual_lock() -> Weight { // Proof Size summary in bytes: - // Measured: `1241` - // Estimated: `7181` - // Minimum execution time: 64_000_000 picoseconds. - Weight::from_parts(69_000_000, 7181) - .saturating_add(RocksDbWeight::get().reads(12_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `1226` + // Estimated: `7166` + // Minimum execution time: 52_000_000 picoseconds. + Weight::from_parts(54_000_000, 7166) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) } fn set_tempo() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) + // Minimum execution time: 783_000 picoseconds. + Weight::from_parts(887_000, 0) } fn set_activity_cutoff_factor() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_000_000, 0) + // Minimum execution time: 803_000 picoseconds. + Weight::from_parts(891_000, 0) } /// Storage: `SubtensorModule::AccountFlags` (r:1 w:1) /// Proof: `SubtensorModule::AccountFlags` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -7789,8 +7380,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `562` // Estimated: `4027` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 4027) + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_000_000, 4027) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } From a4b94f33a6852dd83fbc03b459b0f0ce2ad97e86 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Tue, 1 Sep 2026 15:50:28 -0400 Subject: [PATCH 13/14] Invoke aggregate rebuilding migration --- node/src/cli.rs | 4 ++++ node/src/clone_spec.rs | 6 ++++++ pallets/subtensor/src/macros/hooks.rs | 4 +++- runtime/src/lib.rs | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/node/src/cli.rs b/node/src/cli.rs index 834d03bd9a..dcf7eccdfa 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -136,6 +136,10 @@ pub struct CloneStateCmd { #[arg(long, value_name = "BOOTNODE")] pub bootnodes: Vec, + /// Optional reserved nodes for the sync step. Repeatable. + #[arg(long, value_name = "RESERVED_NODE")] + pub reserved_nodes: Vec, + /// Include Alice in patched validator authorities (default if no validator flags are passed; /// Sudo is assigned to the first selected validator in Alice->Bob->Charlie order). #[arg(long, default_value_t = false)] diff --git a/node/src/clone_spec.rs b/node/src/clone_spec.rs index dba70bf117..0059235fe0 100644 --- a/node/src/clone_spec.rs +++ b/node/src/clone_spec.rs @@ -110,6 +110,11 @@ async fn async_run(cmd: &CloneStateCmd, skip_history_backfill: bool) -> CloneRes sync_args.push(bootnode.clone()); } + for reserved_node in &cmd.reserved_nodes { + sync_args.push("--reserved-nodes".to_string()); + sync_args.push(reserved_node.clone()); + } + log::info!("build-patched-spec: starting sync node"); let mut sync_child = Command::new(¤t_exe) @@ -545,6 +550,7 @@ mod tests { sync_timeout_sec: 10, sync_lag_blocks: 8, bootnodes: Vec::new(), + reserved_nodes: Vec::new(), alice: false, bob: false, charlie: false, diff --git a/pallets/subtensor/src/macros/hooks.rs b/pallets/subtensor/src/macros/hooks.rs index 21083cee07..3259c71c03 100644 --- a/pallets/subtensor/src/macros/hooks.rs +++ b/pallets/subtensor/src/macros/hooks.rs @@ -227,7 +227,9 @@ mod hooks { .saturating_add(migrations::migrate_storage_bloat_v2::kickoff_storage_bloat_cleanup::()) // Schedule stale StakingHotkeys relationship cleanup. It runs after storage GC // and uses only otherwise-unused on_idle weight; normal operations stay enabled. - .saturating_add(migrations::migrate_cleanup_staking_hotkeys::kickoff_staking_hotkeys_cleanup::()); + .saturating_add(migrations::migrate_cleanup_staking_hotkeys::kickoff_staking_hotkeys_cleanup::()) + // Rebuild the corrupted conviction lock aggregates + .saturating_add(migrations::migrate_rebuild_conviction_aggregates::migrate_rebuild_conviction_aggregates::()); // The beta-baseline seed (`migrate_stamp_beta_baselines`) runs from the // runtime `Migrations` tuple instead of this hook, so try-runtime validates // its pre/post-upgrade invariants against real network state. diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 900421a9c6..185469a8dc 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -235,7 +235,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: 451, + spec_version: 452, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From d65ed09a56e3470d32a7ad9cd669e68dd71dac83 Mon Sep 17 00:00:00 2001 From: UnarbosFour Date: Tue, 1 Sep 2026 15:50:58 -0400 Subject: [PATCH 14/14] spec 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 185469a8dc..87cda31f7c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -235,7 +235,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: 452, + spec_version: 453, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,