diff --git a/pallets/subtensor/src/migrations/migrate_rao.rs b/pallets/subtensor/src/migrations/migrate_rao.rs index 2b325aadcf..13ff02c118 100644 --- a/pallets/subtensor/src/migrations/migrate_rao.rs +++ b/pallets/subtensor/src/migrations/migrate_rao.rs @@ -98,8 +98,12 @@ pub fn migrate_rao() -> Weight { SubnetOwnerHotkey::::insert(netuid, owner_coldkey.clone()); // Associate the coldkey to coldkey. Pallet::::create_account_if_non_existent(&owner_coldkey, &owner_coldkey); - // Register the owner_coldkey as neuron to the network. - let _neuron_uid: u16 = Pallet::::register_neuron(*netuid, &owner_coldkey); + + // Only register the owner coldkey if it's not already a hotkey on the subnet. + if !Uids::::contains_key(*netuid, &owner_coldkey) { + // Register the owner_coldkey as neuron to the network. + let _neuron_uid: u16 = Pallet::::register_neuron(*netuid, &owner_coldkey); + } // Register the neuron immediately. if !Identities::::contains_key(owner_coldkey.clone()) { // Set the identitiy for the Owner coldkey if non existent.