git.delta.rocks / unique-network / refs/commits / 730aec0d5871

difftreelog

source

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