-
Notifications
You must be signed in to change notification settings - Fork 766
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
Multi-Block-Migrations: Support small steps #4989
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
substrate/frame/examples/multi-block-migrations/src/migrations/v1/mod.rs
Show resolved
Hide resolved
substrate/frame/examples/multi-block-migrations/src/migrations/v1/mod.rs
Show resolved
Hide resolved
Self::deposit_event(Event::MigrationAdvanced { | ||
index: cursor.index, | ||
took_blocks, | ||
took_steps, | ||
}); |
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.
should we keep that event? I am just thinking that it's going to be a lot of deposited event (1 for each iteration)
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.
Yes i also wondered it. Maybe only at the end of the loop... will try how it looks.
Emitting one event per iteration could be problematic when a migration does thousands of steps per block, and hardly that useful. We therefore only emit one MigrationAdvanced event at the end of the block. Signed-off-by: Oliver Tale-Yazdi <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
Multi-Block-Migrations currently require the migrations to do as much compute per step as possible.
This was done to allow for more efficient batch code to run, but from a user perspective it can be much nicer to be able to do just a tiny step (eg migrating a map key).
This MR changes MBM to be able to do mini steps, but stays backwards compatible to MBMs that do big steps.
Changes:
Integration
You can now optionally implement this function for your MBMs:
Not implementing it is defaulting to no limit - same as before.