Skip to content

Commit 032cd5e

Browse files
authored
Merge pull request #1965 from opentensor/remove-deprecated-extrinsics2
Remove deprecated extrinsics.
2 parents 121964f + 924b1f9 commit 032cd5e

File tree

8 files changed

+5
-454
lines changed

8 files changed

+5
-454
lines changed

common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub enum ProxyType {
154154
Registration,
155155
Transfer,
156156
SmallTransfer,
157-
RootWeights,
157+
RootWeights, // deprecated
158158
ChildKeys,
159159
SudoUncheckedSetCode,
160160
SwapHotkey,

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/benchmarks.rs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -98,33 +98,6 @@ mod pallet_benchmarks {
9898
);
9999
}
100100

101-
#[benchmark]
102-
fn become_delegate() {
103-
let netuid = NetUid::from(1);
104-
let tempo: u16 = 1;
105-
106-
Subtensor::<T>::init_new_network(netuid, tempo);
107-
SubtokenEnabled::<T>::insert(netuid, true);
108-
Subtensor::<T>::set_burn(netuid, 1.into());
109-
Subtensor::<T>::set_max_allowed_uids(netuid, 4096);
110-
Subtensor::<T>::set_network_registration_allowed(netuid, true);
111-
112-
let seed: u32 = 1;
113-
let coldkey: T::AccountId = account("Test", 0, seed);
114-
let hotkey: T::AccountId = account("Alice", 0, seed);
115-
let amount_to_be_staked: u64 = 1_000_000_000;
116-
117-
Subtensor::<T>::add_balance_to_coldkey_account(&coldkey, amount_to_be_staked);
118-
assert_ok!(Subtensor::<T>::do_burned_registration(
119-
RawOrigin::Signed(coldkey.clone()).into(),
120-
netuid,
121-
hotkey.clone()
122-
));
123-
124-
#[extrinsic_call]
125-
_(RawOrigin::Signed(coldkey.clone()), hotkey.clone());
126-
}
127-
128101
#[benchmark]
129102
fn add_stake() {
130103
let netuid = NetUid::from(1);
@@ -1280,27 +1253,6 @@ mod pallet_benchmarks {
12801253
);
12811254
}
12821255

1283-
#[benchmark]
1284-
fn set_tao_weights() {
1285-
let netuid = NetUid::from(1);
1286-
let hotkey: T::AccountId = account("A", 0, 6);
1287-
let dests = vec![0u16];
1288-
let weights = vec![0u16];
1289-
let version: u64 = 1;
1290-
1291-
Subtensor::<T>::init_new_network(netuid, 1);
1292-
1293-
#[extrinsic_call]
1294-
_(
1295-
RawOrigin::None,
1296-
netuid,
1297-
hotkey.clone(),
1298-
dests.clone(),
1299-
weights.clone(),
1300-
version,
1301-
);
1302-
}
1303-
13041256
#[benchmark]
13051257
fn swap_hotkey() {
13061258
let coldkey: T::AccountId = whitelisted_caller();

0 commit comments

Comments
 (0)