Skip to content

Commit 1e420f2

Browse files
Remove deprecated code.
1 parent 5be820e commit 1e420f2

File tree

3 files changed

+0
-276
lines changed

3 files changed

+0
-276
lines changed

pallets/admin-utils/src/lib.rs

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -959,21 +959,6 @@ pub mod pallet {
959959
Ok(())
960960
}
961961

962-
/// The extrinsic sets the subnet limit for the network.
963-
/// It is only callable by the root account.
964-
/// The extrinsic will call the Subtensor pallet to set the subnet limit.
965-
#[pallet::call_index(37)]
966-
#[pallet::weight((
967-
Weight::from_parts(14_000_000, 0)
968-
.saturating_add(<T as frame_system::Config>::DbWeight::get().writes(1)),
969-
DispatchClass::Operational,
970-
Pays::No
971-
))]
972-
pub fn sudo_set_subnet_limit(origin: OriginFor<T>, _max_subnets: u16) -> DispatchResult {
973-
ensure_root(origin)?;
974-
Ok(())
975-
}
976-
977962
/// The extrinsic sets the lock reduction interval for the network.
978963
/// It is only callable by the root account.
979964
/// The extrinsic will call the Subtensor pallet to set the lock reduction interval.
@@ -1078,26 +1063,6 @@ pub mod pallet {
10781063
Ok(())
10791064
}
10801065

1081-
// The extrinsic sets the target stake per interval.
1082-
// It is only callable by the root account.
1083-
// The extrinsic will call the Subtensor pallet to set target stake per interval.
1084-
// #[pallet::call_index(47)]
1085-
// #[pallet::weight((0, DispatchClass::Operational, Pays::No))]
1086-
// pub fn sudo_set_target_stakes_per_interval(
1087-
// origin: OriginFor<T>,
1088-
// target_stakes_per_interval: u64,
1089-
// ) -> DispatchResult {
1090-
// ensure_root(origin)?;
1091-
// pallet_subtensor::Pallet::<T>::set_target_stakes_per_interval(
1092-
// target_stakes_per_interval,
1093-
// );
1094-
// log::debug!(
1095-
// "TxTargetStakesPerIntervalSet( set_target_stakes_per_interval: {:?} ) ",
1096-
// target_stakes_per_interval
1097-
// ); (DEPRECATED)
1098-
// Ok(())
1099-
// } (DEPRECATED)
1100-
11011066
/// The extrinsic enabled/disables commit/reaveal for a given subnet.
11021067
/// It is only callable by the root account or subnet owner.
11031068
/// The extrinsic will call the Subtensor pallet to set the value.
@@ -1159,62 +1124,6 @@ pub mod pallet {
11591124
)
11601125
}
11611126

1162-
// DEPRECATED
1163-
// #[pallet::call_index(52)]
1164-
// #[pallet::weight((0, DispatchClass::Operational, Pays::No))]
1165-
// pub fn sudo_set_hotkey_emission_tempo(
1166-
// origin: OriginFor<T>,
1167-
// emission_tempo: u64,
1168-
// ) -> DispatchResult {
1169-
// ensure_root(origin)?;
1170-
// pallet_subtensor::Pallet::<T>::set_hotkey_emission_tempo(emission_tempo);
1171-
// log::debug!(
1172-
// "HotkeyEmissionTempoSet( emission_tempo: {:?} )",
1173-
// emission_tempo
1174-
// );
1175-
// Ok(())
1176-
// }
1177-
1178-
/// Sets the maximum stake allowed for a specific network.
1179-
///
1180-
/// This function allows the root account to set the maximum stake for a given network.
1181-
/// It updates the network's maximum stake value and logs the change.
1182-
///
1183-
/// # Arguments
1184-
///
1185-
/// * `origin` - The origin of the call, which must be the root account.
1186-
/// * `netuid` - The unique identifier of the network.
1187-
/// * `max_stake` - The new maximum stake value to set.
1188-
///
1189-
/// # Returns
1190-
///
1191-
/// Returns `Ok(())` if the operation is successful, or an error if it fails.
1192-
///
1193-
/// # Example
1194-
///
1195-
///
1196-
/// # Notes
1197-
///
1198-
/// - This function can only be called by the root account.
1199-
/// - The `netuid` should correspond to an existing network.
1200-
///
1201-
/// # TODO
1202-
///
1203-
// - Consider adding a check to ensure the `netuid` corresponds to an existing network.
1204-
// - Implement a mechanism to gradually adjust the max stake to prevent sudden changes.
1205-
// #[pallet::weight(<T as Config>::WeightInfo::sudo_set_network_max_stake())]
1206-
#[pallet::call_index(53)]
1207-
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
1208-
pub fn sudo_set_network_max_stake(
1209-
origin: OriginFor<T>,
1210-
_netuid: NetUid,
1211-
_max_stake: u64,
1212-
) -> DispatchResult {
1213-
// Ensure the call is made by the root account
1214-
ensure_root(origin)?;
1215-
Ok(())
1216-
}
1217-
12181127
/// Sets the duration of the coldkey swap schedule.
12191128
///
12201129
/// This extrinsic allows the root account to set the duration for the coldkey swap schedule.

