Skip to content

Commit

Permalink
Remove references to T::Subtensor in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
keithtensor committed Aug 2, 2024
1 parent 063cf57 commit 5181bef
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions pallets/admin-utils/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,159 +47,159 @@ mod benchmarks {

#[benchmark]
fn sudo_set_max_difficulty() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 10000u64/*max_difficulty*/)/*sudo_set_max_difficulty*/;
}

#[benchmark]
fn sudo_set_min_difficulty() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 1000u64/*min_difficulty*/)/*sudo_set_min_difficulty*/;
}

#[benchmark]
fn sudo_set_weights_set_rate_limit() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 3u64/*rate_limit*/)/*sudo_set_weights_set_rate_limit*/;
}

#[benchmark]
fn sudo_set_weights_version_key() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 1u64/*version_key*/)/*sudo_set_weights_version_key*/;
}

#[benchmark]
fn sudo_set_bonds_moving_average() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 100u64/*bonds_moving_average*/)/*sudo_set_bonds_moving_average*/;
}

#[benchmark]
fn sudo_set_max_allowed_validators() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 10u16/*max_allowed_validators*/)/*sudo_set_max_allowed_validators*/;
}

#[benchmark]
fn sudo_set_difficulty() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 1200000u64/*difficulty*/)/*sudo_set_difficulty*/;
}

#[benchmark]
fn sudo_set_adjustment_interval() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 12u16/*adjustment_interval*/)/*sudo_set_adjustment_interval*/;
}

#[benchmark]
fn sudo_set_target_registrations_per_interval() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 300u16/*target_registrations*/)/*sudo_set_target_registrations_per_interval*/;
}

#[benchmark]
fn sudo_set_activity_cutoff() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 300u16/*activity_cutoff*/)/*sudo_set_activity_cutoff*/;
}

#[benchmark]
fn sudo_set_rho() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 300u16/*rho*/)/*sudo_set_rho*/;
}

#[benchmark]
fn sudo_set_kappa() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 3u16/*kappa*/)/*set_kappa*/;
}

#[benchmark]
fn sudo_set_max_allowed_uids() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 4097u16/*max_allowed_uids*/)/*sudo_set_max_allowed_uids*/;
}

#[benchmark]
fn sudo_set_min_allowed_weights() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 10u16/*max_allowed_uids*/)/*sudo_set_min_allowed_weights*/;
}

#[benchmark]
fn sudo_set_immunity_period() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 100u16/*immunity_period*/)/*sudo_set_immunity_period*/;
}

#[benchmark]
fn sudo_set_max_weight_limit() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 100u16/*max_weight_limit*/)/*sudo_set_max_weight_limit*/;
}

#[benchmark]
fn sudo_set_max_registrations_per_block() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 100u16/*max_registrations*/)/*sudo_set_max_registrations_per_block*/;
}

#[benchmark]
fn sudo_set_max_burn() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 10u64/*max_burn*/)/*sudo_set_max_burn*/;
}

#[benchmark]
fn sudo_set_min_burn() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 10u64/*min_burn*/)/*sudo_set_min_burn*/;
}

#[benchmark]
fn sudo_set_network_registration_allowed() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, true/*registration_allowed*/)/*sudo_set_network_registration_allowed*/;
Expand All @@ -212,29 +212,29 @@ mod benchmarks {
let tempo: u16 = 15;
let modality: u16 = 0;
T::Subtensor::init_new_network(netuid, tempo);
pallet_subtensor::Pallet::<T>::init_new_network(netuid, tempo);
}: sudo_set_tempo(RawOrigin::<AccountIdOf<T>>::Root, netuid, tempo)
*/
#[benchmark]
fn sudo_set_tempo() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 1u16/*tempo*/)/*sudo_set_tempo*/;
}

#[benchmark]
fn sudo_set_commit_reveal_weights_interval() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, 3u64/*interval*/)/*set_commit_reveal_weights_interval()*/;
}

#[benchmark]
fn sudo_set_commit_reveal_weights_enabled() {
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);

#[extrinsic_call]
_(RawOrigin::Root, 1u16/*netuid*/, true/*enabled*/)/*set_commit_reveal_weights_enabled*/;
Expand Down

0 comments on commit 5181bef

Please sign in to comment.