diff --git a/pallets/admin-utils/src/benchmarking.rs b/pallets/admin-utils/src/benchmarking.rs index b8dafc0de..54ede60a1 100644 --- a/pallets/admin-utils/src/benchmarking.rs +++ b/pallets/admin-utils/src/benchmarking.rs @@ -20,6 +20,9 @@ mod benchmarks { #[benchmark] fn swap_authorities(a: Linear<0, 32>) { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); + let mut value: BoundedVec< ::AuthorityId, ::MaxAuthorities, @@ -39,6 +42,8 @@ mod benchmarks { #[benchmark] fn schedule_grandpa_change(a: Linear<0, 32>) { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); let next_authorities = (1..=a) .map(|idx| account("Authority", idx, 0u32)) .collect::>(); @@ -50,18 +55,24 @@ mod benchmarks { #[benchmark] fn sudo_set_default_take() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); #[extrinsic_call] _(RawOrigin::Root, 100u16/*default_take*/)/*sudo_set_default_take*/; } #[benchmark] fn sudo_set_serving_rate_limit() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); #[extrinsic_call] _(RawOrigin::Root, 1u16.into()/*netuid*/, 100u64/*serving_rate_limit*/)/*sudo_set_serving_rate_limit*/; } #[benchmark] fn sudo_set_max_difficulty() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -73,6 +84,8 @@ mod benchmarks { #[benchmark] fn sudo_set_min_difficulty() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -84,6 +97,8 @@ mod benchmarks { #[benchmark] fn sudo_set_weights_set_rate_limit() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -95,6 +110,8 @@ mod benchmarks { #[benchmark] fn sudo_set_weights_version_key() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -106,6 +123,8 @@ mod benchmarks { #[benchmark] fn sudo_set_bonds_moving_average() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -117,6 +136,8 @@ mod benchmarks { #[benchmark] fn sudo_set_bonds_penalty() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -128,6 +149,8 @@ mod benchmarks { #[benchmark] fn sudo_set_max_allowed_validators() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -139,6 +162,8 @@ mod benchmarks { #[benchmark] fn sudo_set_difficulty() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -150,6 +175,8 @@ mod benchmarks { #[benchmark] fn sudo_set_adjustment_interval() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -161,6 +188,8 @@ mod benchmarks { #[benchmark] fn sudo_set_target_registrations_per_interval() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -172,6 +201,8 @@ mod benchmarks { #[benchmark] fn sudo_set_activity_cutoff() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -183,6 +214,8 @@ mod benchmarks { #[benchmark] fn sudo_set_rho() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -194,6 +227,8 @@ mod benchmarks { #[benchmark] fn sudo_set_kappa() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*sudo_tempo*/ @@ -205,6 +240,8 @@ mod benchmarks { #[benchmark] fn sudo_set_max_allowed_uids() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -216,6 +253,8 @@ mod benchmarks { #[benchmark] fn sudo_set_min_allowed_weights() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -227,6 +266,8 @@ mod benchmarks { #[benchmark] fn sudo_set_immunity_period() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -238,6 +279,8 @@ mod benchmarks { #[benchmark] fn sudo_set_max_weight_limit() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -249,6 +292,8 @@ mod benchmarks { #[benchmark] fn sudo_set_max_registrations_per_block() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -260,6 +305,8 @@ mod benchmarks { #[benchmark] fn sudo_set_max_burn() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -271,6 +318,8 @@ mod benchmarks { #[benchmark] fn sudo_set_min_burn() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -282,6 +331,8 @@ mod benchmarks { #[benchmark] fn sudo_set_network_registration_allowed() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -304,6 +355,8 @@ mod benchmarks { */ #[benchmark] fn sudo_set_tempo() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*tempo*/ @@ -315,6 +368,8 @@ mod benchmarks { #[benchmark] fn sudo_set_commit_reveal_weights_interval() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*sudo_tempo*/ @@ -326,6 +381,8 @@ mod benchmarks { #[benchmark] fn sudo_set_commit_reveal_weights_enabled() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*sudo_tempo*/ @@ -337,6 +394,8 @@ mod benchmarks { #[benchmark] fn sudo_set_commit_reveal_version() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*sudo_tempo*/ @@ -354,12 +413,16 @@ mod benchmarks { #[benchmark] fn sudo_set_owner_hparam_rate_limit() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); #[extrinsic_call] _(RawOrigin::Root, 10u64/*limit*/)/*sudo_set_owner_hparam_rate_limit*/; } #[benchmark] fn sudo_set_owner_immune_neuron_limit() { + // disable admin freeze window + pallet_subtensor::Pallet::::set_admin_freeze_window(0); pallet_subtensor::Pallet::::init_new_network( 1u16.into(), /*netuid*/ 1u16, /*sudo_tempo*/ diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index 4af202132..424fe1c6a 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -205,8 +205,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the serving rate limit. #[pallet::call_index(3)] - #[pallet::weight(Weight::from_parts(6_522_000, 0) - .saturating_add(::DbWeight::get().reads(0_u64)) + #[pallet::weight(Weight::from_parts(22_980_000, 0) + .saturating_add(::DbWeight::get().reads(2_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_serving_rate_limit( origin: OriginFor, @@ -232,8 +232,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the minimum difficulty. #[pallet::call_index(4)] - #[pallet::weight(Weight::from_parts(15_230_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_390_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_min_difficulty( origin: OriginFor, @@ -257,8 +257,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the maximum difficulty. #[pallet::call_index(5)] - #[pallet::weight(Weight::from_parts(15_700_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_990_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_difficulty( origin: OriginFor, @@ -291,8 +291,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the weights version key. #[pallet::call_index(6)] - #[pallet::weight(Weight::from_parts(17_460_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_220_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_weights_version_key( origin: OriginFor, @@ -420,8 +420,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the adjustment beta. #[pallet::call_index(12)] - #[pallet::weight(Weight::from_parts(15_170_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_890_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_weight_limit( origin: OriginFor, @@ -454,8 +454,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the immunity period. #[pallet::call_index(13)] - #[pallet::weight(Weight::from_parts(15_510_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_620_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_immunity_period( origin: OriginFor, @@ -488,8 +488,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the minimum allowed weights. #[pallet::call_index(14)] - #[pallet::weight(Weight::from_parts(15_220_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_630_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_min_allowed_weights( origin: OriginFor, @@ -550,8 +550,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the kappa. #[pallet::call_index(16)] - #[pallet::weight(Weight::from_parts(16_740_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_210_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_kappa(origin: OriginFor, netuid: NetUid, kappa: u16) -> DispatchResult { let maybe_owner = pallet_subtensor::Pallet::::ensure_sn_owner_or_root_with_limits( @@ -578,8 +578,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the rho. #[pallet::call_index(17)] - #[pallet::weight(Weight::from_parts(12_570_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(23_360_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_rho(origin: OriginFor, netuid: NetUid, rho: u16) -> DispatchResult { let maybe_owner = pallet_subtensor::Pallet::::ensure_sn_owner_or_root_with_limits( @@ -606,8 +606,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the activity cutoff. #[pallet::call_index(18)] - #[pallet::weight(Weight::from_parts(17_510_000, 0) - .saturating_add(::DbWeight::get().reads(2_u64)) + #[pallet::weight(Weight::from_parts(28_720_000, 0) + .saturating_add(::DbWeight::get().reads(4_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_activity_cutoff( origin: OriginFor, @@ -707,8 +707,8 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the target registrations per interval. #[pallet::call_index(21)] - #[pallet::weight(Weight::from_parts(15_320_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(25_860_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_target_registrations_per_interval( origin: OriginFor, @@ -735,8 +735,8 @@ pub mod pallet { /// It is only callable by root and subnet owner. /// The extrinsic will call the Subtensor pallet to set the minimum burn. #[pallet::call_index(22)] - #[pallet::weight(Weight::from_parts(18_870_000, 0) - .saturating_add(::DbWeight::get().reads(2_u64)) + #[pallet::weight(Weight::from_parts(29_970_000, 0) + .saturating_add(::DbWeight::get().reads(4_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_min_burn( origin: OriginFor, @@ -775,8 +775,8 @@ pub mod pallet { /// It is only callable by root and subnet owner. /// The extrinsic will call the Subtensor pallet to set the maximum burn. #[pallet::call_index(23)] - #[pallet::weight(Weight::from_parts(19_420_000, 0) - .saturating_add(::DbWeight::get().reads(2_u64)) + #[pallet::weight(Weight::from_parts(30_510_000, 0) + .saturating_add(::DbWeight::get().reads(4_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_burn( origin: OriginFor, @@ -815,8 +815,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the difficulty. #[pallet::call_index(24)] - #[pallet::weight(Weight::from_parts(15_650_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_230_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_difficulty( origin: OriginFor, @@ -837,8 +837,8 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the maximum allowed validators. #[pallet::call_index(25)] - #[pallet::weight(Weight::from_parts(19_300_000, 0) - .saturating_add(::DbWeight::get().reads(2_u64)) + #[pallet::weight(Weight::from_parts(30_930_000, 0) + .saturating_add(::DbWeight::get().reads(4_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_allowed_validators( origin: OriginFor, @@ -870,8 +870,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the bonds moving average. #[pallet::call_index(26)] - #[pallet::weight(Weight::from_parts(15_140_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_270_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_bonds_moving_average( origin: OriginFor, @@ -910,8 +910,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the bonds penalty. #[pallet::call_index(60)] - #[pallet::weight(Weight::from_parts(16_220_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_890_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_bonds_penalty( origin: OriginFor, @@ -942,8 +942,8 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the maximum registrations per block. #[pallet::call_index(27)] - #[pallet::weight(Weight::from_parts(15_080_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_970_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_registrations_per_block( origin: OriginFor, @@ -1010,8 +1010,8 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the tempo. #[pallet::call_index(30)] - #[pallet::weight(Weight::from_parts(15_180_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(25_790_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_tempo(origin: OriginFor, netuid: NetUid, tempo: u16) -> DispatchResult { pallet_subtensor::Pallet::::ensure_root_with_rate_limit(origin, netuid)?; @@ -1194,8 +1194,8 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the value. #[pallet::call_index(49)] - #[pallet::weight(Weight::from_parts(15_150_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_730_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_commit_reveal_weights_enabled( origin: OriginFor, @@ -1362,8 +1362,8 @@ pub mod pallet { /// # Weight /// Weight is handled by the `#[pallet::weight]` attribute. #[pallet::call_index(57)] - #[pallet::weight(Weight::from_parts(19_320_000, 0) - .saturating_add(::DbWeight::get().reads(1_u64)) + #[pallet::weight(Weight::from_parts(26_950_000, 0) + .saturating_add(::DbWeight::get().reads(3_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_commit_reveal_weights_interval( origin: OriginFor, @@ -1786,8 +1786,8 @@ pub mod pallet { /// Sets the number of immune owner neurons #[pallet::call_index(72)] - #[pallet::weight(Weight::from_parts(4_639_000, 0) - .saturating_add(::DbWeight::get().reads(0_u64)) + #[pallet::weight(Weight::from_parts(18_020_000, 0) + .saturating_add(::DbWeight::get().reads(2_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_owner_immune_neuron_limit( origin: OriginFor, @@ -1825,7 +1825,12 @@ pub mod pallet { /// Sets the admin freeze window length (in blocks) at the end of a tempo. /// Only callable by root. #[pallet::call_index(74)] - #[pallet::weight((0, DispatchClass::Operational, Pays::No))] + #[pallet::weight(( + Weight::from_parts(5_771_000, 0) + .saturating_add(::DbWeight::get().reads(0_u64)) + .saturating_add(::DbWeight::get().writes(1_u64)), + DispatchClass::Operational + ))] pub fn sudo_set_admin_freeze_window(origin: OriginFor, window: u16) -> DispatchResult { ensure_root(origin)?; pallet_subtensor::Pallet::::set_admin_freeze_window(window); @@ -1836,7 +1841,12 @@ pub mod pallet { /// Sets the owner hyperparameter rate limit (in blocks). /// Only callable by root. #[pallet::call_index(75)] - #[pallet::weight((0, DispatchClass::Operational, Pays::No))] + #[pallet::weight(( + Weight::from_parts(5_701_000, 0) + .saturating_add(::DbWeight::get().reads(0_u64)) + .saturating_add(::DbWeight::get().writes(1_u64)), + DispatchClass::Operational + ))] pub fn sudo_set_owner_hparam_rate_limit( origin: OriginFor, limit: u64, diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 1325a6258..a8b981048 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -302,7 +302,7 @@ mod dispatches { /// #[pallet::call_index(100)] #[pallet::weight((Weight::from_parts(100_500_000, 0) - .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] pub fn batch_commit_weights( origin: OriginFor, @@ -932,7 +932,7 @@ mod dispatches { /// - The ip type v4 or v6. /// #[pallet::call_index(5)] - #[pallet::weight((Weight::from_parts(42_000_000, 0) + #[pallet::weight((Weight::from_parts(29_760_000, 0) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Normal, Pays::No))] pub fn serve_prometheus( @@ -1299,8 +1299,8 @@ mod dispatches { /// User register a new subnetwork #[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().reads(37_u64)) + .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) } @@ -1586,8 +1586,8 @@ mod dispatches { /// User register a new subnetwork #[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().reads(36_u64)) + .saturating_add(T::DbWeight::get().writes(50_u64)), DispatchClass::Normal, Pays::Yes))] pub fn register_network_with_identity( origin: OriginFor, hotkey: T::AccountId,