1234567891011121314151617use cumulus_primitives_core::AggregateMessageOrigin;18use frame_support::{parameter_types, traits::EnqueueWithOrigin, weights::Weight};19use up_common::constants::*;2021use crate::{MessageQueue, Runtime, RuntimeEvent, XcmpQueue};2223parameter_types! {24 pub const RelayMsgOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;25 pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);26 pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);27}2829impl cumulus_pallet_parachain_system::Config for Runtime {30 type RuntimeEvent = RuntimeEvent;31 type SelfParaId = staging_parachain_info::Pallet<Self>;32 type OnSystemEvent = ();33 type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight<Self>;34 type OutboundXcmpMessageSource = XcmpQueue;35 type DmpQueue = EnqueueWithOrigin<MessageQueue, RelayMsgOrigin>;36 type ReservedDmpWeight = ReservedDmpWeight;37 type ReservedXcmpWeight = ReservedXcmpWeight;38 type XcmpMessageHandler = XcmpQueue;39 #[cfg(not(feature = "lookahead"))]40 type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;41 #[cfg(feature = "lookahead")]42 type CheckAssociatedRelayNumber =43 cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;44 #[cfg(feature = "lookahead")]45 type ConsensusHook = ConsensusHook;46}4748impl staging_parachain_info::Config for Runtime {}4950impl cumulus_pallet_aura_ext::Config for Runtime {}51525354#[cfg(feature = "lookahead")]55const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;565758#[cfg(feature = "lookahead")]59const BLOCK_PROCESSING_VELOCITY: u32 = 2;60#[cfg(feature = "lookahead")]61pub type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<62 Runtime,63 { MILLISECS_PER_RELAY_BLOCK as u32 },64 BLOCK_PROCESSING_VELOCITY,65 UNINCLUDED_SEGMENT_CAPACITY,66>;