Skip to content

Commit

Permalink
Fix slot_duration divide by zero panic in rococo-parachain runtime (#…
Browse files Browse the repository at this point in the history
…2612)

Adds the fix in #2039 to
the rococo-parachain runtime.
  • Loading branch information
Sophia-Gold authored Dec 28, 2023
1 parent 5c0b8e0 commit 201ec44
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = Aura;
#[cfg(feature = "experimental")]
type MinimumPeriod = ConstU64<0>;
#[cfg(not(feature = "experimental"))]
type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
type WeightInfo = ();
}
Expand Down Expand Up @@ -757,7 +760,7 @@ impl_runtime_apis! {

impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
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> {
Expand Down

0 comments on commit 201ec44

Please sign in to comment.