Skip to content

Conversation

JohnReedV
Copy link
Contributor

Description

This PR removes a duplicate hyperparameter extrinsic in admin-utils.

@JohnReedV JohnReedV added skip-cargo-audit This PR fails cargo audit but needs to be merged anyway apply-benchmark-patch labels Oct 8, 2025
// DispatchError::BadOrigin
// );
// });
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// }

Trust VCS. If you'll ever need this code back, it will be in the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented it out instead of deleting it to make it more difficult for somebody to re-use the extrinsic index. Substrate doesn't like that.

Comment on lines 1670 to 1691
/// Change the SubnetOwnerHotkey for a given subnet.
///
/// # Arguments
/// * `origin` - The origin of the call, which must be the subnet owner.
/// * `netuid` - The unique identifier for the subnet.
/// * `hotkey` - The new hotkey for the subnet owner.
///
/// # Errors
/// * `BadOrigin` - If the caller is not the subnet owner or root account.
///
/// # Weight
/// Weight is handled by the `#[pallet::weight]` attribute.
#[pallet::call_index(64)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
pub fn sudo_set_subnet_owner_hotkey(
origin: OriginFor<T>,
netuid: NetUid,
hotkey: <T as frame_system::Config>::AccountId,
) -> DispatchResult {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner(origin.clone(), netuid)?;
pallet_subtensor::Pallet::<T>::set_subnet_owner_hotkey(netuid, &hotkey);

log::debug!("SubnetOwnerHotkeySet( netuid: {netuid:?}, hotkey: {hotkey:?} )");
Ok(())
pallet_subtensor::Pallet::<T>::do_set_sn_owner_hotkey(origin, netuid, &hotkey)
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

There is another function that does the same thing in the same file, one has "sn" in the name and the other has "subnet". Do we need both? What for?

I'm not sure which one Cortex uses, I'd keep that one and remove the other one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cortex uses neither at the moment.

@ppolewicz
Copy link
Collaborator

Actually, I looked at the copy of the code on the main branch - perhaps there were some changes earlier in devnet-ready that this PR is cleaning up, but it was not linked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants