-
Notifications
You must be signed in to change notification settings - Fork 683
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
pallet-migrations: fix index access for singluar migrations #5695
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@@ -777,8 +777,10 @@ impl<T: SteppedMigration> SteppedMigrations for T { | |||
1 | |||
} | |||
|
|||
fn nth_id(_n: u32) -> Option<Vec<u8>> { | |||
Some(T::id().encode()) |
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.
This was the actual issue
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.
Oh and this was not overwritten for a single migration that's not part of a tuple, right?
/cmd prdoc --pr 5695 --bump patch --audience "Runtime Dev" |
@@ -777,8 +777,10 @@ impl<T: SteppedMigration> SteppedMigrations for T { | |||
1 | |||
} | |||
|
|||
fn nth_id(_n: u32) -> Option<Vec<u8>> { | |||
Some(T::id().encode()) |
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.
Oh and this was not overwritten for a single migration that's not part of a tuple, right?
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)
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)
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)
Git push to origin failed for stable2407 with exitcode 1 |
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)
Successfully created backport PR for |
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)
Successfully created backport PR for |
Git push to origin failed for stable2409 with exitcode 1 |
Backport #5695 into `stable2409` from ggwpez. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Backport #5695 into `stable2407` from ggwpez. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Discovered a bug in the migrations pallet while debugging paritytech/try-runtime-cli#90.
🚨 This can lead to your chain getting stuck. It happens when a single MBM is configured. Having no or more than one MBM will circumvent the issue.
Changes:
None
on unary tuples and n>0