Companion for paritytech/substrate#12868 (#1970)

* Replace WEIGHT_PER_* with WEIGHT_REF_TIME_PER_*

* Fixes

* Fixes

* update lockfile for {"substrate", "polkadot"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Keith Yeung
2022-12-09 02:36:30 +09:00
committed by GitHub
parent 97bc16ba7c
commit f3847ead3c
49 changed files with 505 additions and 480 deletions
+5 -4
View File
@@ -68,7 +68,7 @@ mod types {
/// Common constants of parachains.
mod constants {
use super::types::BlockNumber;
use frame_support::weights::{constants::WEIGHT_PER_SECOND, Weight};
use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight};
use sp_runtime::Perbill;
/// This determines the average expected block time that we are targeting. Blocks will be
/// produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is picked up by
@@ -92,9 +92,10 @@ mod constants {
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 0.5 seconds of compute with a 6 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND
.saturating_div(2)
.set_proof_size(polkadot_primitives::v2::MAX_POV_SIZE as u64);
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
polkadot_primitives::v2::MAX_POV_SIZE as u64,
);
}
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know