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

difftreelog

source

runtime/common/config/parachain.rs2.6 KiBsourcehistory
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{parameter_types, weights::Weight};18use up_common::constants::*;1920use crate::{DmpQueue, Runtime, RuntimeEvent, XcmpQueue};2122parameter_types! {23	pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);24	pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);25}2627impl cumulus_pallet_parachain_system::Config for Runtime {28	type RuntimeEvent = RuntimeEvent;29	type SelfParaId = staging_parachain_info::Pallet<Self>;30	type OnSystemEvent = ();31	// type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent<32	// 	MaxDownwardMessageWeight,33	// 	XcmExecutor<XcmConfig>,34	// 	Call,35	// >;36	type OutboundXcmpMessageSource = XcmpQueue;37	type DmpMessageHandler = DmpQueue;38	type ReservedDmpWeight = ReservedDmpWeight;39	type ReservedXcmpWeight = ReservedXcmpWeight;40	type XcmpMessageHandler = XcmpQueue;41	#[cfg(not(feature = "lookahead"))]42	type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;43	#[cfg(feature = "lookahead")]44	type CheckAssociatedRelayNumber =45		cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;46	#[cfg(feature = "lookahead")]47	type ConsensusHook = ConsensusHook;48}4950impl staging_parachain_info::Config for Runtime {}5152impl cumulus_pallet_aura_ext::Config for Runtime {}5354/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included55/// into the relay chain.56#[cfg(feature = "lookahead")]57const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;58/// How many parachain blocks are processed by the relay chain per parent. Limits the59/// number of blocks authored per slot.60#[cfg(feature = "lookahead")]61const BLOCK_PROCESSING_VELOCITY: u32 = 2;62#[cfg(feature = "lookahead")]63pub type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<64	Runtime,65	{ MILLISECS_PER_RELAY_BLOCK as u32 },66	BLOCK_PROCESSING_VELOCITY,67	UNINCLUDED_SEGMENT_CAPACITY,68>;