diff --git a/runtime/stout/src/lib.rs b/runtime/stout/src/lib.rs index 7fb73496..09d7ae29 100644 --- a/runtime/stout/src/lib.rs +++ b/runtime/stout/src/lib.rs @@ -287,14 +287,17 @@ parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } -/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included -/// into the relay chain. -const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; -/// How many parachain blocks are processed by the relay chain per parent. Limits the -/// number of blocks authored per slot. -const BLOCK_PROCESSING_VELOCITY: u32 = 1; -/// Relay chain slot duration, in milliseconds. -const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; +#[cfg(feature = "parameterized-consensus-hook")] +mod consensus_hook_constants { + /// Maximum number of blocks simultaneously accepted by the Runtime, not yet included + /// into the relay chain. + pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; + /// How many parachain blocks are processed by the relay chain per parent. Limits the + /// number of blocks authored per slot. + pub const BLOCK_PROCESSING_VELOCITY: u32 = 1; + /// Relay chain slot duration, in milliseconds. + pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; +} impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -309,9 +312,9 @@ impl cumulus_pallet_parachain_system::Config for Runtime { #[cfg(feature = "parameterized-consensus-hook")] type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, + consensus_hook_constants::RELAY_CHAIN_SLOT_DURATION_MILLIS, + consensus_hook_constants::BLOCK_PROCESSING_VELOCITY, + consensus_hook_constants::UNINCLUDED_SEGMENT_CAPACITY, >; } diff --git a/runtime/trappist/src/impls.rs b/runtime/trappist/src/impls.rs index 8b0b7e73..374e9fa8 100644 --- a/runtime/trappist/src/impls.rs +++ b/runtime/trappist/src/impls.rs @@ -18,7 +18,6 @@ //! Auxiliary struct/enums for parachain runtimes. //! Taken from polkadot/runtime/common (at a21cd64) and adapted for parachains. -use cumulus_primitives_core::DmpMessageHandler; use frame_support::traits::{Currency, Imbalance, OnUnbalanced}; pub use log; use sp_std::marker::PhantomData; diff --git a/runtime/trappist/src/lib.rs b/runtime/trappist/src/lib.rs index 80a676f3..a70e957b 100644 --- a/runtime/trappist/src/lib.rs +++ b/runtime/trappist/src/lib.rs @@ -301,14 +301,17 @@ parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } -/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included -/// into the relay chain. -const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; -/// How many parachain blocks are processed by the relay chain per parent. Limits the -/// number of blocks authored per slot. -const BLOCK_PROCESSING_VELOCITY: u32 = 1; -/// Relay chain slot duration, in milliseconds. -const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; +#[cfg(feature = "parameterized-consensus-hook")] +mod consensus_hook_constants { + /// Maximum number of blocks simultaneously accepted by the Runtime, not yet included + /// into the relay chain. + pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; + /// How many parachain blocks are processed by the relay chain per parent. Limits the + /// number of blocks authored per slot. + pub const BLOCK_PROCESSING_VELOCITY: u32 = 1; + /// Relay chain slot duration, in milliseconds. + pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; +} impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -323,9 +326,9 @@ impl cumulus_pallet_parachain_system::Config for Runtime { #[cfg(feature = "parameterized-consensus-hook")] type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, + consensus_hook_constants::RELAY_CHAIN_SLOT_DURATION_MILLIS, + consensus_hook_constants::BLOCK_PROCESSING_VELOCITY, + consensus_hook_constants::UNINCLUDED_SEGMENT_CAPACITY, >; } diff --git a/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index ead91044..71625795 100644 --- a/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -96,15 +96,6 @@ impl WeightInfo { .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub(crate) fn reserve_asset_deposited() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 500_000_000_000 picoseconds. - Weight::from_parts(500_000_000_000, 0) - } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)