Skip to content

Commit 5025669

Browse files
authored
Merge pull request #2155 from opentensor/set-sudo-extrinsics-pays-yes
Set Pays::Yes for sudo extrinsics.
2 parents 346986b + 4a1ba93 commit 5025669

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

pallets/admin-utils/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ pub mod pallet {
10821082
Weight::from_parts(14_000_000, 0)
10831083
.saturating_add(<T as frame_system::Config>::DbWeight::get().writes(1)),
10841084
DispatchClass::Operational,
1085-
Pays::No
1085+
Pays::Yes
10861086
))]
10871087
pub fn sudo_set_subnet_limit(origin: OriginFor<T>, max_subnets: u16) -> DispatchResult {
10881088
ensure_root(origin)?;
@@ -1639,7 +1639,12 @@ pub mod pallet {
16391639
/// # Weight
16401640
/// Weight is handled by the `#[pallet::weight]` attribute.
16411641
#[pallet::call_index(64)]
1642-
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
1642+
#[pallet::weight((
1643+
Weight::from_parts(3_918_000, 0) // TODO: add benchmarks
1644+
.saturating_add(T::DbWeight::get().writes(1_u64)),
1645+
DispatchClass::Operational,
1646+
Pays::Yes
1647+
))]
16431648
pub fn sudo_set_subnet_owner_hotkey(
16441649
origin: OriginFor<T>,
16451650
netuid: NetUid,

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ mod dispatches {
8080
/// - Attempting to set weights with max value exceeding limit.
8181
#[pallet::call_index(0)]
8282
#[pallet::weight((Weight::from_parts(15_540_000_000, 0)
83-
.saturating_add(T::DbWeight::get().reads(4112_u64))
83+
.saturating_add(T::DbWeight::get().reads(4111_u64))
8484
.saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))]
8585
pub fn set_weights(
8686
origin: OriginFor<T>,
@@ -1227,7 +1227,7 @@ mod dispatches {
12271227
#[pallet::call_index(59)]
12281228
#[pallet::weight((Weight::from_parts(235_400_000, 0)
12291229
.saturating_add(T::DbWeight::get().reads(39_u64))
1230-
.saturating_add(T::DbWeight::get().writes(57_u64)), DispatchClass::Normal, Pays::Yes))]
1230+
.saturating_add(T::DbWeight::get().writes(56_u64)), DispatchClass::Normal, Pays::Yes))]
12311231
pub fn register_network(origin: OriginFor<T>, hotkey: T::AccountId) -> DispatchResult {
12321232
Self::do_register_network(origin, &hotkey, 1, None)
12331233
}
@@ -1514,7 +1514,7 @@ mod dispatches {
15141514
#[pallet::call_index(79)]
15151515
#[pallet::weight((Weight::from_parts(234_200_000, 0)
15161516
.saturating_add(T::DbWeight::get().reads(38_u64))
1517-
.saturating_add(T::DbWeight::get().writes(56_u64)), DispatchClass::Normal, Pays::Yes))]
1517+
.saturating_add(T::DbWeight::get().writes(55_u64)), DispatchClass::Normal, Pays::Yes))]
15181518
pub fn register_network_with_identity(
15191519
origin: OriginFor<T>,
15201520
hotkey: T::AccountId,
@@ -2304,7 +2304,7 @@ mod dispatches {
23042304
#[pallet::call_index(120)]
23052305
#[pallet::weight((Weight::from_parts(119_000_000, 0)
23062306
.saturating_add(T::DbWeight::get().reads(6))
2307-
.saturating_add(T::DbWeight::get().writes(31)), DispatchClass::Operational, Pays::No))]
2307+
.saturating_add(T::DbWeight::get().writes(31)), DispatchClass::Operational, Pays::Yes))]
23082308
pub fn root_dissolve_network(origin: OriginFor<T>, netuid: NetUid) -> DispatchResult {
23092309
ensure_root(origin)?;
23102310
Self::do_dissolve_network(netuid)

0 commit comments

Comments
 (0)