From b6576d145d2a0efeeb0aadce451e1b12e6e67c82 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Sun, 11 Jun 2023 08:28:19 +0200 Subject: [PATCH] para scheduler: fix division (#7339) * para scheduler: fix division Signed-off-by: Oliver Tale-Yazdi * Update runtime/parachains/src/scheduler.rs Co-authored-by: Liam Aharon --------- Signed-off-by: Oliver Tale-Yazdi Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Liam Aharon --- runtime/parachains/src/scheduler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/parachains/src/scheduler.rs b/runtime/parachains/src/scheduler.rs index cf47fc777cdd..916df1687b9d 100644 --- a/runtime/parachains/src/scheduler.rs +++ b/runtime/parachains/src/scheduler.rs @@ -636,7 +636,7 @@ impl Pallet { let session_start = >::get(); let blocks_since_session_start = now.saturating_sub(session_start); let blocks_since_last_rotation = - blocks_since_session_start % config.group_rotation_frequency; + blocks_since_session_start % config.group_rotation_frequency.max(1u8.into()); let absolute_cutoff = sp_std::cmp::max(config.chain_availability_period, config.thread_availability_period);