Fix slot_duration divide by zero panic in rococo-parachain runtime (#2612)

Adds the fix in https://github.com/paritytech/polkadot-sdk/pull/2039 to
the rococo-parachain runtime.
This commit is contained in:
Sophia Gold
2023-12-28 08:54:36 -05:00
committed by GitHub
parent 5c0b8e0bb5
commit 201ec44ae4
@@ -229,6 +229,9 @@ impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch. /// A timestamp: milliseconds since the unix epoch.
type Moment = u64; type Moment = u64;
type OnTimestampSet = Aura; type OnTimestampSet = Aura;
#[cfg(feature = "experimental")]
type MinimumPeriod = ConstU64<0>;
#[cfg(not(feature = "experimental"))]
type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
type WeightInfo = (); type WeightInfo = ();
} }
@@ -757,7 +760,7 @@ impl_runtime_apis! {
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime { impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> sp_consensus_aura::SlotDuration { fn slot_duration() -> sp_consensus_aura::SlotDuration {
sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())
} }
fn authorities() -> Vec<AuraId> { fn authorities() -> Vec<AuraId> {