Skip to content
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

fix: runtime upgrade utils and migrations #4258

Merged
merged 3 commits into from Nov 20, 2023
Merged

fix: runtime upgrade utils and migrations #4258

merged 3 commits into from Nov 20, 2023

Conversation

kylezs
Copy link
Contributor

@kylezs kylezs commented Nov 17, 2023

Closes: PRO-976

Pull Request

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works. - I wrote a dummy migration with passing and failing hooks and this works as expected.
  • I have updated documentation where appropriate.

Summary

Somewhere at some point parity changed the way migrations run and ought to be run, and this changes it to run as parity runs them now.

The VersionedMigration struct that we have will eventually be replaced by the version included in polkadot-sdk here: paritytech/polkadot-sdk@4137aa6 once we upgrade to a version that includes it.

chore: remove on_runtime_upgrade calls from pallets

fix: upgrade utils

clippy
@kylezs kylezs marked this pull request as ready for review November 17, 2023 10:49
@kylezs kylezs marked this pull request as draft November 17, 2023 10:53
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (9e20bc3) 72% compared to head (2bfb570) 72%.
Report is 3 commits behind head on main.

Files Patch % Lines
state-chain/runtime-upgrade-utilities/src/lib.rs 0% 14 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4258   +/-   ##
=====================================
- Coverage     72%     72%   -0%     
=====================================
  Files        384     385    +1     
  Lines      63571   63487   -84     
  Branches   63571   63487   -84     
=====================================
- Hits       45482   45404   -78     
+ Misses     15749   15740    -9     
- Partials    2340    2343    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kylezs kylezs marked this pull request as ready for review November 17, 2023 12:27
@kylezs kylezs merged commit 4c804c7 into main Nov 20, 2023
40 checks passed
@kylezs kylezs deleted the fix/use-executive branch November 20, 2023 10:58
@kylezs kylezs mentioned this pull request Nov 20, 2023
2 tasks
dandanlen pushed a commit that referenced this pull request Nov 20, 2023
* fix: use executive pallet to run tuple migrations

chore: remove on_runtime_upgrade calls from pallets

fix: upgrade utils

clippy

* doc: update README

* fix: run try-runtime tests on CI
Copy link

linear bot commented Nov 20, 2023

PRO-976 Pre/Post runtime upgrade checks are not applied

Parity changed how the runtime upgrade checks are called, and as a consequence, the pre/post upgrade checks of tuples of runtime upgrades are no-ops(!). The solution that in the pallets, instead of overriding pre/post upgrade checks in the hooks, we should override the try_on_runtime_upgrade method. Basically:

fn try_on_rutime_upgrade(..) {
  VersionMigration::<T>::try_on_runtime_updrade(..)
}

As part of this, the README.md in the runtime upgrade utilities should also be updated.

Any old migrations can be deleted.

IMO we might as well keep the boilerplate and use type VersionedMigration = (); or similar if none are currently defined.

tomjohnburton pushed a commit that referenced this pull request Nov 20, 2023
Co-authored-by: dandanlen <3168260+dandanlen@users.noreply.github.com>
Co-authored-by: Alastair Holmes <42404303+AlastairHolmes@users.noreply.github.com>
Co-authored-by: Albert Llimos <53186777+albert-llimos@users.noreply.github.com>
Co-authored-by: Martin Rieke <121793148+martin-chainflip@users.noreply.github.com>
Co-authored-by: Maxim Shishmarev <msgmaxim@gmail.com>
Co-authored-by: Marcello <marcello@chainflip.io>
Co-authored-by: Roy Yang <roy@chainflip.io>
Co-authored-by: kylezs <kyle@chainflip.io>
Co-authored-by: Jamie Ford <jamie@chainflip.io>
fix naming of session keys (#4242)
fix: revert restricted balances (#4237)
fix: add missing spans in multisig logs (#4239)
fix cargo features (#4249)
fix: remove bound addresses on account deletion (#4244)
fix: remove existential deposit (#4243)
fix: egress id race condition (#4235)
fix: remove unwrap when getting tx receipt (#4231)
fix: protect against double witnessing after safe mode (#4254)
fix: runtime upgrade utils and migrations (#4258)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants