Skip to content

Commit 951de7a

Browse files
authored
Merge pull request #3629 from autonomys/update-weight
Refresh pallet weights
2 parents 2732550 + f66843a commit 951de7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+763
-736
lines changed

crates/pallet-domains/src/benchmarking.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::bundle_storage_fund::refund_storage_fee;
88
use crate::domain_registry::{DomainConfigParams, into_domain_config};
99
use crate::runtime_registry::DomainRuntimeUpgradeEntry;
1010
use crate::staking::{
11-
Error as StakingError, OperatorConfig, OperatorStatus, do_convert_previous_epoch_withdrawal,
12-
do_mark_operators_as_slashed, do_reward_operators,
11+
Error as StakingError, OperatorConfig, OperatorStatus, do_convert_previous_epoch_deposits,
12+
do_convert_previous_epoch_withdrawal, do_mark_operators_as_slashed, do_reward_operators,
1313
};
1414
use crate::staking_epoch::{
1515
do_finalize_domain_current_epoch, do_finalize_domain_epoch_staking, do_slash_operator,
@@ -759,7 +759,7 @@ mod benchmarks {
759759

760760
// Request `w` withdrawals in different epochs, this removes slightly under (or exactly)
761761
// `MinOperatorStake` from the nominator's stake.
762-
for _ in 1..=w {
762+
for _ in 1..w {
763763
assert_ok!(Domains::<T>::withdraw_stake(
764764
RawOrigin::Signed(nominator.clone()).into(),
765765
operator_id,
@@ -768,15 +768,24 @@ mod benchmarks {
768768
do_finalize_domain_epoch_staking::<T>(domain_id)
769769
.expect("finalize domain staking should success");
770770
}
771-
// Withdraw all the remaining stake. Since we just took out ~`MinOperatorStake`
772-
// from the nominator's stake, the remaining stake is greater than or equal to
773-
// `2 * MinOperatorStake`.
771+
// Withdraw all the remaining stake.
772+
let remaining_stake =
773+
Deposits::<T>::try_mutate(operator_id, nominator.clone(), |maybe_deposit| {
774+
let domain_stake_summary = DomainStakingSummary::<T>::get(domain_id).unwrap();
775+
let deposit = maybe_deposit.as_mut().unwrap();
776+
do_convert_previous_epoch_deposits::<T>(
777+
operator_id,
778+
deposit,
779+
domain_stake_summary.current_epoch_index,
780+
)
781+
.unwrap();
782+
Ok::<T::Share, StakingError>(deposit.known.shares)
783+
})
784+
.unwrap();
774785
assert_ok!(Domains::<T>::withdraw_stake(
775786
RawOrigin::Signed(nominator.clone()).into(),
776787
operator_id,
777-
// Withdraw all the remaining stake, except for the `MinOperatorStake`. Since this is
778-
// the operator, we can't withdraw the entire stake.
779-
T::MinOperatorStake::get().into(),
788+
remaining_stake,
780789
));
781790
do_finalize_domain_epoch_staking::<T>(domain_id)
782791
.expect("finalize domain staking should success");
@@ -791,7 +800,7 @@ mod benchmarks {
791800
withdrawal,
792801
current_domain_epoch_index,
793802
)?;
794-
assert_eq!(withdrawal.withdrawals.len() as u32, w + 1);
803+
assert_eq!(withdrawal.withdrawals.len() as u32, w);
795804
Ok::<(), StakingError>(())
796805
})
797806
.unwrap();

crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//! Autogenerated weights for `balance_transfer_check_extension`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.2.0
5-
//! DATE: 2025-06-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2025-07-11, STEPS: `250`, REPEAT: `100`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
7-
//! HOSTNAME: `MacBook-Pro`, CPU: `M1 Max`
7+
//! HOSTNAME: `protocol-team-testing`, CPU: `AMD Ryzen 5 3600 6-Core Processor`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
99
1010
// Executed Command:
@@ -15,8 +15,8 @@
1515
// --extrinsic=*
1616
// --wasm-execution=compiled
1717
// --genesis-builder=none
18-
// --steps=50
19-
// --repeat=20
18+
// --steps=250
19+
// --repeat=100
2020
// --heap-pages=4096
2121
// --pallet=balance_transfer_check_extension
2222
// --output=./crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs
@@ -39,11 +39,11 @@ impl<T: frame_system::Config> crate::extension::WeightInfo for WeightInfo<T> {
3939
// Proof Size summary in bytes:
4040
// Measured: `0`
4141
// Estimated: `1486`
42-
// Minimum execution time: 1_000_000 picoseconds.
43-
Weight::from_parts(1_139_820, 0)
42+
// Minimum execution time: 1_280_000 picoseconds.
43+
Weight::from_parts(1_406_119, 0)
4444
.saturating_add(Weight::from_parts(0, 1486))
45-
// Standard Error: 12
46-
.saturating_add(Weight::from_parts(189, 0).saturating_mul(c.into()))
45+
// Standard Error: 0
46+
.saturating_add(Weight::from_parts(5, 0).saturating_mul(c.into()))
4747
.saturating_add(T::DbWeight::get().reads(1))
4848
}
4949
/// Storage: `RuntimeConfigs::EnableBalanceTransfers` (r:1 w:0)
@@ -53,11 +53,11 @@ impl<T: frame_system::Config> crate::extension::WeightInfo for WeightInfo<T> {
5353
// Proof Size summary in bytes:
5454
// Measured: `0`
5555
// Estimated: `1486`
56-
// Minimum execution time: 1_000_000 picoseconds.
57-
Weight::from_parts(1_024_479, 0)
56+
// Minimum execution time: 1_299_000 picoseconds.
57+
Weight::from_parts(1_401_176, 0)
5858
.saturating_add(Weight::from_parts(0, 1486))
59-
// Standard Error: 11
60-
.saturating_add(Weight::from_parts(67, 0).saturating_mul(c.into()))
59+
// Standard Error: 0
60+
.saturating_add(Weight::from_parts(12, 0).saturating_mul(c.into()))
6161
.saturating_add(T::DbWeight::get().reads(1))
6262
}
6363
/// Storage: `RuntimeConfigs::EnableBalanceTransfers` (r:1 w:0)
@@ -67,11 +67,11 @@ impl<T: frame_system::Config> crate::extension::WeightInfo for WeightInfo<T> {
6767
// Proof Size summary in bytes:
6868
// Measured: `0`
6969
// Estimated: `1486`
70-
// Minimum execution time: 1_000_000 picoseconds.
71-
Weight::from_parts(968_264, 0)
70+
// Minimum execution time: 1_290_000 picoseconds.
71+
Weight::from_parts(1_413_516, 0)
7272
.saturating_add(Weight::from_parts(0, 1486))
73-
// Standard Error: 49
74-
.saturating_add(Weight::from_parts(401, 0).saturating_mul(c.into()))
73+
// Standard Error: 0
74+
.saturating_add(Weight::from_parts(6, 0).saturating_mul(c.into()))
7575
.saturating_add(T::DbWeight::get().reads(1))
7676
}
7777
}

crates/subspace-runtime/src/weights/frame_system.rs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! Autogenerated weights for `frame_system`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.2.0
5-
//! DATE: 2025-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2025-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
77
//! HOSTNAME: `protocol-team-testing`, CPU: `AMD Ryzen 5 3600 6-Core Processor`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
@@ -37,31 +37,31 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
3737
// Proof Size summary in bytes:
3838
// Measured: `0`
3939
// Estimated: `0`
40-
// Minimum execution time: 2_670_000 picoseconds.
41-
Weight::from_parts(2_730_000, 0)
40+
// Minimum execution time: 1_639_000 picoseconds.
41+
Weight::from_parts(1_700_000, 0)
4242
.saturating_add(Weight::from_parts(0, 0))
4343
// Standard Error: 1
44-
.saturating_add(Weight::from_parts(321, 0).saturating_mul(b.into()))
44+
.saturating_add(Weight::from_parts(334, 0).saturating_mul(b.into()))
4545
}
4646
/// The range of component `b` is `[0, 3932160]`.
4747
fn remark_with_event(b: u32, ) -> Weight {
4848
// Proof Size summary in bytes:
4949
// Measured: `0`
5050
// Estimated: `0`
51-
// Minimum execution time: 6_589_000 picoseconds.
52-
Weight::from_parts(6_670_000, 0)
51+
// Minimum execution time: 4_360_000 picoseconds.
52+
Weight::from_parts(4_450_000, 0)
5353
.saturating_add(Weight::from_parts(0, 0))
54-
// Standard Error: 0
55-
.saturating_add(Weight::from_parts(1_089, 0).saturating_mul(b.into()))
54+
// Standard Error: 1
55+
.saturating_add(Weight::from_parts(1_097, 0).saturating_mul(b.into()))
5656
}
5757
/// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1)
5858
/// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1)
5959
fn set_heap_pages() -> Weight {
6060
// Proof Size summary in bytes:
6161
// Measured: `0`
6262
// Estimated: `0`
63-
// Minimum execution time: 4_330_000 picoseconds.
64-
Weight::from_parts(4_520_000, 0)
63+
// Minimum execution time: 2_760_000 picoseconds.
64+
Weight::from_parts(2_900_000, 0)
6565
.saturating_add(Weight::from_parts(0, 0))
6666
.saturating_add(T::DbWeight::get().writes(1))
6767
}
@@ -71,8 +71,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
7171
// Proof Size summary in bytes:
7272
// Measured: `0`
7373
// Estimated: `0`
74-
// Minimum execution time: 120_649_686_000 picoseconds.
75-
Weight::from_parts(145_558_145_000, 0)
74+
// Minimum execution time: 74_896_324_000 picoseconds.
75+
Weight::from_parts(78_179_664_000, 0)
7676
.saturating_add(Weight::from_parts(0, 0))
7777
.saturating_add(T::DbWeight::get().writes(1))
7878
}
@@ -83,11 +83,11 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
8383
// Proof Size summary in bytes:
8484
// Measured: `0`
8585
// Estimated: `0`
86-
// Minimum execution time: 2_660_000 picoseconds.
87-
Weight::from_parts(2_690_000, 0)
86+
// Minimum execution time: 1_700_000 picoseconds.
87+
Weight::from_parts(1_780_000, 0)
8888
.saturating_add(Weight::from_parts(0, 0))
89-
// Standard Error: 717
90-
.saturating_add(Weight::from_parts(800_027, 0).saturating_mul(i.into()))
89+
// Standard Error: 776
90+
.saturating_add(Weight::from_parts(591_901, 0).saturating_mul(i.into()))
9191
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
9292
}
9393
/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -97,11 +97,11 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
9797
// Proof Size summary in bytes:
9898
// Measured: `0`
9999
// Estimated: `0`
100-
// Minimum execution time: 2_770_000 picoseconds.
101-
Weight::from_parts(2_790_000, 0)
100+
// Minimum execution time: 1_720_000 picoseconds.
101+
Weight::from_parts(1_740_000, 0)
102102
.saturating_add(Weight::from_parts(0, 0))
103-
// Standard Error: 701
104-
.saturating_add(Weight::from_parts(601_642, 0).saturating_mul(i.into()))
103+
// Standard Error: 698
104+
.saturating_add(Weight::from_parts(468_875, 0).saturating_mul(i.into()))
105105
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
106106
}
107107
/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -111,11 +111,11 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
111111
// Proof Size summary in bytes:
112112
// Measured: `17 + p * (69 ±0)`
113113
// Estimated: `0 + p * (70 ±0)`
114-
// Minimum execution time: 4_330_000 picoseconds.
115-
Weight::from_parts(4_400_000, 0)
114+
// Minimum execution time: 2_950_000 picoseconds.
115+
Weight::from_parts(2_990_000, 0)
116116
.saturating_add(Weight::from_parts(0, 0))
117-
// Standard Error: 954
118-
.saturating_add(Weight::from_parts(1_199_247, 0).saturating_mul(p.into()))
117+
// Standard Error: 924
118+
.saturating_add(Weight::from_parts(1_188_520, 0).saturating_mul(p.into()))
119119
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
120120
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into())))
121121
.saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into()))
@@ -126,8 +126,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
126126
// Proof Size summary in bytes:
127127
// Measured: `0`
128128
// Estimated: `0`
129-
// Minimum execution time: 10_800_000 picoseconds.
130-
Weight::from_parts(12_140_000, 0)
129+
// Minimum execution time: 6_210_000 picoseconds.
130+
Weight::from_parts(6_950_000, 0)
131131
.saturating_add(Weight::from_parts(0, 0))
132132
.saturating_add(T::DbWeight::get().writes(1))
133133
}
@@ -139,8 +139,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
139139
// Proof Size summary in bytes:
140140
// Measured: `21`
141141
// Estimated: `1518`
142-
// Minimum execution time: 141_109_060_000 picoseconds.
143-
Weight::from_parts(146_311_089_000, 0)
142+
// Minimum execution time: 74_775_095_000 picoseconds.
143+
Weight::from_parts(77_762_913_000, 0)
144144
.saturating_add(Weight::from_parts(0, 1518))
145145
.saturating_add(T::DbWeight::get().reads(1))
146146
.saturating_add(T::DbWeight::get().writes(2))

