git.delta.rocks / unique-network / refs/commits / 7e0ba1d9645e

difftreelog

source

runtime/common/src/constants.rs1.1 KiBsourcehistory
1use sp_runtime::Perbill;2use frame_support::{3    parameter_types, weights::{4        Weight,5        constants::WEIGHT_PER_SECOND6    },7};8use crate::types::BlockNumber;910pub const MILLISECS_PER_BLOCK: u64 = 12000;1112pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;1314// These time units are defined in number of blocks.15pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);16pub const HOURS: BlockNumber = MINUTES * 60;17pub const DAYS: BlockNumber = HOURS * 24;1819/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.20/// This is used to limit the maximal weight of a single extrinsic.21pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);22/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used23/// by  Operational  extrinsics.24pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);25/// We allow for 2 seconds of compute with a 6 second average block time.26pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2;2728parameter_types! {29	pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS;30}