paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.76k stars 631 forks source link

A time based scheduler #3672

Open xlc opened 5 months ago

xlc commented 5 months ago

Currently the pallet-scheduler is able to schedule tasks to be dispatched at a particular block. However, with async backing and dynamic block time, block number based scheduling become less useful. Majority of the business logics are time based and we need a scheduler that's able to for example, schedule a task to be dispatched daily.

We can either have a new scheduler or to see if we can abstract the logic in such way to make the current pallet-scheduler also be schedule time based tasks.

ggwpez commented 5 months ago

Yea i thought about some kind of pallet-calendar that exposes OnBeginWeek, OnBeginDay or whatever.
But having it in the scheduler would also be needed for one-off things.