Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debloat pallet subtensor #1045

Open
wants to merge 137 commits into
base: devnet-ready
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
9de3678
Remove check_validotar_permit from pallet-subtensor
ales-otf Nov 29, 2024
c6f974a
Remove check_allowed_register from pallet-subtensor
ales-otf Nov 29, 2024
ceee1c7
Remove decrease_stake_on_hotkey_account from pallet-subtensor
ales-otf Nov 29, 2024
979d84f
Remove decrease/increase_total_stake from pallet-subtensor
ales-otf Nov 29, 2024
d4edf48
Remove do_set_senate_required_stake_perc from pallet-subtensor
ales-otf Nov 29, 2024
0d8e3cd
Remove get_rao_recycled from pallet-subtensor
ales-otf Nov 29, 2024
506101f
Remove get_axon_info from pallet-subtensor
ales-otf Nov 29, 2024
1b8dbd9
Remove get_root_netuid from pallet-subtensor
ales-otf Nov 29, 2024
1fbbc30
Remove get_subnetwork_n from pallet-subtensor
ales-otf Dec 2, 2024
37de137
Remove check_len_uids_within_allowed from pallet-subtensor
ales-otf Dec 2, 2024
7b11305
Remove get_active from pallet-subtensor
ales-otf Dec 2, 2024
f132d77
Remove get_adjustment_alpha from pallet-subtensor
ales-otf Dec 2, 2024
cf42930
Remove get_adjustment_interval from pallet-subtensor
ales-otf Dec 2, 2024
69d4e33
Remove get_all_staked_hotkeys from pallet-subtensor
ales-otf Dec 2, 2024
198ce86
Remove get_alpha_values from pallet-subtensor
ales-otf Dec 3, 2024
3b953e3
Remove get_blocks_since_last_step from pallet-subtensor
ales-otf Dec 3, 2024
6610ba8
Remove get_bonds_moving_average from pallet-subtensor
ales-otf Dec 3, 2024
6d612bc
Remove get_burn_as_u64 from pallet-subtensor
ales-otf Dec 3, 2024
38dd684
Remove get_burn_registrations_this_interval from pallet-subtensor
ales-otf Dec 3, 2024
d2625af
Remove get_childkey_take from pallet-subtensor
ales-otf Dec 3, 2024
f05bfa5
Remove get_children from pallet-subtensor
ales-otf Dec 3, 2024
46ab5a4
Remove get_coldkey_for_hotkey from pallet-subtensor
ales-otf Dec 5, 2024
acbcfa8
Remove get_commit_reveal_weights_enabled from pallet-subtensor
ales-otf Dec 5, 2024
7348c24
Fix rebase
ales-otf Dec 5, 2024
23ad81f
Remove get_consensus method from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
ec4c017
Remove get_default_childkey_take method from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
c3ed86d
Remove get_default_delegate_take from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
509f439
Remove get_difficulty_as_u64 from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
1e2a139
Remove get_dividends from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
e73eccf
Remove get_emission from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
e532018
Remove get_emission_value from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
ceeadf7
Remove get_float_rho from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
448376f
Remove get_hotkey_emission_tempo from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
3baa6c2
Remove get_hotkey_take from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
cbc10af
Fix rebase
ales-otf Dec 11, 2024
54fb99a
Remove get_immunity_period from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
48e8d13
Remove get_incentive from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
949df4c
Remove get_kappa from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
88a582e
Remove get_last_adjustment_block from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
1970826
Remove get_last_mechanism_step_block from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
b000afa
Remove get_last_tx_block from pallet-subtensor::Pallet
ales-otf Dec 11, 2024
9c2638d
Remove get_last_tx_block_childkey_take from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
57a8a7f
Remove get_last_tx_block_delegate_take from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
7b8ec77
Remove get_last_update from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
dceea28
Remove get_liquid_alpha_enabled from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
d802ffe
Remove get_lock_reduction_interval from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
37f8fcf
Remove get_max_allowed_uids from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
c891a84
Remove get_max_allowed_validators from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
c5a3316
Remove get_max_burn_as_u64 from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
565069e
Remove get_max_childkey_take from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
fcfd3c8
Remove get_max_delegate_take from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
b12725e
Remove get_max_difficulty from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
6837bda
Remove get_max_registrations_per_block from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
8d746c1
Remove get_max_root_validators from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
931a22c
Remove get_max_subnets from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
4c74cf8
Remove get_max_weight_limit from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
5fd1e81
Remove get_min_allowed_weights from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
15570f0
Remove duplicated import in admin-utils benchmarking
ales-otf Dec 13, 2024
52ddda6
Remove get_min_burn_as_u64 from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
c57915a
Remove get_min_childkey_take from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
5b15117
Remove get_min_delegate_take from pallet-subtensor::Pallet
ales-otf Dec 13, 2024
d19dc9a
Remove get_min_difficulty from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
f89320c
Remove get_network_immunity_period from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
397d618
Remove get_network_last_lock from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
14e1755
Remove get_network_last_lock_block from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
188eee6
Remove get_network_max_stake from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
27881c1
Remove get_network_min_lock from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
6a6db4d
Remove get_network_pow_registration_allowed from pallet-subtensor::Pa…
ales-otf Dec 16, 2024
4c94a08
Remove get_network_registered_block from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
37ca8f1
Remove get_network_registration_allowed from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
cfa3e17
Remove get_neuron_block_at_registration from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
9de07da
Remove get_nominator_min_required_stake from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
7402aa0
Remove get_num_subnets from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
5467691
Remove get_owned_hotkeys from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
18bda25
Remove get_owning_coldkey_for_hotkey from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
dc73d14
Remove get_parents from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
3ed0df6
Remove get_pending_emission from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
c80ae38
Remove get_pending_hotkey_emission from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
5447afd
Remove get_pow_registrations_this_interval from pallet-subtensor::Pallet
ales-otf Dec 16, 2024
0d503cd
Remove get_prometheus and get_pruning_score from pallet-subtensor::Pa…
ales-otf Dec 16, 2024
4fc7683
Remove get_rank from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
d20c519
Remove get_registrations_this_block from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
a7a56fc
Remove get_registrations_this_interval from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
ac7062d
Remove get_reveal_period from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
48f1242
Remove get_rho from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
5b62316
Remove get_scaling_law_power from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
3bba475
Remove get_serving_rate_limit from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
4bc3797
Remove get_stake_for_coldkey_and_hotkey from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
ebfe64b
Remove get_subnet_emission_value from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
9f05e46
Remove get_subnet_locked_balance from pallet-subtensor::Pallet
ales-otf Dec 17, 2024
be84827
Remove get_subnet_owner from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
ef38ed7
Remove get_subnet_owner_cut from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
0a64cb4
Remove get_target_stakes_per_interval from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
5976158
Remove get_tempo from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
07bb940
Remove get_total_issuance from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
98afbc7
Remove get_total_stake from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
9900c17
Remove get_total_stake_for_coldkey from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
33cf8cc
Remove get_total_stake_for_hotkey from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
d6d0933
Remove get_tx_childkey_take_rate_limit from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
53ecf59
Remove get_tx_delegate_take_rate_limit from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
c4df467
Remove get_tx_rate_limit from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
3b718a4
Remove get_validator_permit from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
77b2c4e
Remove get_validator_trust from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
7c491c3
Remove get_weights_set_rate_limit from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
6707299
Remove get_weights_version_key from pallet-subtensor::Pallet
ales-otf Dec 18, 2024
4a2b2c2
Remove get_key_swap_cost method from Pallet of pallet-subtensor
ales-otf Dec 18, 2024
5339e64
Update spec version
ales-otf Dec 18, 2024
0f04c47
Remove get_rate_limit_on_subnet method from Pallet of pallet-subtensor
ales-otf Dec 18, 2024
0d13daa
Remove has_enough_stake method from Pallet of pallet-subtensor
ales-otf Dec 19, 2024
0319a01
Remove hotkey_account_exists method from Pallet of pallet-subtensor
ales-otf Dec 19, 2024
7d52796
Remove hotkey_is_delegate from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
ad91c8c
Remove delegate_hotkey from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
440bb6c
Remove if_subnet_exist from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
16fb6b3
Remove is_uid_exist_on_network from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
b1d4465
Remove set_blocks_since_last_step from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
4454f70
Remove set_burn from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
ef592a5
Remove set_burn_registrations_this_interval from pallet-subtensor::Pa…
ales-otf Dec 19, 2024
23e69eb
Remove set_commit_reveal_weights_enabled from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
372ddc6
Remove set_last_adjustment_block from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
f281f61
Remove set_last_mechanism_step_block from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
664678c
Remove set_last_tx_block from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
2ad4c7c
Remove set_last_tx_block_delegate_take from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
b1f791c
Remove set_liquid_alpha_enabled from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
f9c4b38
Remove set_network_last_lock from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
6d252b3
Remove set_pow_registrations_this_interval from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
12f259b
Remove set_registrations_this_block from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
892481f
Remove get_stake_threshold from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
a5f1f07
Remove set_registrations_this_interval from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
0582255
Remove set_senate_required_stake_perc method from Pallet of pallet-su…
ales-otf Dec 19, 2024
24a36b2
Remove is_senate_member method from Pallet of pallet-subtensor
ales-otf Dec 19, 2024
2de5083
Remove set_nominator_min_required_stake from pallet-subtensor::Pallet
ales-otf Dec 19, 2024
c8bd7eb
Remove set_stake_interval from pallet-subtensor::Pallet
ales-otf Dec 20, 2024
97c5412
Remove set_subnet_locked_balance from pallet-subtensor::Pallet
ales-otf Dec 20, 2024
f24a08b
Remove get_target_registrations_per_interval from pallet-subtensor::P…
ales-otf Dec 20, 2024
b17c9da
Remove uids_match_values method from Pallet of pallet-subtensor
ales-otf Dec 20, 2024
8d2e05a
Fix rebase
ales-otf Dec 20, 2024
f998109
Remove get_total_hotkey_delegated_stake from pallet_subtensor::Pallet
ales-otf Dec 23, 2024
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
61 changes: 30 additions & 31 deletions pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_min_difficulty(netuid, min_difficulty);
Expand All @@ -186,7 +186,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_max_difficulty(netuid, max_difficulty);
Expand All @@ -211,7 +211,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_weights_version_key(netuid, weights_version_key);
Expand All @@ -236,7 +236,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_weights_set_rate_limit(
Expand Down Expand Up @@ -264,7 +264,7 @@ pub mod pallet {
ensure_root(origin)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_adjustment_interval(netuid, adjustment_interval);
Expand Down Expand Up @@ -295,7 +295,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_adjustment_alpha(netuid, adjustment_alpha);
Expand All @@ -319,7 +319,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_max_weight_limit(netuid, max_weight_limit);
Expand All @@ -343,7 +343,7 @@ pub mod pallet {
) -> DispatchResult {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;
ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);

Expand All @@ -369,7 +369,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_min_allowed_weights(netuid, min_allowed_weights);
Expand All @@ -393,11 +393,11 @@ pub mod pallet {
) -> DispatchResult {
ensure_root(origin)?;
ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
ensure!(
pallet_subtensor::Pallet::<T>::get_subnetwork_n(netuid) < max_allowed_uids,
pallet_subtensor::SubnetworkN::<T>::get(netuid) < max_allowed_uids,
Error::<T>::MaxAllowedUIdsLessThanCurrentUIds
);
pallet_subtensor::Pallet::<T>::set_max_allowed_uids(netuid, max_allowed_uids);
Expand All @@ -418,7 +418,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_kappa(netuid, kappa);
Expand All @@ -435,7 +435,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_rho(netuid, rho);
Expand All @@ -456,7 +456,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_activity_cutoff(netuid, activity_cutoff);
Expand Down Expand Up @@ -538,7 +538,7 @@ pub mod pallet {
ensure_root(origin)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_target_registrations_per_interval(
Expand Down Expand Up @@ -566,7 +566,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_min_burn(netuid, min_burn);
Expand All @@ -591,7 +591,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_max_burn(netuid, max_burn);
Expand All @@ -615,7 +615,7 @@ pub mod pallet {
) -> DispatchResult {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;
ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_difficulty(netuid, difficulty);
Expand All @@ -639,12 +639,11 @@ pub mod pallet {
) -> DispatchResult {
ensure_root(origin)?;
ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
ensure!(
max_allowed_validators
<= pallet_subtensor::Pallet::<T>::get_max_allowed_uids(netuid),
max_allowed_validators <= pallet_subtensor::MaxAllowedUids::<T>::get(netuid),
Error::<T>::MaxValidatorsLargerThanMaxUIds
);

Expand Down Expand Up @@ -673,7 +672,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_bonds_moving_average(netuid, bonds_moving_average);
Expand All @@ -698,7 +697,7 @@ pub mod pallet {
ensure_root(origin)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_max_registrations_per_block(
Expand Down Expand Up @@ -764,7 +763,7 @@ pub mod pallet {
pub fn sudo_set_tempo(origin: OriginFor<T>, netuid: u16, tempo: u16) -> DispatchResult {
ensure_root(origin)?;
ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_tempo(netuid, tempo);
Expand Down Expand Up @@ -888,7 +887,7 @@ pub mod pallet {
) -> DispatchResult {
ensure_root(origin)?;
ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);
pallet_subtensor::Pallet::<T>::set_rao_recycled(netuid, rao_recycled);
Expand Down Expand Up @@ -917,9 +916,9 @@ pub mod pallet {
min_stake: u64,
) -> DispatchResult {
ensure_root(origin)?;
let prev_min_stake = pallet_subtensor::Pallet::<T>::get_nominator_min_required_stake();
let prev_min_stake = pallet_subtensor::NominatorMinRequiredStake::<T>::get();
log::trace!("Setting minimum stake to: {}", min_stake);
pallet_subtensor::Pallet::<T>::set_nominator_min_required_stake(min_stake);
pallet_subtensor::NominatorMinRequiredStake::<T>::put(min_stake);
if min_stake > prev_min_stake {
log::trace!("Clearing small nominations");
pallet_subtensor::Pallet::<T>::clear_small_nominations();
Expand Down Expand Up @@ -991,11 +990,11 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);

pallet_subtensor::Pallet::<T>::set_commit_reveal_weights_enabled(netuid, enabled);
pallet_subtensor::CommitRevealWeightsEnabled::<T>::set(netuid, enabled);
log::debug!("ToggleSetWeightsCommitReveal( netuid: {:?} ) ", netuid);
Ok(())
}
Expand All @@ -1017,7 +1016,7 @@ pub mod pallet {
enabled: bool,
) -> DispatchResult {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;
pallet_subtensor::Pallet::<T>::set_liquid_alpha_enabled(netuid, enabled);
pallet_subtensor::LiquidAlphaOn::<T>::set(netuid, enabled);
log::debug!(
"LiquidAlphaEnableToggled( netuid: {:?}, Enabled: {:?} ) ",
netuid,
Expand Down Expand Up @@ -1215,7 +1214,7 @@ pub mod pallet {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;

ensure!(
pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
pallet_subtensor::NetworksAdded::<T>::get(netuid),
Error::<T>::SubnetDoesNotExist
);

Expand Down
Loading
Loading