mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 04:45:42 +00:00
Scheduler pre block limit note (#13231)
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -364,7 +364,10 @@ impl pallet_scheduler::Config for Runtime {
|
|||||||
type RuntimeCall = RuntimeCall;
|
type RuntimeCall = RuntimeCall;
|
||||||
type MaximumWeight = MaximumSchedulerWeight;
|
type MaximumWeight = MaximumSchedulerWeight;
|
||||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||||
|
#[cfg(feature = "runtime-benchmarks")]
|
||||||
type MaxScheduledPerBlock = ConstU32<512>;
|
type MaxScheduledPerBlock = ConstU32<512>;
|
||||||
|
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||||
|
type MaxScheduledPerBlock = ConstU32<50>;
|
||||||
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
|
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
|
||||||
type OriginPrivilegeCmp = EqualPrivilegeOnly;
|
type OriginPrivilegeCmp = EqualPrivilegeOnly;
|
||||||
type Preimages = Preimage;
|
type Preimages = Preimage;
|
||||||
|
|||||||
@@ -874,22 +874,21 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
|||||||
let when = (when.saturating_add(alarm_interval.saturating_sub(One::one())) /
|
let when = (when.saturating_add(alarm_interval.saturating_sub(One::one())) /
|
||||||
alarm_interval)
|
alarm_interval)
|
||||||
.saturating_mul(alarm_interval);
|
.saturating_mul(alarm_interval);
|
||||||
let maybe_result = T::Scheduler::schedule(
|
let result = T::Scheduler::schedule(
|
||||||
DispatchTime::At(when),
|
DispatchTime::At(when),
|
||||||
None,
|
None,
|
||||||
128u8,
|
128u8,
|
||||||
frame_system::RawOrigin::Root.into(),
|
frame_system::RawOrigin::Root.into(),
|
||||||
call,
|
call,
|
||||||
)
|
|
||||||
.ok()
|
|
||||||
.map(|x| (when, x));
|
|
||||||
debug_assert!(
|
|
||||||
maybe_result.is_some(),
|
|
||||||
"Unable to schedule a new alarm at #{:?} (now: #{:?})?!",
|
|
||||||
when,
|
|
||||||
frame_system::Pallet::<T>::block_number()
|
|
||||||
);
|
);
|
||||||
maybe_result
|
debug_assert!(
|
||||||
|
result.is_ok(),
|
||||||
|
"Unable to schedule a new alarm at #{:?} (now: #{:?}), scheduler error: `{:?}`",
|
||||||
|
when,
|
||||||
|
frame_system::Pallet::<T>::block_number(),
|
||||||
|
result.unwrap_err(),
|
||||||
|
);
|
||||||
|
result.ok().map(|x| (when, x))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mutate a referendum's `status` into the correct deciding state.
|
/// Mutate a referendum's `status` into the correct deciding state.
|
||||||
|
|||||||
@@ -216,6 +216,10 @@ pub mod pallet {
|
|||||||
type OriginPrivilegeCmp: PrivilegeCmp<Self::PalletsOrigin>;
|
type OriginPrivilegeCmp: PrivilegeCmp<Self::PalletsOrigin>;
|
||||||
|
|
||||||
/// The maximum number of scheduled calls in the queue for a single block.
|
/// The maximum number of scheduled calls in the queue for a single block.
|
||||||
|
///
|
||||||
|
/// NOTE:
|
||||||
|
/// + Dependent pallets' benchmarks might require a higher limit for the setting. Set a
|
||||||
|
/// higher limit under `runtime-benchmarks` feature.
|
||||||
#[pallet::constant]
|
#[pallet::constant]
|
||||||
type MaxScheduledPerBlock: Get<u32>;
|
type MaxScheduledPerBlock: Get<u32>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user