pallets/commitments/src/lib.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -325,21 +325,6 @@ pub mod pallet {
325325
Ok(())
326326
}
327327

328-
/// *DEPRECATED* Sudo-set the commitment rate limit
329-
#[pallet::call_index(1)]
330-
#[pallet::weight((
331-
Weight::from_parts(3_596_000, 0)
332-
.saturating_add(T::DbWeight::get().reads(0_u64))
333-
.saturating_add(T::DbWeight::get().writes(1_u64)),
334-
DispatchClass::Operational,
335-
Pays::No
336-
))]
337-
pub fn set_rate_limit(origin: OriginFor<T>, _rate_limit_blocks: u32) -> DispatchResult {
338-
ensure_root(origin)?;
339-
// RateLimit::<T>::set(rate_limit_blocks.into());
340-
Ok(())
341-
}
342-
343328
/// Sudo-set MaxSpace
344329
#[pallet::call_index(2)]
345330
#[pallet::weight((

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 0 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -352,118 +352,6 @@ mod dispatches {
352352
)
353353
}
354354

355-
/// # Args:
356-
/// * `origin`: (<T as frame_system::Config>Origin):
357-
/// - The caller, a hotkey who wishes to set their weights.
358-
///
359-
/// * `netuid` (u16):
360-
/// - The network uid we are setting these weights on.
361-
///
362-
/// * `hotkey` (T::AccountId):
363-
/// - The hotkey associated with the operation and the calling coldkey.
364-
///
365-
/// * `dests` (Vec<u16>):
366-
/// - The edge endpoint for the weight, i.e. j for w_ij.
367-
///
368-
/// * 'weights' (Vec<u16>):
369-
/// - The u16 integer encoded weights. Interpreted as rational
370-
/// values in the range [0,1]. They must sum to in32::MAX.
371-
///
372-
/// * 'version_key' ( u64 ):
373-
/// - The network version key to check if the validator is up to date.
374-
///
375-
/// # Event:
376-
///
377-
/// * WeightsSet;
378-
/// - On successfully setting the weights on chain.
379-
///
380-
/// # Raises:
381-
///
382-
/// * NonAssociatedColdKey;
383-
/// - Attempting to set weights on a non-associated cold key.
384-
///
385-
/// * 'SubNetworkDoesNotExist':
386-
/// - Attempting to set weights on a non-existent network.
387-
///
388-
/// * 'NotRootSubnet':
389-
/// - Attempting to set weights on a subnet that is not the root network.
390-
///
391-
/// * 'WeightVecNotEqualSize':
392-
/// - Attempting to set weights with uids not of same length.
393-
///
394-
/// * 'UidVecContainInvalidOne':
395-
/// - Attempting to set weights with invalid uids.
396-
///
397-
/// * 'NotRegistered':
398-
/// - Attempting to set weights from a non registered account.
399-
///
400-
/// * 'WeightVecLengthIsLow':
401-
/// - Attempting to set weights with fewer weights than min.
402-
///
403-
/// * 'IncorrectWeightVersionKey':
404-
/// - Attempting to set weights with the incorrect network version key.
405-
///
406-
/// * 'SettingWeightsTooFast':
407-
/// - Attempting to set weights too fast.
408-
///
409-
/// * 'WeightVecLengthIsLow':
410-
/// - Attempting to set weights with fewer weights than min.
411-
///
412-
/// * 'MaxWeightExceeded':
413-
/// - Attempting to set weights with max value exceeding limit.
414-
///
415-
#[pallet::call_index(8)]
416-
#[pallet::weight((Weight::from_parts(3_176_000, 0)
417-
.saturating_add(T::DbWeight::get().reads(0_u64))
418-
.saturating_add(T::DbWeight::get().writes(0_u64)), DispatchClass::Normal, Pays::No))]
419-
pub fn set_tao_weights(
420-
_origin: OriginFor<T>,
421-
_netuid: NetUid,
422-
_hotkey: T::AccountId,
423-
_dests: Vec<u16>,
424-
_weights: Vec<u16>,
425-
_version_key: u64,
426-
) -> DispatchResult {
427-
// DEPRECATED
428-
// Self::do_set_root_weights(origin, netuid, hotkey, dests, weights, version_key)
429-
// Self::do_set_tao_weights(origin, netuid, hotkey, dests, weights, version_key)
430-
Ok(())
431-
}
432-
433-
/// --- Sets the key as a delegate.
434-
///
435-
/// # Args:
436-
/// * 'origin': (<T as frame_system::Config>Origin):
437-
/// - The signature of the caller's coldkey.
438-
///
439-
/// * 'hotkey' (T::AccountId):
440-
/// - The hotkey we are delegating (must be owned by the coldkey.)
441-
///
442-
/// * 'take' (u64):
443-
/// - The stake proportion that this hotkey takes from delegations.
444-
///
445-
/// # Event:
446-
/// * DelegateAdded;
447-
/// - On successfully setting a hotkey as a delegate.
448-
///
449-
/// # Raises:
450-
/// * 'NotRegistered':
451-
/// - The hotkey we are delegating is not registered on the network.
452-
///
453-
/// * 'NonAssociatedColdKey':
454-
/// - The hotkey we are delegating is not owned by the calling coldket.
455-
///
456-
#[pallet::call_index(1)]
457-
#[pallet::weight((Weight::from_parts(3_406_000, 0)
458-
.saturating_add(T::DbWeight::get().reads(0))
459-
.saturating_add(T::DbWeight::get().writes(0)), DispatchClass::Normal, Pays::Yes))]
460-
pub fn become_delegate(_origin: OriginFor<T>, _hotkey: T::AccountId) -> DispatchResult {
461-
// DEPRECATED
462-
// Self::do_become_delegate(origin, hotkey, Self::get_default_delegate_take())
463-
464-
Ok(())
465-
}
466-
467355
/// --- Allows delegates to decrease its take value.
468356
///
469357
/// # Args:
@@ -1386,64 +1274,6 @@ mod dispatches {
13861274
Ok(().into())
13871275
}
13881276

