Skip to content

Commit d57ebd4

Browse files
Remove deprecated code.
1 parent 121964f commit d57ebd4

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
@@ -957,21 +957,6 @@ pub mod pallet {
957957
Ok(())
958958
}
959959

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

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

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