Skip to content

Commit a75c6f5

Browse files
authored
Merge pull request #2103 from opentensor/feat/old-uids-immuner-than-new
Change sorting order by block of registration for immune keys
2 parents 7c52e40 + f27a8fa commit a75c6f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pallets/subtensor/src/subnets/registration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ impl<T: Config> Pallet<T> {
409409
})
410410
.collect();
411411

412-
// Sort by BlockAtRegistration (descending), then by uid (ascending)
412+
// Sort by BlockAtRegistration (ascending), then by uid (ascending)
413413
// Recent registration is priority so that we can let older keys expire (get non-immune)
414-
triples.sort_by(|(b1, u1, _), (b2, u2, _)| b2.cmp(b1).then(u1.cmp(u2)));
414+
triples.sort_by(|(b1, u1, _), (b2, u2, _)| b1.cmp(b2).then(u1.cmp(u2)));
415415

416416
// Keep first ImmuneOwnerUidsLimit
417417
let limit = ImmuneOwnerUidsLimit::<T>::get(netuid).into();

0 commit comments

Comments
 (0)