crates/subspace-runtime/src/weights/pallet_balances.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! Autogenerated weights for `pallet_balances`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.2.0
5-
//! DATE: 2025-06-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2025-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
77
//! HOSTNAME: `protocol-team-testing`, CPU: `AMD Ryzen 5 3600 6-Core Processor`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
@@ -38,8 +38,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
3838
// Proof Size summary in bytes:
3939
// Measured: `0`
4040
// Estimated: `3593`
41-
// Minimum execution time: 66_449_000 picoseconds.
42-
Weight::from_parts(67_359_000, 0)
41+
// Minimum execution time: 44_449_000 picoseconds.
42+
Weight::from_parts(44_979_000, 0)
4343
.saturating_add(Weight::from_parts(0, 3593))
4444
.saturating_add(T::DbWeight::get().reads(1))
4545
.saturating_add(T::DbWeight::get().writes(1))
@@ -50,8 +50,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
5050
// Proof Size summary in bytes:
5151
// Measured: `0`
5252
// Estimated: `3593`
53-
// Minimum execution time: 53_219_000 picoseconds.
54-
Weight::from_parts(53_629_000, 0)
53+
// Minimum execution time: 35_480_000 picoseconds.
54+
Weight::from_parts(35_869_000, 0)
5555
.saturating_add(Weight::from_parts(0, 3593))
5656
.saturating_add(T::DbWeight::get().reads(1))
5757
.saturating_add(T::DbWeight::get().writes(1))
@@ -62,8 +62,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
6262
// Proof Size summary in bytes:
6363
// Measured: `52`
6464
// Estimated: `3593`
65-
// Minimum execution time: 17_370_000 picoseconds.
66-
Weight::from_parts(17_599_000, 0)
65+
// Minimum execution time: 11_680_000 picoseconds.
66+
Weight::from_parts(11_979_000, 0)
6767
.saturating_add(Weight::from_parts(0, 3593))
6868
.saturating_add(T::DbWeight::get().reads(1))
6969
.saturating_add(T::DbWeight::get().writes(1))
@@ -74,8 +74,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
7474
// Proof Size summary in bytes:
7575
// Measured: `52`
7676
// Estimated: `3593`
77-
// Minimum execution time: 26_879_000 picoseconds.
78-
Weight::from_parts(27_179_000, 0)
77+
// Minimum execution time: 17_880_000 picoseconds.
78+
Weight::from_parts(18_130_000, 0)
7979
.saturating_add(Weight::from_parts(0, 3593))
8080
.saturating_add(T::DbWeight::get().reads(1))
8181
.saturating_add(T::DbWeight::get().writes(1))
@@ -86,8 +86,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
8686
// Proof Size summary in bytes:
8787
// Measured: `52`
8888
// Estimated: `6196`
89-
// Minimum execution time: 68_189_000 picoseconds.
90-
Weight::from_parts(68_628_000, 0)
89+
// Minimum execution time: 45_239_000 picoseconds.
90+
Weight::from_parts(45_590_000, 0)
9191
.saturating_add(Weight::from_parts(0, 6196))
9292
.saturating_add(T::DbWeight::get().reads(2))
9393
.saturating_add(T::DbWeight::get().writes(2))
@@ -98,8 +98,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
9898
// Proof Size summary in bytes:
9999
// Measured: `0`
100100
// Estimated: `3593`
101-
// Minimum execution time: 66_268_000 picoseconds.
102-
Weight::from_parts(67_059_000, 0)
101+
// Minimum execution time: 44_079_000 picoseconds.
102+
Weight::from_parts(44_339_000, 0)
103103
.saturating_add(Weight::from_parts(0, 3593))
104104
.saturating_add(T::DbWeight::get().reads(1))
105105
.saturating_add(T::DbWeight::get().writes(1))
@@ -110,8 +110,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
110110
// Proof Size summary in bytes:
111111
// Measured: `52`
112112
// Estimated: `3593`
113-
// Minimum execution time: 21_000_000 picoseconds.
114-
Weight::from_parts(21_170_000, 0)
113+
// Minimum execution time: 14_149_000 picoseconds.
114+
Weight::from_parts(14_380_000, 0)
115115
.saturating_add(Weight::from_parts(0, 3593))
116116
.saturating_add(T::DbWeight::get().reads(1))
117117
.saturating_add(T::DbWeight::get().writes(1))
@@ -123,11 +123,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
123123
// Proof Size summary in bytes:
124124
// Measured: `0 + u * (136 ±0)`
125125
// Estimated: `990 + u * (2603 ±0)`
126-
// Minimum execution time: 20_320_000 picoseconds.
127-
Weight::from_parts(20_450_000, 0)
126+
// Minimum execution time: 13_530_000 picoseconds.
127+
Weight::from_parts(13_749_000, 0)
128128
.saturating_add(Weight::from_parts(0, 990))
129-
// Standard Error: 10_380
130-
.saturating_add(Weight::from_parts(17_592_764, 0).saturating_mul(u.into()))
129+
// Standard Error: 9_021
130+
.saturating_add(Weight::from_parts(12_653_144, 0).saturating_mul(u.into()))
131131
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
132132
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
133133
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
@@ -136,24 +136,24 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
136136
// Proof Size summary in bytes:
137137
// Measured: `0`
138138
// Estimated: `0`
139-
// Minimum execution time: 7_180_000 picoseconds.
140-
Weight::from_parts(7_370_000, 0)
139+
// Minimum execution time: 4_920_000 picoseconds.
140+
Weight::from_parts(4_990_000, 0)
141141
.saturating_add(Weight::from_parts(0, 0))
142142
}
143143
fn burn_allow_death() -> Weight {
144144
// Proof Size summary in bytes:
145145
// Measured: `0`
146146
// Estimated: `0`
147-
// Minimum execution time: 39_059_000 picoseconds.
148-
Weight::from_parts(39_559_000, 0)
147+
// Minimum execution time: 26_319_000 picoseconds.
148+
Weight::from_parts(26_759_000, 0)
149149
.saturating_add(Weight::from_parts(0, 0))
150150
}
151151
fn burn_keep_alive() -> Weight {
152152
// Proof Size summary in bytes:
153153
// Measured: `0`
154154
// Estimated: `0`
155-
// Minimum execution time: 26_150_000 picoseconds.
156-
Weight::from_parts(26_330_000, 0)
155+
// Minimum execution time: 17_650_000 picoseconds.
156+
Weight::from_parts(17_820_000, 0)
157157
.saturating_add(Weight::from_parts(0, 0))
158158
}
159159
}

0 commit comments

Comments
 (0)