Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Migrate to Weight::from_parts #6794

Merged
merged 4 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions runtime/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ mod tests {
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub BlockWeights: limits::BlockWeights = limits::BlockWeights::builder()
.base_block(Weight::from_ref_time(10))
.base_block(Weight::from_parts(10, 0))
.for_class(DispatchClass::all(), |weight| {
weight.base_extrinsic = Weight::from_ref_time(100);
weight.base_extrinsic = Weight::from_parts(100, 0);
})
.for_class(DispatchClass::non_mandatory(), |weight| {
weight.max_total = Some(Weight::from_parts(1024, u64::MAX));
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/purchase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub mod pallet {
///
/// Origin must match the `ValidityOrigin`.
#[pallet::call_index(0)]
#[pallet::weight(Weight::from_ref_time(200_000_000) + T::DbWeight::get().reads_writes(4, 1))]
#[pallet::weight(Weight::from_parts(200_000_000, 0) + T::DbWeight::get().reads_writes(4, 1))]
pub fn create_account(
origin: OriginFor<T>,
who: T::AccountId,
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/constants/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ parameter_types! {
/// 95th: 9_402_155
/// 75th: 9_250_717
pub const BlockExecutionWeight: Weight =
Weight::from_ref_time(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(9_225_024));
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(9_225_024), 0);
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/constants/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ parameter_types! {
/// 95th: 100_633
/// 75th: 99_966
pub const ExtrinsicBaseWeight: Weight =
Weight::from_ref_time(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(99_912));
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(99_912), 0);
}

#[cfg(test)]
Expand Down
26 changes: 13 additions & 13 deletions runtime/kusama/src/weights/frame_benchmarking_baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,53 +51,53 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 115 nanoseconds.
Weight::from_ref_time(156_869)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(156_869, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// The range of component `i` is `[0, 1000000]`.
fn subtraction(_i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 126 nanoseconds.
Weight::from_ref_time(163_413)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(163_413, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// The range of component `i` is `[0, 1000000]`.
fn multiplication(_i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 125 nanoseconds.
Weight::from_ref_time(165_700)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(165_700, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// The range of component `i` is `[0, 1000000]`.
fn division(_i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 114 nanoseconds.
Weight::from_ref_time(160_757)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(160_757, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn hashing() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 20_199_657 nanoseconds.
Weight::from_ref_time(20_348_638_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(20_348_638_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// The range of component `i` is `[0, 100]`.
fn sr25519_verification(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 146 nanoseconds.
Weight::from_ref_time(181_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(181_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 18_837
.saturating_add(Weight::from_ref_time(47_289_133).saturating_mul(i.into()))
.saturating_add(Weight::from_parts(47_289_133, 0).saturating_mul(i.into()))
}
}
16 changes: 8 additions & 8 deletions runtime/kusama/src/weights/frame_election_provider_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for We
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_806_565 nanoseconds.
Weight::from_ref_time(5_866_482_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(5_866_482_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 138_296
.saturating_add(Weight::from_ref_time(5_701_761).saturating_mul(v.into()))
.saturating_add(Weight::from_parts(5_701_761, 0).saturating_mul(v.into()))
// Standard Error: 14_138_940
.saturating_add(Weight::from_ref_time(1_548_790_171).saturating_mul(d.into()))
.saturating_add(Weight::from_parts(1_548_790_171, 0).saturating_mul(d.into()))
}
/// The range of component `v` is `[1000, 2000]`.
/// The range of component `t` is `[500, 1000]`.
Expand All @@ -68,11 +68,11 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for We
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_595_992 nanoseconds.
Weight::from_ref_time(4_626_336_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(4_626_336_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 149_717
.saturating_add(Weight::from_ref_time(5_673_749).saturating_mul(v.into()))
.saturating_add(Weight::from_parts(5_673_749, 0).saturating_mul(v.into()))
// Standard Error: 15_306_572
.saturating_add(Weight::from_ref_time(1_806_945_095).saturating_mul(d.into()))
.saturating_add(Weight::from_parts(1_806_945_095, 0).saturating_mul(d.into()))
}
}
36 changes: 18 additions & 18 deletions runtime/kusama/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_670 nanoseconds.
Weight::from_ref_time(1_704_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(1_704_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(415).saturating_mul(b.into()))
.saturating_add(Weight::from_parts(415, 0).saturating_mul(b.into()))
}
/// The range of component `b` is `[0, 3932160]`.
fn remark_with_event(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_327 nanoseconds.
Weight::from_ref_time(6_508_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(6_508_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_777).saturating_mul(b.into()))
.saturating_add(Weight::from_parts(1_777, 0).saturating_mul(b.into()))
}
/// Storage: System Digest (r:1 w:1)
/// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured)
Expand All @@ -76,8 +76,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `495`
// Minimum execution time: 3_621 nanoseconds.
Weight::from_ref_time(3_764_000)
.saturating_add(Weight::from_proof_size(495))
Weight::from_parts(3_764_000, 0)
.saturating_add(Weight::from_parts(0, 495))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -89,10 +89,10 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_680 nanoseconds.
Weight::from_ref_time(1_735_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(1_735_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 1_838
.saturating_add(Weight::from_ref_time(587_349).saturating_mul(i.into()))
.saturating_add(Weight::from_parts(587_349, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
/// Storage: Skipped Metadata (r:0 w:0)
Expand All @@ -103,10 +103,10 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_693 nanoseconds.
Weight::from_ref_time(1_742_000)
.saturating_add(Weight::from_proof_size(0))
Weight::from_parts(1_742_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 858
.saturating_add(Weight::from_ref_time(446_600).saturating_mul(i.into()))
.saturating_add(Weight::from_parts(446_600, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
/// Storage: Skipped Metadata (r:0 w:0)
Expand All @@ -117,12 +117,12 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Measured: `120 + p * (69 ±0)`
// Estimated: `121 + p * (70 ±0)`
// Minimum execution time: 3_458 nanoseconds.
Weight::from_ref_time(3_578_000)
.saturating_add(Weight::from_proof_size(121))
Weight::from_parts(3_578_000, 0)
.saturating_add(Weight::from_parts(0, 121))
// Standard Error: 1_106
.saturating_add(Weight::from_ref_time(990_233).saturating_mul(p.into()))
.saturating_add(Weight::from_parts(990_233, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into())))
.saturating_add(Weight::from_proof_size(70).saturating_mul(p.into()))
.saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into()))
}
}
12 changes: 6 additions & 6 deletions runtime/kusama/src/weights/pallet_bags_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ impl<T: frame_system::Config> pallet_bags_list::WeightInfo for WeightInfo<T> {
// Measured: `1846`
// Estimated: `19186`
// Minimum execution time: 54_999 nanoseconds.
Weight::from_ref_time(55_668_000)
.saturating_add(Weight::from_proof_size(19186))
Weight::from_parts(55_668_000, 0)
.saturating_add(Weight::from_parts(0, 19186))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand All @@ -76,8 +76,8 @@ impl<T: frame_system::Config> pallet_bags_list::WeightInfo for WeightInfo<T> {
// Measured: `1740`
// Estimated: `19114`
// Minimum execution time: 54_080 nanoseconds.
Weight::from_ref_time(54_660_000)
.saturating_add(Weight::from_proof_size(19114))
Weight::from_parts(54_660_000, 0)
.saturating_add(Weight::from_parts(0, 19114))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand All @@ -96,8 +96,8 @@ impl<T: frame_system::Config> pallet_bags_list::WeightInfo for WeightInfo<T> {
// Measured: `2081`
// Estimated: `25798`
// Minimum execution time: 58_444 nanoseconds.
Weight::from_ref_time(59_445_000)
.saturating_add(Weight::from_proof_size(25798))
Weight::from_parts(59_445_000, 0)
.saturating_add(Weight::from_parts(0, 25798))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(6))
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/kusama/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,49 +47,49 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
// Minimum execution time: 40_902 nanoseconds.
Weight::from_ref_time(41_638_000 as u64)
Weight::from_parts(41_638_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
// Minimum execution time: 30_093 nanoseconds.
Weight::from_ref_time(30_732_000 as u64)
Weight::from_parts(30_732_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
// Minimum execution time: 23_901 nanoseconds.
Weight::from_ref_time(24_238_000 as u64)
Weight::from_parts(24_238_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
// Minimum execution time: 26_402 nanoseconds.
Weight::from_ref_time(27_026_000 as u64)
Weight::from_parts(27_026_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
// Minimum execution time: 40_328 nanoseconds.
Weight::from_ref_time(41_242_000 as u64)
Weight::from_parts(41_242_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
// Minimum execution time: 35_401 nanoseconds.
Weight::from_ref_time(36_122_000 as u64)
Weight::from_parts(36_122_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight {
// Minimum execution time: 20_178 nanoseconds.
Weight::from_ref_time(20_435_000 as u64)
Weight::from_parts(20_435_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1884`
// Estimated: `8288`
// Minimum execution time: 49_883 nanoseconds.
Weight::from_ref_time(50_796_000)
.saturating_add(Weight::from_proof_size(8288))
Weight::from_parts(50_796_000, 0)
.saturating_add(Weight::from_parts(0, 8288))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
Expand All @@ -70,8 +70,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1710`
// Estimated: `7777`
// Minimum execution time: 35_180 nanoseconds.
Weight::from_ref_time(36_037_000)
.saturating_add(Weight::from_proof_size(7777))
Weight::from_parts(36_037_000, 0)
.saturating_add(Weight::from_parts(0, 7777))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -84,8 +84,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1360`
// Estimated: `3098`
// Minimum execution time: 23_788 nanoseconds.
Weight::from_ref_time(24_661_000)
.saturating_add(Weight::from_proof_size(3098))
Weight::from_parts(24_661_000, 0)
.saturating_add(Weight::from_parts(0, 3098))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -100,8 +100,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1918`
// Estimated: `5701`
// Minimum execution time: 33_223 nanoseconds.
Weight::from_ref_time(33_679_000)
.saturating_add(Weight::from_proof_size(5701))
Weight::from_parts(33_679_000, 0)
.saturating_add(Weight::from_parts(0, 5701))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -116,8 +116,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1880`
// Estimated: `10891`
// Minimum execution time: 47_875 nanoseconds.
Weight::from_ref_time(49_321_000)
.saturating_add(Weight::from_proof_size(10891))
Weight::from_parts(49_321_000, 0)
.saturating_add(Weight::from_parts(0, 10891))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand All @@ -130,8 +130,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1882`
// Estimated: `7777`
// Minimum execution time: 44_440 nanoseconds.
Weight::from_ref_time(45_714_000)
.saturating_add(Weight::from_proof_size(7777))
Weight::from_parts(45_714_000, 0)
.saturating_add(Weight::from_parts(0, 7777))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -142,8 +142,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Measured: `1358`
// Estimated: `2587`
// Minimum execution time: 22_362 nanoseconds.
Weight::from_ref_time(23_025_000)
.saturating_add(Weight::from_proof_size(2587))
Weight::from_parts(23_025_000, 0)
.saturating_add(Weight::from_parts(0, 2587))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand Down
Loading