Skip to content

Commit d00cfc1

Browse files
committed
Add benchmark for trim_to_max_uids
1 parent 7ae3dc8 commit d00cfc1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pallets/admin-utils/src/benchmarking.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,5 +346,16 @@ mod benchmarks {
346346
_(RawOrigin::Root, 5u16/*version*/)/*sudo_set_commit_reveal_version()*/;
347347
}
348348

349+
#[benchmark]
350+
fn sudo_trim_to_max_allowed_uids() {
351+
pallet_subtensor::Pallet::<T>::init_new_network(
352+
1u16.into(), /*netuid*/
353+
1u16, /*sudo_tempo*/
354+
);
355+
356+
#[extrinsic_call]
357+
_(RawOrigin::Root, 1u16.into()/*netuid*/, 4097u16/*max_allowed_uids*/)/*sudo_trim_to_max_allowed_uids()*/;
358+
}
359+
349360
//impl_benchmark_test_suite!(AdminUtils, crate::mock::new_test_ext(), crate::mock::Test);
350361
}

pallets/subtensor/src/subnets/uids.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<T: Config> Pallet<T> {
193193
// Remove tao dividends for the hotkey
194194
TaoDividendsPerSubnet::<T>::remove(netuid, &hotkey);
195195
}
196-
#[allow(unknown_lints)]
196+
#[allow(unknown_lints)]
197197
Keys::<T>::remove(netuid, uid);
198198
// Remove block at registration for the uid
199199
BlockAtRegistration::<T>::remove(netuid, uid);

0 commit comments

Comments
 (0)