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
30 changes: 13 additions & 17 deletions pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,11 @@ pub mod pallet {
/// It is only callable by the root account or subnet owner.
/// The extrinsic will call the Subtensor pallet to set the adjustment alpha.
#[pallet::call_index(9)]
#[pallet::weight((
#[pallet::weight(
Weight::from_parts(14_000_000, 0)
.saturating_add(<T as frame_system::Config>::DbWeight::get().writes(1))
.saturating_add(<T as frame_system::Config>::DbWeight::get().reads(1)),
DispatchClass::Operational,
Pays::No
))]
.saturating_add(<T as frame_system::Config>::DbWeight::get().reads(1))
)]
pub fn sudo_set_adjustment_alpha(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down Expand Up @@ -604,12 +602,10 @@ pub mod pallet {
/// It is only callable by the root account or subnet owner.
/// The extrinsic will call the Subtensor pallet to set the network PoW registration allowed.
#[pallet::call_index(20)]
#[pallet::weight((
#[pallet::weight(
Weight::from_parts(14_000_000, 0)
.saturating_add(<T as frame_system::Config>::DbWeight::get().writes(1)),
DispatchClass::Operational,
Pays::No
))]
.saturating_add(<T as frame_system::Config>::DbWeight::get().writes(1))
)]
pub fn sudo_set_network_pow_registration_allowed(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down Expand Up @@ -1113,7 +1109,7 @@ pub mod pallet {
/// # Weight
/// This function has a fixed weight of 0 and is classified as an operational transaction that does not incur any fees.
#[pallet::call_index(50)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_liquid_alpha_enabled(
origin: OriginFor<T>,
netuid: NetUid,
Expand All @@ -1127,7 +1123,7 @@ pub mod pallet {

/// Sets values for liquid alpha
#[pallet::call_index(51)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_alpha_values(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down Expand Up @@ -1306,7 +1302,7 @@ pub mod pallet {
/// # Weight
/// This function has a fixed weight of 0 and is classified as an operational transaction that does not incur any fees.
#[pallet::call_index(61)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_toggle_transfer(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down Expand Up @@ -1436,7 +1432,7 @@ pub mod pallet {
/// # Weight
/// Weight is handled by the `#[pallet::weight]` attribute.
#[pallet::call_index(68)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_alpha_sigmoid_steepness(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down Expand Up @@ -1471,7 +1467,7 @@ pub mod pallet {
/// # Weight
/// This function has a fixed weight of 0 and is classified as an operational transaction that does not incur any fees.
#[pallet::call_index(69)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_yuma3_enabled(
origin: OriginFor<T>,
netuid: NetUid,
Expand All @@ -1495,7 +1491,7 @@ pub mod pallet {
/// # Weight
/// This function has a fixed weight of 0 and is classified as an operational transaction that does not incur any fees.
#[pallet::call_index(70)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_bonds_reset_enabled(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down Expand Up @@ -1540,7 +1536,7 @@ pub mod pallet {
/// # Rate Limiting
/// This function is rate-limited to one call per subnet per interval (e.g., one week).
#[pallet::call_index(67)]
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
#[pallet::weight((1_000_000, DispatchClass::Normal, Pays::Yes))] // TODO: add proper weights
pub fn sudo_set_sn_owner_hotkey(
origin: OriginFor<T>,
netuid: NetUid,
Expand Down
4 changes: 2 additions & 2 deletions pallets/admin-utils/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,8 @@ fn test_set_alpha_values_dispatch_info_ok() {

let dispatch_info = call.get_dispatch_info();

assert_eq!(dispatch_info.class, DispatchClass::Operational);
assert_eq!(dispatch_info.pays_fee, Pays::No);
assert_eq!(dispatch_info.class, DispatchClass::Normal);
assert_eq!(dispatch_info.pays_fee, Pays::Yes);
});
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/subtensor/src/macros/dispatches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ mod dispatches {

/// Register the hotkey to root network
#[pallet::call_index(62)]
#[pallet::weight((Weight::from_parts(111_700_000, 0)
#[pallet::weight((Weight::from_parts(203_000_000, 0)
.saturating_add(T::DbWeight::get().reads(23))
.saturating_add(T::DbWeight::get().writes(20)), DispatchClass::Normal, Pays::No))]
pub fn root_register(origin: OriginFor<T>, hotkey: T::AccountId) -> DispatchResult {
Expand Down Expand Up @@ -1987,7 +1987,7 @@ mod dispatches {
#[pallet::call_index(112)]
#[pallet::weight((
Weight::from_parts(26_200_000, 0).saturating_add(T::DbWeight::get().reads_writes(4, 1)),
DispatchClass::Operational,
DispatchClass::Normal,
Pays::Yes
))]
pub fn update_symbol(
Expand Down Expand Up @@ -2031,7 +2031,7 @@ mod dispatches {
/// * commit_reveal_version (`u16`):
/// - The client (bittensor-drand) version
#[pallet::call_index(113)]
#[pallet::weight((Weight::from_parts(64_530_000, 0)
#[pallet::weight((Weight::from_parts(80_400_000, 0)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))]
pub fn commit_timelocked_weights(
Expand Down