-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow to test Multi-Block-Migrations #90
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
github-actions bot
pushed a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Sep 16, 2024
Discovered a bug in the migrations pallet while debugging paritytech/try-runtime-cli#90. It only occurs when a single MBM is configured - hence it did not happen when Ajuna Network tried it... Changes: - Check len of the tuple before accessing its nth_id - Make nth_id return `None` on unary tuples and n>0 --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: ggwpez <ggwpez@users.noreply.github.com> (cherry picked from commit 0136463)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
ggwpez
changed the title
[wip] runtime upgrade mbms
Allow to test Multi-Block-Migrations
Sep 24, 2024
github-merge-queue bot
pushed a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Sep 24, 2024
# MBM try-runtime support This MR adds support to the try-runtime trait such that the try-runtime-CLI will be able to support MBM testing [here](paritytech/try-runtime-cli#90). It mainly adds two feature-gated hooks to the `SteppedMigration` hook to facilitate testing. These hooks are named `pre_upgrade` and `post_upgrade` and have the same signature and implications as for single-block migrations. ## Integration To make use of this in your Multi-Block-Migration, just implement the two new hooks and test pre- and post-conditions in them: ```rust #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result<Vec<u8>, frame_support::sp_runtime::TryRuntimeError> { // ... } #[cfg(feature = "try-runtime")] fn post_upgrade(prev: Vec<u8>) -> Result<(), frame_support::sp_runtime::TryRuntimeError> { // ... } ``` You may return an error or panic in these functions to indicate failure. This will then show up in the try-runtime-CLI and can be used in CI for testing. Changes: - Adds `try-runtime` gated methods `pre_upgrade` and `post_upgrade` on `SteppedMigration` - Adds `try-runtime` gated methods `nth_pre_upgrade` and `nth_post_upgrade` on `SteppedMigrations` - Modifies `pallet_migrations` implementation to run pre_upgrade and post_upgrade steps at the appropriate times, and panic in the event of migration failure. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: claravanstaden <claravanstaden64@gmail.com> Co-authored-by: ggwpez <ggwpez@users.noreply.github.com> Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
github-merge-queue bot
pushed a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Sep 25, 2024
# MBM try-runtime support This MR adds support to the try-runtime trait such that the try-runtime-CLI will be able to support MBM testing [here](paritytech/try-runtime-cli#90). It mainly adds two feature-gated hooks to the `SteppedMigration` hook to facilitate testing. These hooks are named `pre_upgrade` and `post_upgrade` and have the same signature and implications as for single-block migrations. ## Integration To make use of this in your Multi-Block-Migration, just implement the two new hooks and test pre- and post-conditions in them: ```rust #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result<Vec<u8>, frame_support::sp_runtime::TryRuntimeError> { // ... } #[cfg(feature = "try-runtime")] fn post_upgrade(prev: Vec<u8>) -> Result<(), frame_support::sp_runtime::TryRuntimeError> { // ... } ``` You may return an error or panic in these functions to indicate failure. This will then show up in the try-runtime-CLI and can be used in CI for testing. Changes: - Adds `try-runtime` gated methods `pre_upgrade` and `post_upgrade` on `SteppedMigration` - Adds `try-runtime` gated methods `nth_pre_upgrade` and `nth_post_upgrade` on `SteppedMigrations` - Modifies `pallet_migrations` implementation to run pre_upgrade and post_upgrade steps at the appropriate times, and panic in the event of migration failure. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: claravanstaden <claravanstaden64@gmail.com> Co-authored-by: ggwpez <ggwpez@users.noreply.github.com> Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
github-merge-queue bot
pushed a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Sep 25, 2024
# MBM try-runtime support This MR adds support to the try-runtime trait such that the try-runtime-CLI will be able to support MBM testing [here](paritytech/try-runtime-cli#90). It mainly adds two feature-gated hooks to the `SteppedMigration` hook to facilitate testing. These hooks are named `pre_upgrade` and `post_upgrade` and have the same signature and implications as for single-block migrations. ## Integration To make use of this in your Multi-Block-Migration, just implement the two new hooks and test pre- and post-conditions in them: ```rust #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result<Vec<u8>, frame_support::sp_runtime::TryRuntimeError> { // ... } #[cfg(feature = "try-runtime")] fn post_upgrade(prev: Vec<u8>) -> Result<(), frame_support::sp_runtime::TryRuntimeError> { // ... } ``` You may return an error or panic in these functions to indicate failure. This will then show up in the try-runtime-CLI and can be used in CI for testing. Changes: - Adds `try-runtime` gated methods `pre_upgrade` and `post_upgrade` on `SteppedMigration` - Adds `try-runtime` gated methods `nth_pre_upgrade` and `nth_post_upgrade` on `SteppedMigrations` - Modifies `pallet_migrations` implementation to run pre_upgrade and post_upgrade steps at the appropriate times, and panic in the event of migration failure. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: claravanstaden <claravanstaden64@gmail.com> Co-authored-by: ggwpez <ggwpez@users.noreply.github.com> Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
1 task
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: test@test.com <test@test.com>
…liam-runtime-upgrade-mbms
…liam-runtime-upgrade-mbms
ggwpez
approved these changes
Oct 3, 2024
Open
fellowship-merge-bot bot
added a commit
to polkadot-fellows/runtimes
that referenced
this pull request
Oct 18, 2024
- Update try-runtime-cli for MBM testing that was added paritytech/try-runtime-cli#90 - Fix KAH spec version that was incorrectly bumped - Disable MBM testing for Encointer runtime until paritytech/try-runtime-cli#101 is fixed (single-block-migrations are still checked). - [x] Does not require a CHANGELOG entry --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds testing capabilities for Multi-Block-Migrations.