Skip to content

Commit 4e74495

Browse files
committed
fix benchmarks
1 parent f920c77 commit 4e74495

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ mod dispatches {
711711
///
712712
#[pallet::call_index(2)]
713713
#[pallet::weight((Weight::from_parts(340_800_000, 0)
714-
.saturating_add(T::DbWeight::get().reads(27_u64))
714+
.saturating_add(T::DbWeight::get().reads(25_u64))
715715
.saturating_add(T::DbWeight::get().writes(16_u64)), DispatchClass::Normal, Pays::Yes))]
716716
pub fn add_stake(
717717
origin: OriginFor<T>,
@@ -1069,7 +1069,11 @@ mod dispatches {
10691069
///
10701070
/// Only callable by root as it doesn't require an announcement and can be used to swap any coldkey.
10711071
#[pallet::call_index(71)]
1072-
#[pallet::weight(Weight::zero())]
1072+
#[pallet::weight(
1073+
Weight::from_parts(183_600_000, 0)
1074+
.saturating_add(T::DbWeight::get().reads(17_u64))
1075+
.saturating_add(T::DbWeight::get().writes(9_u64))
1076+
)]
10731077
pub fn swap_coldkey(
10741078
origin: OriginFor<T>,
10751079
old_coldkey: T::AccountId,
@@ -1495,7 +1499,7 @@ mod dispatches {
14951499
/// - Thrown if key has hit transaction rate limit
14961500
#[pallet::call_index(84)]
14971501
#[pallet::weight((Weight::from_parts(358_500_000, 0)
1498-
.saturating_add(T::DbWeight::get().reads(44_u64))
1502+
.saturating_add(T::DbWeight::get().reads(41_u64))
14991503
.saturating_add(T::DbWeight::get().writes(26_u64)), DispatchClass::Normal, Pays::Yes))]
15001504
pub fn unstake_all_alpha(origin: OriginFor<T>, hotkey: T::AccountId) -> DispatchResult {
15011505
Self::do_unstake_all_alpha(origin, hotkey)
@@ -1609,7 +1613,7 @@ mod dispatches {
16091613
#[pallet::call_index(87)]
16101614
#[pallet::weight((
16111615
Weight::from_parts(351_300_000, 0)
1612-
.saturating_add(T::DbWeight::get().reads(40_u64))
1616+
.saturating_add(T::DbWeight::get().reads(37_u64))
16131617
.saturating_add(T::DbWeight::get().writes(24_u64)),
16141618
DispatchClass::Normal,
16151619
Pays::Yes
@@ -1674,7 +1678,7 @@ mod dispatches {
16741678
///
16751679
#[pallet::call_index(88)]
16761680
#[pallet::weight((Weight::from_parts(402_900_000, 0)
1677-
.saturating_add(T::DbWeight::get().reads(27_u64))
1681+
.saturating_add(T::DbWeight::get().reads(25_u64))
16781682
.saturating_add(T::DbWeight::get().writes(16_u64)), DispatchClass::Normal, Pays::Yes))]
16791683
pub fn add_stake_limit(
16801684
origin: OriginFor<T>,
@@ -1738,7 +1742,7 @@ mod dispatches {
17381742
///
17391743
#[pallet::call_index(89)]
17401744
#[pallet::weight((Weight::from_parts(377_400_000, 0)
1741-
.saturating_add(T::DbWeight::get().reads(31_u64))
1745+
.saturating_add(T::DbWeight::get().reads(29_u64))
17421746
.saturating_add(T::DbWeight::get().writes(15_u64)), DispatchClass::Normal, Pays::Yes))]
17431747
pub fn remove_stake_limit(
17441748
origin: OriginFor<T>,
@@ -1782,7 +1786,7 @@ mod dispatches {
17821786
#[pallet::call_index(90)]
17831787
#[pallet::weight((
17841788
Weight::from_parts(411_500_000, 0)
1785-
.saturating_add(T::DbWeight::get().reads(40_u64))
1789+
.saturating_add(T::DbWeight::get().reads(37_u64))
17861790
.saturating_add(T::DbWeight::get().writes(24_u64)),
17871791
DispatchClass::Normal,
17881792
Pays::Yes
@@ -1960,7 +1964,7 @@ mod dispatches {
19601964
/// Without limit_price it remove all the stake similar to `remove_stake` extrinsic
19611965
#[pallet::call_index(103)]
19621966
#[pallet::weight((Weight::from_parts(395_300_000, 10142)
1963-
.saturating_add(T::DbWeight::get().reads(31_u64))
1967+
.saturating_add(T::DbWeight::get().reads(29_u64))
19641968
.saturating_add(T::DbWeight::get().writes(15_u64)), DispatchClass::Normal, Pays::Yes))]
19651969
pub fn remove_stake_full_limit(
19661970
origin: T::RuntimeOrigin,
@@ -2343,7 +2347,11 @@ mod dispatches {
23432347
/// Announces a coldkey swap using coldkey hash.
23442348
/// This is required before the coldkey swap can be performed after the delay period.
23452349
#[pallet::call_index(125)]
2346-
#[pallet::weight(Weight::zero())]
2350+
#[pallet::weight(
2351+
Weight::from_parts(16_150_000, 0)
2352+
.saturating_add(T::DbWeight::get().reads(1_u64))
2353+
.saturating_add(T::DbWeight::get().writes(1_u64))
2354+
)]
23472355
pub fn announce_coldkey_swap(
23482356
origin: OriginFor<T>,
23492357
new_coldkey_hash: T::Hash,
@@ -2372,7 +2380,11 @@ mod dispatches {
23722380
/// Performs a coldkey swap iff an announcement has been made.
23732381
/// The provided new coldkey must match the announced coldkey hash.
23742382
#[pallet::call_index(126)]
2375-
#[pallet::weight(Weight::zero())]
2383+
#[pallet::weight(
2384+
Weight::from_parts(207_300_000, 0)
2385+
.saturating_add(T::DbWeight::get().reads(19_u64))
2386+
.saturating_add(T::DbWeight::get().writes(9_u64))
2387+
)]
23762388
pub fn swap_coldkey_announced(
23772389
origin: OriginFor<T>,
23782390
new_coldkey: T::AccountId,
@@ -2404,7 +2416,11 @@ mod dispatches {
24042416
///
24052417
/// Only callable by root.
24062418
#[pallet::call_index(127)]
2407-
#[pallet::weight(Weight::zero())]
2419+
#[pallet::weight(
2420+
Weight::from_parts(4_609_000, 0)
2421+
.saturating_add(T::DbWeight::get().reads(0_u64))
2422+
.saturating_add(T::DbWeight::get().writes(1_u64))
2423+
)]
24082424
pub fn remove_coldkey_swap_announcement(
24092425
origin: OriginFor<T>,
24102426
coldkey: T::AccountId,

0 commit comments

Comments
 (0)