Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gupnik
Copy link
Contributor

@gupnik gupnik commented Nov 5, 2024

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

  • Update Benchmarks
  • Migration

@gupnik gupnik added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Nov 5, 2024
@gupnik gupnik requested a review from a team as a code owner November 5, 2024 09:02
@muharem muharem self-requested a review November 5, 2024 09:49
@@ -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);
Copy link
Contributor

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.

Copy link
Contributor Author

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).

@paritytech-review-bot paritytech-review-bot bot requested a review from a team November 11, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants