Skip to content

Commit

Permalink
Companion for Weight v1.5 Follow Up (#5949)
Browse files Browse the repository at this point in the history
* 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 <>
  • Loading branch information
shawntabrizi authored Sep 1, 2022
1 parent 7582d3e commit 6e5adab
Show file tree
Hide file tree
Showing 68 changed files with 508 additions and 508 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
fn pool_withdraw_unbonded(s: u32, ) -> Weight {
Weight::from_ref_time(41_129_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(33_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
.saturating_add(Weight::from_ref_time(33_000 as RefTimeWeight).saturating_mul(s as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
Expand All @@ -142,7 +142,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
fn withdraw_unbonded_update(s: u32, ) -> Weight {
Weight::from_ref_time(78_870_000 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(49_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
.saturating_add(Weight::from_ref_time(49_000 as RefTimeWeight).saturating_mul(s as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(8 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(7 as RefTimeWeight))
}
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
fn nominate(n: u32, ) -> Weight {
Weight::from_ref_time(50_310_000 as RefTimeWeight)
// Standard Error: 4_000
.saturating_add(Weight::from_ref_time(2_137_000 as RefTimeWeight).scalar_saturating_mul(n as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_137_000 as RefTimeWeight).saturating_mul(n as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(12 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(n as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(5 as RefTimeWeight))
Expand All @@ -233,7 +233,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
fn set_metadata(n: u32, ) -> Weight {
Weight::from_ref_time(13_890_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(n as RefTimeWeight))
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(n as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<T: frame_system::Config> runtime_common::crowdloan::WeightInfo for WeightIn
fn refund(k: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 14_000
.saturating_add(Weight::from_ref_time(18_621_000 as RefTimeWeight).scalar_saturating_mul(k as RefTimeWeight))
.saturating_add(Weight::from_ref_time(18_621_000 as RefTimeWeight).saturating_mul(k as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((2 as RefTimeWeight).saturating_mul(k as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
Expand Down Expand Up @@ -125,7 +125,7 @@ impl<T: frame_system::Config> runtime_common::crowdloan::WeightInfo for WeightIn
fn on_initialize(n: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 28_000
.saturating_add(Weight::from_ref_time(48_794_000 as RefTimeWeight).scalar_saturating_mul(n as RefTimeWeight))
.saturating_add(Weight::from_ref_time(48_794_000 as RefTimeWeight).saturating_mul(n as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(5 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((5 as RefTimeWeight).saturating_mul(n as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
Expand Down
6 changes: 3 additions & 3 deletions polkadot/runtime/westend/src/weights/xcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ impl WeighMultiAssets for MultiAssetFilter {
AssetTypes::Balances => balances_weight,
AssetTypes::Unknown => Weight::MAX,
})
.fold(Weight::new(), |acc, x| acc.saturating_add(x)),
Self::Wild(_) => balances_weight.scalar_saturating_mul(MAX_ASSETS as u64),
.fold(Weight::zero(), |acc, x| acc.saturating_add(x)),
Self::Wild(_) => balances_weight.saturating_mul(MAX_ASSETS as u64),
};

weight.ref_time()
Expand All @@ -66,7 +66,7 @@ impl WeighMultiAssets for MultiAssets {
AssetTypes::Balances => balances_weight,
AssetTypes::Unknown => Weight::MAX,
})
.fold(Weight::new(), |acc, x| acc.saturating_add(x));
.fold(Weight::zero(), |acc, x| acc.saturating_add(x));

weight.ref_time()
}
Expand Down
6 changes: 3 additions & 3 deletions relay/kusama/constants/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ parameter_types! {
/// 99th: 6_332_047
/// 95th: 6_308_225
/// 75th: 6_236_204
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.scalar_saturating_mul(6_192_341);
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(6_192_341);
}

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

// At least 100 µs.
assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs.");
assert!(w >= 100u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs.");
// At most 50 ms.
assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
}
}
4 changes: 2 additions & 2 deletions relay/kusama/constants/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ parameter_types! {
/// 99th: 87_527
/// 95th: 86_901
/// 75th: 86_308
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.scalar_saturating_mul(86_309);
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(86_309);
}

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

// At least 10 µs.
assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
// At most 1 ms.
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
}
Expand Down
2 changes: 1 addition & 1 deletion relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ impl parachains_paras::Config for Runtime {
}

parameter_types! {
pub const FirstMessageFactorPercent: Weight = Weight::from_ref_time(100);
pub const FirstMessageFactorPercent: u64 = 100;
}

impl parachains_ump::Config for Runtime {
Expand Down
6 changes: 3 additions & 3 deletions relay/kusama/src/weights/frame_benchmarking_baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh
fn sr25519_verification(i: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 38_000
.saturating_add(Weight::from_ref_time(47_929_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
.saturating_add(Weight::from_ref_time(47_929_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[0, 1000]`.
fn storage_read(i: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 4_000
.saturating_add(Weight::from_ref_time(2_101_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_101_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[0, 1000]`.
fn storage_write(i: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(330_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
.saturating_add(Weight::from_ref_time(330_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
}
}
8 changes: 4 additions & 4 deletions relay/kusama/src/weights/frame_election_provider_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for We
fn phragmen(v: u32, _t: u32, d: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 87_000
.saturating_add(Weight::from_ref_time(22_196_000 as RefTimeWeight).scalar_saturating_mul(v as RefTimeWeight))
.saturating_add(Weight::from_ref_time(22_196_000 as RefTimeWeight).saturating_mul(v as RefTimeWeight))
// Standard Error: 7_520_000
.saturating_add(Weight::from_ref_time(3_555_366_000 as RefTimeWeight).scalar_saturating_mul(d as RefTimeWeight))
.saturating_add(Weight::from_ref_time(3_555_366_000 as RefTimeWeight).saturating_mul(d as RefTimeWeight))
}
/// The range of component `v` is `[1000, 2000]`.
/// The range of component `t` is `[500, 1000]`.
/// The range of component `d` is `[5, 16]`.
fn phragmms(v: u32, _t: u32, d: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 74_000
.saturating_add(Weight::from_ref_time(15_098_000 as RefTimeWeight).scalar_saturating_mul(v as RefTimeWeight))
.saturating_add(Weight::from_ref_time(15_098_000 as RefTimeWeight).saturating_mul(v as RefTimeWeight))
// Standard Error: 6_402_000
.saturating_add(Weight::from_ref_time(2_580_118_000 as RefTimeWeight).scalar_saturating_mul(d as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_580_118_000 as RefTimeWeight).saturating_mul(d as RefTimeWeight))
}
}
10 changes: 5 additions & 5 deletions relay/kusama/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
fn remark(b: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
}
/// The range of component `b` is `[0, 3932160]`.
fn remark_with_event(b: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
}
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
Expand All @@ -68,23 +68,23 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
fn set_storage(i: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(550_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
.saturating_add(Weight::from_ref_time(550_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[1, 1000]`.
fn kill_storage(i: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(441_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
.saturating_add(Weight::from_ref_time(441_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `p` is `[1, 1000]`.
fn kill_prefix(p: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(955_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
.saturating_add(Weight::from_ref_time(955_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
}
}
4 changes: 2 additions & 2 deletions relay/kusama/src/weights/pallet_bounties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<T: frame_system::Config> pallet_bounties::WeightInfo for WeightInfo<T> {
fn propose_bounty(d: u32, ) -> Weight {
Weight::from_ref_time(26_654_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(d as RefTimeWeight))
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(d as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(4 as RefTimeWeight))
}
Expand Down Expand Up @@ -130,7 +130,7 @@ impl<T: frame_system::Config> pallet_bounties::WeightInfo for WeightInfo<T> {
fn spend_funds(b: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 30_000
.saturating_add(Weight::from_ref_time(30_775_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
.saturating_add(Weight::from_ref_time(30_775_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((3 as RefTimeWeight).saturating_mul(b as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
Expand Down
2 changes: 1 addition & 1 deletion relay/kusama/src/weights/pallet_child_bounties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl<T: frame_system::Config> pallet_child_bounties::WeightInfo for WeightInfo<T
fn add_child_bounty(d: u32, ) -> Weight {
Weight::from_ref_time(48_890_000 as RefTimeWeight)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(d as RefTimeWeight))
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(d as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(5 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(6 as RefTimeWeight))
}
Expand Down
Loading

0 comments on commit 6e5adab

Please sign in to comment.