1389-
/// Schedule the dissolution of a network at a specified block number.
1390-
///
1391-
/// # Arguments
1392-
///
1393-
/// * `origin` - The origin of the call, must be signed by the sender.
1394-
/// * `netuid` - The u16 network identifier to be dissolved.
1395-
///
1396-
/// # Returns
1397-
///
1398-
/// Returns a `DispatchResultWithPostInfo` indicating success or failure of the operation.
1399-
///
1400-
/// # Weight
1401-
///
1402-
/// Weight is calculated based on the number of database reads and writes.
1403-
1404-
#[pallet::call_index(74)]
1405-
#[pallet::weight((Weight::from_parts(119_000_000, 0)
1406-
.saturating_add(T::DbWeight::get().reads(6))
1407-
.saturating_add(T::DbWeight::get().writes(31)), DispatchClass::Normal, Pays::Yes))]
1408-
pub fn schedule_dissolve_network(
1409-
_origin: OriginFor<T>,
1410-
_netuid: NetUid,
1411-
) -> DispatchResultWithPostInfo {
1412-
Err(Error::<T>::CallDisabled.into())
1413-
1414-
// let who = ensure_signed(origin)?;
1415-
1416-
// let current_block: BlockNumberFor<T> = <frame_system::Pallet<T>>::block_number();
1417-
// let duration: BlockNumberFor<T> = DissolveNetworkScheduleDuration::<T>::get();
1418-
// let when: BlockNumberFor<T> = current_block.saturating_add(duration);
1419-
1420-
// let call = Call::<T>::dissolve_network {
1421-
// coldkey: who.clone(),
1422-
// netuid,
1423-
// };
1424-
1425-
// let bound_call = T::Preimages::bound(LocalCallOf::<T>::from(call.clone()))
1426-
// .map_err(|_| Error::<T>::FailedToSchedule)?;
1427-
1428-
// T::Scheduler::schedule(
1429-
// DispatchTime::At(when),
1430-
// None,
1431-
// 63,
1432-
// frame_system::RawOrigin::Root.into(),
1433-
// bound_call,
1434-
// )
1435-
// .map_err(|_| Error::<T>::FailedToSchedule)?;
1436-
1437-
// // Emit the SwapScheduled event
1438-
// Self::deposit_event(Event::DissolveNetworkScheduled {
1439-
// account: who.clone(),
1440-
// netuid,
1441-
// execution_block: when,
1442-
// });
1443-
1444-
// Ok(().into())
1445-
}
1446-
14471277
/// ---- Set prometheus information for the neuron.
14481278
/// # Args:
14491279
/// * 'origin': (<T as frame_system::Config>Origin):

0 commit comments

Comments
 (0)