From 0ab2651e8ba0249008316fe2e477c500a5acca31 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Wed, 3 Sep 2025 15:29:13 +0300 Subject: [PATCH 1/3] Set pays::yes for extrinsics. --- pallets/commitments/src/lib.rs | 2 +- pallets/subtensor/src/macros/dispatches.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pallets/commitments/src/lib.rs b/pallets/commitments/src/lib.rs index a7d887b87..06a44aedd 100644 --- a/pallets/commitments/src/lib.rs +++ b/pallets/commitments/src/lib.rs @@ -332,7 +332,7 @@ pub mod pallet { .saturating_add(T::DbWeight::get().reads(0_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)), DispatchClass::Operational, - Pays::No + Pays::Yes ))] pub fn set_max_space(origin: OriginFor, new_limit: u32) -> DispatchResult { ensure_root(origin)?; diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 1a712276f..67315f721 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -796,7 +796,7 @@ mod dispatches { #[pallet::call_index(62)] #[pallet::weight((Weight::from_parts(111_700_000, 0) .saturating_add(T::DbWeight::get().reads(23)) - .saturating_add(T::DbWeight::get().writes(20)), DispatchClass::Normal, Pays::No))] + .saturating_add(T::DbWeight::get().writes(20)), DispatchClass::Normal, Pays::Yes))] pub fn root_register(origin: OriginFor, hotkey: T::AccountId) -> DispatchResult { Self::do_root_register(origin, hotkey) } @@ -855,7 +855,7 @@ mod dispatches { #[pallet::call_index(71)] #[pallet::weight((Weight::from_parts(161_700_000, 0) .saturating_add(T::DbWeight::get().reads(14)) - .saturating_add(T::DbWeight::get().writes(9)), DispatchClass::Operational, Pays::No))] + .saturating_add(T::DbWeight::get().writes(9)), DispatchClass::Operational, Pays::Yes))] pub fn swap_coldkey( origin: OriginFor, old_coldkey: T::AccountId, @@ -937,7 +937,7 @@ mod dispatches { .saturating_add(T::DbWeight::get().reads(0)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Operational, - Pays::No + Pays::Yes ))] pub fn sudo_set_tx_childkey_take_rate_limit( origin: OriginFor, @@ -965,7 +965,7 @@ mod dispatches { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Operational, - Pays::No + Pays::Yes ))] pub fn sudo_set_min_childkey_take(origin: OriginFor, take: u16) -> DispatchResult { ensure_root(origin)?; @@ -990,7 +990,7 @@ mod dispatches { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Operational, - Pays::No + Pays::Yes ))] pub fn sudo_set_max_childkey_take(origin: OriginFor, take: u16) -> DispatchResult { ensure_root(origin)?; @@ -1019,7 +1019,7 @@ mod dispatches { /// ## Complexity /// - O(1). #[pallet::call_index(51)] - #[pallet::weight((Weight::from_parts(111_100_000, 0), DispatchClass::Operational, Pays::No))] + #[pallet::weight((Weight::from_parts(111_100_000, 0), DispatchClass::Operational, Pays::Yes))] pub fn sudo( origin: OriginFor, call: Box, @@ -1044,7 +1044,7 @@ mod dispatches { /// - O(1). #[allow(deprecated)] #[pallet::call_index(52)] - #[pallet::weight((*weight, call.get_dispatch_info().class, Pays::No))] + #[pallet::weight((*weight, call.get_dispatch_info().class, Pays::Yes))] pub fn sudo_unchecked_weight( origin: OriginFor, call: Box, @@ -1113,7 +1113,7 @@ mod dispatches { #[pallet::call_index(61)] #[pallet::weight((Weight::from_parts(119_000_000, 0) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(31)), DispatchClass::Operational, Pays::No))] + .saturating_add(T::DbWeight::get().writes(31)), DispatchClass::Operational, Pays::Yes))] pub fn dissolve_network( origin: OriginFor, coldkey: T::AccountId, @@ -1890,7 +1890,7 @@ mod dispatches { /// Sets the pending childkey cooldown (in blocks). Root only. #[pallet::call_index(109)] - #[pallet::weight((Weight::from_parts(10_000, 0), DispatchClass::Operational, Pays::No))] + #[pallet::weight((Weight::from_parts(10_000, 0), DispatchClass::Operational, Pays::Yes))] pub fn set_pending_childkey_cooldown( origin: OriginFor, cooldown: u64, From a2abbaf8369a76eb08344b7cb3dda8948f93b27f Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Wed, 10 Sep 2025 14:03:30 +0300 Subject: [PATCH 2/3] Bump spec_version to 316 --- 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 aee1e0489..6f3929de0 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -220,7 +220,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: 315, + spec_version: 316, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From f567348237746510dc40cee3651572d122af3e68 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 Sep 2025 14:15:30 +0000 Subject: [PATCH 3/3] auto-update benchmark weights --- pallets/subtensor/src/macros/dispatches.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index fc26cd5d9..96d87080b 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -623,7 +623,7 @@ mod dispatches { /// - Attempting to set prometheus information withing the rate limit min. /// #[pallet::call_index(40)] - #[pallet::weight((Weight::from_parts(41_240_000, 0) + #[pallet::weight((Weight::from_parts(32_530_000, 0) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Normal, Pays::No))] pub fn serve_axon_tls( @@ -1041,7 +1041,7 @@ mod dispatches { #[pallet::call_index(59)] #[pallet::weight((Weight::from_parts(235_400_000, 0) .saturating_add(T::DbWeight::get().reads(36)) - .saturating_add(T::DbWeight::get().writes(52)), DispatchClass::Normal, Pays::Yes))] + .saturating_add(T::DbWeight::get().writes(51_u64)), DispatchClass::Normal, Pays::Yes))] pub fn register_network(origin: OriginFor, hotkey: T::AccountId) -> DispatchResult { Self::do_register_network(origin, &hotkey, 1, None) } @@ -1253,7 +1253,7 @@ mod dispatches { /// - The ip type v4 or v6. /// #[pallet::call_index(68)] - #[pallet::weight((Weight::from_parts(30_550_000, 0) + #[pallet::weight((Weight::from_parts(38_230_000, 0) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Normal, Pays::Yes))] pub fn set_identity( @@ -1295,7 +1295,7 @@ mod dispatches { /// * `subnet_contact` (Vec): /// - The contact information for the subnet. #[pallet::call_index(78)] - #[pallet::weight((Weight::from_parts(18_980_000, 0) + #[pallet::weight((Weight::from_parts(24_350_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Normal, Pays::Yes))] pub fn set_subnet_identity( @@ -1328,7 +1328,7 @@ mod dispatches { #[pallet::call_index(79)] #[pallet::weight((Weight::from_parts(234_200_000, 0) .saturating_add(T::DbWeight::get().reads(35)) - .saturating_add(T::DbWeight::get().writes(51)), DispatchClass::Normal, Pays::Yes))] + .saturating_add(T::DbWeight::get().writes(50_u64)), DispatchClass::Normal, Pays::Yes))] pub fn register_network_with_identity( origin: OriginFor, hotkey: T::AccountId, @@ -1989,7 +1989,7 @@ mod dispatches { /// * commit_reveal_version (`u16`): /// - The client (bittensor-drand) version #[pallet::call_index(113)] - #[pallet::weight((Weight::from_parts(80_690_000, 0) + #[pallet::weight((Weight::from_parts(63_160_000, 0) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] pub fn commit_timelocked_weights(