-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]: Update Scheduler to Support Relay Chain Block Number Provider #3970 #6362
base: master
Are you sure you want to change the base?
Conversation
@@ -1157,24 +1181,30 @@ impl<T: Config> Pallet<T> { | |||
return | |||
} | |||
|
|||
let mut incomplete_since = now + One::one(); | |||
let mut when = IncompleteSince::<T>::take().unwrap_or(now); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why would not it work with IncompleteSince
, without the block Queue
?
How we determine the MaxScheduledBlocks
bound?
With the IncompleteSince
we iterate over blocks that might have no task to execute and this might make a situation with many incomplete blocks even worth. But probably not too much? One more read?
Both solutions need a strategy for a situation when there are two many tasks that can not be completed and the task queue only grow. If such strategy not yet in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the
IncompleteSince
we iterate over blocks that might have no task to execute and this might make a situation with many incomplete blocks even worth. But probably not too much? One more read?
Yes, but then this becomes unbounded in case too many blocks are skipped. The idea behind using the Queue
is to bound this to a sufficient number.
How we determine the MaxScheduledBlocks bound?
This should be determined similar to the existing MaxScheduledPerBlock
?
Both solutions need a strategy for a situation when there are two many tasks that can not be completed and the task queue only grow. If such strategy not yet in place.
There is already a retry mechanism and the task is purged if the retry count is exceeded (even if failed).
Step in #6297
This PR adds a Queue to the scheduler pallet that helps in tracking the block numbers with valid agenda. This helps in scheduling the tasks even if the pallet is deployed on a parachain that does not produce blocks on a regular cadence.
Todo