From 4f4c19d21840a85174e9cac28590248aa63ff865 Mon Sep 17 00:00:00 2001 From: Luigi di Girolamo <17044119+luispdm@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:25:20 +0100 Subject: [PATCH] set `MaxScheduledPerBlock` for benchmark purposes (#858) --- runtime/laos/src/configs/scheduler.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/runtime/laos/src/configs/scheduler.rs b/runtime/laos/src/configs/scheduler.rs index 0a9afb0b..1f7d97bb 100644 --- a/runtime/laos/src/configs/scheduler.rs +++ b/runtime/laos/src/configs/scheduler.rs @@ -1,18 +1,24 @@ use crate::{ weights, AccountId, OriginCaller, Preimage, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, }; -use frame_support::{parameter_types, traits::EqualPrivilegeOnly, weights::Weight}; +use frame_support::{ + parameter_types, + traits::{ConstU32, EqualPrivilegeOnly}, + weights::Weight, +}; use frame_system::EnsureRoot; use laos_primitives::RuntimeBlockWeights; pub use parachains_common::NORMAL_DISPATCH_RATIO; parameter_types! { - pub const MaxScheduledPerBlock: u32 = 50; pub MaximumSchedulerWeight: Weight = NORMAL_DISPATCH_RATIO * RuntimeBlockWeights::get().max_block; } impl pallet_scheduler::Config for Runtime { - type MaxScheduledPerBlock = MaxScheduledPerBlock; + #[cfg(feature = "runtime-benchmarks")] + type MaxScheduledPerBlock = ConstU32<512>; + #[cfg(not(feature = "runtime-benchmarks"))] + type MaxScheduledPerBlock = ConstU32<50>; type MaximumWeight = MaximumSchedulerWeight; type OriginPrivilegeCmp = EqualPrivilegeOnly; type PalletsOrigin = OriginCaller;