From f27a8fad5ba503d0869937fd49352bab619a37cb Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Fri, 3 Oct 2025 11:36:01 -0400 Subject: [PATCH] Change sorting order by block of registration for immune keys --- pallets/subtensor/src/subnets/registration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/subtensor/src/subnets/registration.rs b/pallets/subtensor/src/subnets/registration.rs index bd7bdeed57..418c9cbde9 100644 --- a/pallets/subtensor/src/subnets/registration.rs +++ b/pallets/subtensor/src/subnets/registration.rs @@ -409,9 +409,9 @@ impl Pallet { }) .collect(); - // Sort by BlockAtRegistration (descending), then by uid (ascending) + // Sort by BlockAtRegistration (ascending), then by uid (ascending) // Recent registration is priority so that we can let older keys expire (get non-immune) - triples.sort_by(|(b1, u1, _), (b2, u2, _)| b2.cmp(b1).then(u1.cmp(u2))); + triples.sort_by(|(b1, u1, _), (b2, u2, _)| b1.cmp(b2).then(u1.cmp(u2))); // Keep first ImmuneOwnerUidsLimit let limit = ImmuneOwnerUidsLimit::::get(netuid).into();