difftreelog
fix lookahead leftovers
in: master
6 files changed
primitives/common/src/constants.rsdiffbeforeafterboth26#[cfg(not(feature = "lookahead"))]26#[cfg(not(feature = "lookahead"))]27pub const MILLISECS_PER_BLOCK: u64 = 12000;27pub const MILLISECS_PER_BLOCK: u64 = 12000;28#[cfg(feature = "lookahead")]28#[cfg(feature = "lookahead")]29pub const MILLISECS_PER_BLOCK: u64 = 3000;29pub const MILLISECS_PER_BLOCK: u64 = 6000;30pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;30pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;313132pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;32pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;runtime/common/config/parachain.rsdiffbeforeafterboth43 #[cfg(feature = "lookahead")]43 #[cfg(feature = "lookahead")]44 type CheckAssociatedRelayNumber =44 type CheckAssociatedRelayNumber =45 cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;45 cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;46 #[cfg(feature = "lookahead")]47 type ConsensusHook = ConsensusHook;46}48}474948impl parachain_info::Config for Runtime {}50impl parachain_info::Config for Runtime {}runtime/common/config/substrate.rsdiffbeforeafterboth17use frame_support::{17use frame_support::{18 dispatch::DispatchClass,18 dispatch::DispatchClass,19 ord_parameter_types, parameter_types,19 ord_parameter_types, parameter_types,20 traits::{ConstBool, ConstU32, Everything, NeverEnsureOrigin},20 traits::{ConstBool, ConstU32, ConstU64, Everything, NeverEnsureOrigin},21 weights::{21 weights::{22 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},22 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},23 ConstantMultiplier,23 ConstantMultiplier,134 type MaxKeyLen = MigrationMaxKeyLen;134 type MaxKeyLen = MigrationMaxKeyLen;135}135}136137parameter_types! {138 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;139}140136141impl pallet_timestamp::Config for Runtime {137impl pallet_timestamp::Config for Runtime {142 /// A timestamp: milliseconds since the unix epoch.138 /// A timestamp: milliseconds since the unix epoch.143 type Moment = u64;139 type Moment = u64;144 type OnTimestampSet = ();140 type OnTimestampSet = ();141 #[cfg(not(feature = "lookahead"))]145 type MinimumPeriod = MinimumPeriod;142 type MinimumPeriod = ConstU64<{SLOT_DURATION / 2}>;143 #[cfg(feature = "lookahead")]144 type MinimumPeriod = ConstU64<0>;146 type WeightInfo = ();145 type WeightInfo = ();147}146}148147247 type DisabledValidators = ();246 type DisabledValidators = ();248 type MaxAuthorities = MaxAuthorities;247 type MaxAuthorities = MaxAuthorities;249 type AllowMultipleBlocksPerSlot = ConstBool<true>;248 type AllowMultipleBlocksPerSlot = ConstBool<true>;249 #[cfg(feature = "lookahead")]250 type SlotDuration = ConstU64<SLOT_DURATION>;250}251}251252252impl pallet_utility::Config for Runtime {253impl pallet_utility::Config for Runtime {runtime/common/mod.rsdiffbeforeafterboth44use up_common::types::{AccountId, BlockNumber};44use up_common::types::{AccountId, BlockNumber};454546use crate::{46use crate::{47 AllPalletsWithSystem, Aura, Balances, InherentDataExt, Runtime, RuntimeCall, Signature,47 AllPalletsWithSystem, Aura, Balances, Runtime, RuntimeCall, Signature,48 Treasury,48 Treasury,49};49};5050146 }146 }147}147}148148149#[cfg(not(feature = "lookahead"))]149pub(crate) struct CheckInherents;150pub(crate) struct CheckInherents;150151152#[cfg(not(feature = "lookahead"))]151impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {153impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {152 fn check_inherents(154 fn check_inherents(153 block: &Block,155 block: &Block,154 relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof,156 relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof,155 ) -> sp_inherents::CheckInherentsResult {157 ) -> sp_inherents::CheckInherentsResult {158 use crate::InherentDataExt;159156 let relay_chain_slot = relay_state_proof160 let relay_chain_slot = relay_state_proof157 .read_slot()161 .read_slot()runtime/common/runtime_apis.rsdiffbeforeafterboth485485486 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {486 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {487 fn slot_duration() -> sp_consensus_aura::SlotDuration {487 fn slot_duration() -> sp_consensus_aura::SlotDuration {488 #[cfg(not(feature = "lookahead"))]489 {488 sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())490 sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())489 }491 }492 #[cfg(feature = "lookahead")]493 {494 sp_consensus_aura::SlotDuration::from_millis(up_common::constants::SLOT_DURATION)495 }496 }490497491 fn authorities() -> Vec<AuraId> {498 fn authorities() -> Vec<AuraId> {runtime/opal/src/lib.rsdiffbeforeafterboth676768impl_common_runtime_apis!();68impl_common_runtime_apis!();696970// CheckInherents is included in consensus hook71#[cfg(not(feature = "lookahead"))]70cumulus_pallet_parachain_system::register_validate_block!(72cumulus_pallet_parachain_system::register_validate_block!(71 Runtime = Runtime,73 Runtime = Runtime,72 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,74 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,73 CheckInherents = CheckInherents,75 CheckInherents = CheckInherents,74);76);77#[cfg(feature = "lookahead")]78cumulus_pallet_parachain_system::register_validate_block!(79 Runtime = Runtime,80 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,81);7582