Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -208,7 +224,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ConsensusHook = ConsensusHook;
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
type RelayParentOffset = ConstU32<RELAY_PARENT_OFFSET>;
type SchedulingSignatureVerifier = ();
type SchedulingSignatureVerifier = SchedulingV3AcceptAll;
}

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -373,7 +389,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases;
type ConsensusHook = ConsensusHook;
type RelayParentOffset = ConstU32<RELAY_PARENT_OFFSET>;
type SchedulingSignatureVerifier = ();
type SchedulingSignatureVerifier = SchedulingV3AcceptAll;
}

impl pallet_message_queue::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/westend/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 5 additions & 3 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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::<u32>() / 2)
(10 * MINUTES).min(EpochDuration::get().saturated_into::<u32>() / 2)
);
pub UnsignedPhase: u32 = prod_or_fast!(
EPOCH_DURATION_IN_SLOTS / 4,
(1 * MINUTES).min(EpochDuration::get().saturated_into::<u32>() / 2)
(10 * MINUTES).min(EpochDuration::get().saturated_into::<u32>() / 2)
);

// signed config
Expand Down
Loading