diff --git a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs index bcddf5f62e35..be58656b7b22 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs @@ -188,6 +188,22 @@ const BLOCK_PROCESSING_VELOCITY: u32 = 3; /// into the relay chain. const UNINCLUDED_SEGMENT_CAPACITY: u32 = (3 + RELAY_PARENT_OFFSET) * BLOCK_PROCESSING_VELOCITY; +/// Enables V3 scheduling while accepting any scheduling signature, like the +/// `cumulus-test-runtime` `v3-descriptor` flavor does. Glutton is a testing-only +/// runtime, so signature verification adds nothing here. +pub struct SchedulingV3AcceptAll; + +impl VerifySchedulingSignature for SchedulingV3AcceptAll { + const V3_SCHEDULING_ENABLED: bool = true; + + fn verify( + _signed_info: &cumulus_primitives_core::SignedSchedulingInfo, + _internal_scheduling_parent_header: &cumulus_primitives_core::relay_chain::Header, + ) -> bool { + true + } +} + type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< Runtime, RELAY_CHAIN_SLOT_DURATION_MILLIS, @@ -208,7 +224,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; type RelayParentOffset = ConstU32; - type SchedulingSignatureVerifier = (); + type SchedulingSignatureVerifier = SchedulingV3AcceptAll; } parameter_types! { diff --git a/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs index f221fb62da5a..c5feacb73157 100644 --- a/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs @@ -153,6 +153,22 @@ const BLOCK_PROCESSING_VELOCITY: u32 = 12; /// Relay chain slot duration, in milliseconds. const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; +/// Enables V3 scheduling while accepting any scheduling signature, like the +/// `cumulus-test-runtime` `v3-descriptor` flavor does. YAP is a testing-only +/// runtime, so signature verification adds nothing here. +pub struct SchedulingV3AcceptAll; + +impl VerifySchedulingSignature for SchedulingV3AcceptAll { + const V3_SCHEDULING_ENABLED: bool = true; + + fn verify( + _signed_info: &cumulus_primitives_core::SignedSchedulingInfo, + _internal_scheduling_parent_header: &cumulus_primitives_core::relay_chain::Header, + ) -> bool { + true + } +} + parameter_types! { pub const BlockHashCount: BlockNumber = 250; pub const Version: RuntimeVersion = VERSION; @@ -373,7 +389,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; type ConsensusHook = ConsensusHook; type RelayParentOffset = ConstU32; - type SchedulingSignatureVerifier = (); + type SchedulingSignatureVerifier = SchedulingV3AcceptAll; } impl pallet_message_queue::Config for Runtime { diff --git a/polkadot/runtime/westend/constants/src/lib.rs b/polkadot/runtime/westend/constants/src/lib.rs index df5dc57c8a5f..0a0d59d18ea4 100644 --- a/polkadot/runtime/westend/constants/src/lib.rs +++ b/polkadot/runtime/westend/constants/src/lib.rs @@ -42,7 +42,7 @@ pub mod time { pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(1 * HOURS, 1 * MINUTES); + pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(1 * HOURS, 10 * MINUTES); // These time units are defined in number of blocks. pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index c90891f14930..a81601a538f8 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -348,7 +348,9 @@ impl pallet_preimage::Config for Runtime { parameter_types! { pub const EpochDuration: u64 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS as u64, - 2 * MINUTES as u64 + // 100-slot (10-minute) sessions for versi, matching the historical + // westend-100 runtime the network ran before. + 10 * MINUTES as u64 ); pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; pub const ReportLongevity: u64 = @@ -571,11 +573,11 @@ parameter_types! { // phase durations. 1/4 of the last session for each. pub SignedPhase: u32 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS / 4, - (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2) + (10 * MINUTES).min(EpochDuration::get().saturated_into::() / 2) ); pub UnsignedPhase: u32 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS / 4, - (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2) + (10 * MINUTES).min(EpochDuration::get().saturated_into::() / 2) ); // signed config