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

Commit de9e147

Browse files
authored
Companion for Weight v1.5 Follow Up (#5949)
* updates * remove new * fix up some stuff * fix cargo files * fix * fix template * update lockfile for {"substrate"} * Update block_weights.rs * remove unused * remove unused Co-authored-by: parity-processbot <>
1 parent 91580f1 commit de9e147

File tree

128 files changed

+969
-968
lines changed

Some content is hidden

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

128 files changed

+969
-968
lines changed

Cargo.lock

Lines changed: 170 additions & 170 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/common/src/crowdloan/migration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub mod crowdloan_index_migration {
9090
/// This migration converts crowdloans to use a crowdloan index rather than the parachain id as a
9191
/// unique identifier. This makes it easier to swap two crowdloans between parachains.
9292
pub fn migrate<T: Config>() -> frame_support::weights::Weight {
93-
let mut weight = Weight::new();
93+
let mut weight = Weight::zero();
9494

9595
// First migrate `NextTrieIndex` counter to `NextFundIndex`.
9696

runtime/common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(1);
6969
/// by Operational extrinsics.
7070
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
7171
/// We allow for 2 seconds of compute with a 6 second average block time.
72-
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.scalar_saturating_mul(2);
72+
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2);
7373

7474
const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());
7575

runtime/common/src/slots/migration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub mod slots_crowdloan_index_migration {
5151
}
5252

5353
pub fn migrate<T: Config + crowdloan::Config>() -> frame_support::weights::Weight {
54-
let mut weight = Weight::new();
54+
let mut weight = Weight::zero();
5555

5656
for (para_id, mut leases) in Leases::<T>::iter() {
5757
weight = weight.saturating_add(T::DbWeight::get().reads(2));

runtime/kusama/constants/src/weights/block_weights.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ parameter_types! {
5454
/// 99th: 6_332_047
5555
/// 95th: 6_308_225
5656
/// 75th: 6_236_204
57-
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.scalar_saturating_mul(6_192_341);
57+
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(6_192_341);
5858
}
5959

6060
#[cfg(test)]
@@ -69,8 +69,8 @@ mod test_weights {
6969
let w = super::BlockExecutionWeight::get();
7070

7171
// At least 100 µs.
72-
assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs.");
72+
assert!(w >= 100u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs.");
7373
// At most 50 ms.
74-
assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
74+
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
7575
}
7676
}

runtime/kusama/constants/src/weights/extrinsic_weights.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ parameter_types! {
5353
/// 99th: 87_527
5454
/// 95th: 86_901
5555
/// 75th: 86_308
56-
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.scalar_saturating_mul(86_309);
56+
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(86_309);
5757
}
5858

5959
#[cfg(test)]
@@ -68,7 +68,7 @@ mod test_weights {
6868
let w = super::ExtrinsicBaseWeight::get();
6969

7070
// At least 10 µs.
71-
assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
71+
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
7272
// At most 1 ms.
7373
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
7474
}

runtime/kusama/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ impl parachains_paras::Config for Runtime {
11411141
}
11421142

11431143
parameter_types! {
1144-
pub const FirstMessageFactorPercent: Weight = Weight::from_ref_time(100);
1144+
pub const FirstMessageFactorPercent: u64 = 100;
11451145
}
11461146

11471147
impl parachains_ump::Config for Runtime {

runtime/kusama/src/weights/frame_benchmarking_baseline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh
6868
fn sr25519_verification(i: u32, ) -> Weight {
6969
Weight::from_ref_time(0 as RefTimeWeight)
7070
// Standard Error: 38_000
71-
.saturating_add(Weight::from_ref_time(47_929_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
71+
.saturating_add(Weight::from_ref_time(47_929_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
7272
}
7373
// Storage: Skipped Metadata (r:0 w:0)
7474
/// The range of component `i` is `[0, 1000]`.
7575
fn storage_read(i: u32, ) -> Weight {
7676
Weight::from_ref_time(0 as RefTimeWeight)
7777
// Standard Error: 4_000
78-
.saturating_add(Weight::from_ref_time(2_101_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
78+
.saturating_add(Weight::from_ref_time(2_101_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
7979
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
8080
}
8181
// Storage: Skipped Metadata (r:0 w:0)
8282
/// The range of component `i` is `[0, 1000]`.
8383
fn storage_write(i: u32, ) -> Weight {
8484
Weight::from_ref_time(0 as RefTimeWeight)
8585
// Standard Error: 0
86-
.saturating_add(Weight::from_ref_time(330_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
86+
.saturating_add(Weight::from_ref_time(330_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
8787
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
8888
}
8989
}

runtime/kusama/src/weights/frame_election_provider_support.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for We
5050
fn phragmen(v: u32, _t: u32, d: u32, ) -> Weight {
5151
Weight::from_ref_time(0 as RefTimeWeight)
5252
// Standard Error: 87_000
53-
.saturating_add(Weight::from_ref_time(22_196_000 as RefTimeWeight).scalar_saturating_mul(v as RefTimeWeight))
53+
.saturating_add(Weight::from_ref_time(22_196_000 as RefTimeWeight).saturating_mul(v as RefTimeWeight))
5454
// Standard Error: 7_520_000
55-
.saturating_add(Weight::from_ref_time(3_555_366_000 as RefTimeWeight).scalar_saturating_mul(d as RefTimeWeight))
55+
.saturating_add(Weight::from_ref_time(3_555_366_000 as RefTimeWeight).saturating_mul(d as RefTimeWeight))
5656
}
5757
/// The range of component `v` is `[1000, 2000]`.
5858
/// The range of component `t` is `[500, 1000]`.
5959
/// The range of component `d` is `[5, 16]`.
6060
fn phragmms(v: u32, _t: u32, d: u32, ) -> Weight {
6161
Weight::from_ref_time(0 as RefTimeWeight)
6262
// Standard Error: 74_000
63-
.saturating_add(Weight::from_ref_time(15_098_000 as RefTimeWeight).scalar_saturating_mul(v as RefTimeWeight))
63+
.saturating_add(Weight::from_ref_time(15_098_000 as RefTimeWeight).saturating_mul(v as RefTimeWeight))
6464
// Standard Error: 6_402_000
65-
.saturating_add(Weight::from_ref_time(2_580_118_000 as RefTimeWeight).scalar_saturating_mul(d as RefTimeWeight))
65+
.saturating_add(Weight::from_ref_time(2_580_118_000 as RefTimeWeight).saturating_mul(d as RefTimeWeight))
6666
}
6767
}

runtime/kusama/src/weights/frame_system.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
4848
fn remark(b: u32, ) -> Weight {
4949
Weight::from_ref_time(0 as RefTimeWeight)
5050
// Standard Error: 0
51-
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
51+
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
5252
}
5353
/// The range of component `b` is `[0, 3932160]`.
5454
fn remark_with_event(b: u32, ) -> Weight {
5555
Weight::from_ref_time(0 as RefTimeWeight)
5656
// Standard Error: 0
57-
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
57+
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
5858
}
5959
// Storage: System Digest (r:1 w:1)
6060
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
@@ -68,23 +68,23 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
6868
fn set_storage(i: u32, ) -> Weight {
6969
Weight::from_ref_time(0 as RefTimeWeight)
7070
// Standard Error: 1_000
71-
.saturating_add(Weight::from_ref_time(550_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
71+
.saturating_add(Weight::from_ref_time(550_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
7272
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
7373
}
7474
// Storage: Skipped Metadata (r:0 w:0)
7575
/// The range of component `i` is `[1, 1000]`.
7676
fn kill_storage(i: u32, ) -> Weight {
7777
Weight::from_ref_time(0 as RefTimeWeight)
7878
// Standard Error: 1_000
79-
.saturating_add(Weight::from_ref_time(441_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
79+
.saturating_add(Weight::from_ref_time(441_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
8080
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
8181
}
8282
// Storage: Skipped Metadata (r:0 w:0)
8383
/// The range of component `p` is `[1, 1000]`.
8484
fn kill_prefix(p: u32, ) -> Weight {
8585
Weight::from_ref_time(0 as RefTimeWeight)
8686
// Standard Error: 1_000
87-
.saturating_add(Weight::from_ref_time(955_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
87+
.saturating_add(Weight::from_ref_time(955_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
8888
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
8989
}
9090
}

0 commit comments

Comments
 (0)