Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub enum ProxyType {
Registration,
Transfer,
SmallTransfer,
RootWeights,
RootWeights, // deprecated
ChildKeys,
SudoUncheckedSetCode,
SwapHotkey,
Expand Down
91 changes: 0 additions & 91 deletions pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,21 +957,6 @@ pub mod pallet {
Ok(())
}

/// The extrinsic sets the subnet limit for the network.
/// It is only callable by the root account.
/// The extrinsic will call the Subtensor pallet to set the subnet limit.
#[pallet::call_index(37)]
#[pallet::weight((
Weight::from_parts(14_000_000, 0)
.saturating_add(<T as frame_system::Config>::DbWeight::get().writes(1)),
DispatchClass::Operational,
Pays::No
))]
pub fn sudo_set_subnet_limit(origin: OriginFor<T>, _max_subnets: u16) -> DispatchResult {
ensure_root(origin)?;
Ok(())
}

/// The extrinsic sets the lock reduction interval for the network.
/// It is only callable by the root account.
/// The extrinsic will call the Subtensor pallet to set the lock reduction interval.
Expand Down Expand Up @@ -1076,26 +1061,6 @@ pub mod pallet {
Ok(())
}

// The extrinsic sets the target stake per interval.
// It is only callable by the root account.
// The extrinsic will call the Subtensor pallet to set target stake per interval.
// #[pallet::call_index(47)]
// #[pallet::weight((0, DispatchClass::Operational, Pays::No))]
// pub fn sudo_set_target_stakes_per_interval(
// origin: OriginFor<T>,
// target_stakes_per_interval: u64,
// ) -> DispatchResult {
// ensure_root(origin)?;
// pallet_subtensor::Pallet::<T>::set_target_stakes_per_interval(
// target_stakes_per_interval,
// );
// log::debug!(
// "TxTargetStakesPerIntervalSet( set_target_stakes_per_interval: {:?} ) ",
// target_stakes_per_interval
// ); (DEPRECATED)
// Ok(())
// } (DEPRECATED)

/// The extrinsic enabled/disables commit/reaveal for a given subnet.
/// It is only callable by the root account or subnet owner.
/// The extrinsic will call the Subtensor pallet to set the value.
Expand Down Expand Up @@ -1157,62 +1122,6 @@ pub mod pallet {
)
}

// DEPRECATED
// #[pallet::call_index(52)]
// #[pallet::weight((0, DispatchClass::Operational, Pays::No))]
// pub fn sudo_set_hotkey_emission_tempo(
// origin: OriginFor<T>,
// emission_tempo: u64,
// ) -> DispatchResult {
// ensure_root(origin)?;
// pallet_subtensor::Pallet::<T>::set_hotkey_emission_tempo(emission_tempo);
// log::debug!(
// "HotkeyEmissionTempoSet( emission_tempo: {:?} )",
// emission_tempo
// );
// Ok(())
// }

/// Sets the maximum stake allowed for a specific network.
///
/// This function allows the root account to set the maximum stake for a given network.
/// It updates the network's maximum stake value and logs the change.
///
/// # Arguments
///
/// * `origin` - The origin of the call, which must be the root account.
/// * `netuid` - The unique identifier of the network.
/// * `max_stake` - The new maximum stake value to set.
///
/// # Returns
///
/// Returns `Ok(())` if the operation is successful, or an error if it fails.
///
/// # Example
///
///
/// # Notes
///
/// - This function can only be called by the root account.
/// - The `netuid` should correspond to an existing network.
///
/// # TODO
///
// - Consider adding a check to ensure the `netuid` corresponds to an existing network.
// - Implement a mechanism to gradually adjust the max stake to prevent sudden changes.
// #[pallet::weight(<T as Config>::WeightInfo::sudo_set_network_max_stake())]
#[pallet::call_index(53)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
pub fn sudo_set_network_max_stake(
origin: OriginFor<T>,
_netuid: NetUid,
_max_stake: u64,
) -> DispatchResult {
// Ensure the call is made by the root account
ensure_root(origin)?;
Ok(())
}

/// Sets the duration of the coldkey swap schedule.
///
/// This extrinsic allows the root account to set the duration for the coldkey swap schedule.
Expand Down
15 changes: 0 additions & 15 deletions pallets/commitments/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,21 +325,6 @@ pub mod pallet {
Ok(())
}

/// *DEPRECATED* Sudo-set the commitment rate limit
#[pallet::call_index(1)]
#[pallet::weight((
Weight::from_parts(3_596_000, 0)
.saturating_add(T::DbWeight::get().reads(0_u64))
.saturating_add(T::DbWeight::get().writes(1_u64)),
DispatchClass::Operational,
Pays::No
))]
pub fn set_rate_limit(origin: OriginFor<T>, _rate_limit_blocks: u32) -> DispatchResult {
ensure_root(origin)?;
// RateLimit::<T>::set(rate_limit_blocks.into());
Ok(())
}

/// Sudo-set MaxSpace
#[pallet::call_index(2)]
#[pallet::weight((
Expand Down
48 changes: 0 additions & 48 deletions pallets/subtensor/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,6 @@ mod pallet_benchmarks {
);
}

#[benchmark]
fn become_delegate() {
let netuid = NetUid::from(1);
let tempo: u16 = 1;

Subtensor::<T>::init_new_network(netuid, tempo);
SubtokenEnabled::<T>::insert(netuid, true);
Subtensor::<T>::set_burn(netuid, 1.into());
Subtensor::<T>::set_max_allowed_uids(netuid, 4096);
Subtensor::<T>::set_network_registration_allowed(netuid, true);

let seed: u32 = 1;
let coldkey: T::AccountId = account("Test", 0, seed);
let hotkey: T::AccountId = account("Alice", 0, seed);
let amount_to_be_staked: u64 = 1_000_000_000;

Subtensor::<T>::add_balance_to_coldkey_account(&coldkey, amount_to_be_staked);
assert_ok!(Subtensor::<T>::do_burned_registration(
RawOrigin::Signed(coldkey.clone()).into(),
netuid,
hotkey.clone()
));

#[extrinsic_call]
_(RawOrigin::Signed(coldkey.clone()), hotkey.clone());
}

#[benchmark]
fn add_stake() {
let netuid = NetUid::from(1);
Expand Down Expand Up @@ -1279,27 +1252,6 @@ mod pallet_benchmarks {
);
}

#[benchmark]
fn set_tao_weights() {
let netuid = NetUid::from(1);
let hotkey: T::AccountId = account("A", 0, 6);
let dests = vec![0u16];
let weights = vec![0u16];
let version: u64 = 1;

Subtensor::<T>::init_new_network(netuid, 1);

#[extrinsic_call]
_(
RawOrigin::None,
netuid,
hotkey.clone(),
dests.clone(),
weights.clone(),
version,
);
}

#[benchmark]
fn swap_hotkey() {
let coldkey: T::AccountId = whitelisted_caller();
Expand Down
Loading