Skip to content

Commit

Permalink
set MaxScheduledPerBlock for benchmark purposes (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
luispdm authored Oct 29, 2024
1 parent 6a22578 commit 4f4c19d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions runtime/laos/src/configs/scheduler.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 4f4c19d

Please sign in to comment.