Is it possible to split the execution of an extrinsic into several continuous blocks? Looking at this post, it is possible to create migrations, but I was wondering if the same can be applied to an extrinsic.
So for example, let's say I have the following enum (keep in mind this is a dummy example):
pub enum ItemType {
A(u32),
B(u32),
C(u32),
}
Now, let's imagine that there's a list (with millions of entries) declared as:
#[pallet::storage]
#[pallet::getter(fn items)]
pub(super) type AllItems<T: Config> = StorageValue<_, Vec<ItemType>, ValueQuery>;
I want to create an extrinsic that changes all the elements stored within the AllItems
structure from ItemType::A
to ItemType::B
, but a single run will certainly require a lot of time to modify the whole vector, so I want to split the execution into multiple blocks, so the execution does not exceed the maximum block weight and also allow the chain to process other transactions and not only this.
This is just a simple example to get the idea, but imagine that is not a simple modification and it has to perform updates on different structures at the same time.