Skip to content

Commit 11c281f

Browse files
committed
Merge branch 'trim_uids' of github.com:opentensor/subtensor into trim_uids
2 parents 3c0ffb1 + d00cfc1 commit 11c281f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ impl<T: Config> Pallet<T> {
194194
// Remove tao dividends for the hotkey
195195
TaoDividendsPerSubnet::<T>::remove(netuid, &hotkey);
196196
}
197+
#[allow(unknown_lints)]
197198
Keys::<T>::remove(netuid, uid);
198199
// Remove block at registration for the uid
199200
BlockAtRegistration::<T>::remove(netuid, uid);

0 commit comments

Comments
 (0)