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

Removes already applied migrations #118

Merged
merged 13 commits into from
Jan 5, 2024
Merged

Removes already applied migrations #118

merged 13 commits into from
Jan 5, 2024

Conversation

bkchr
Copy link
Contributor

@bkchr bkchr commented Dec 11, 2023

No description provided.

@bkchr bkchr mentioned this pull request Dec 11, 2023
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but let's merge after we see them applied on-chain.

Wait I'm confused, lemme double check this

Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw comment #68 (comment) where it says you want to merge this PR for pending 1.1.0 release, but some migrations here were never released (they were added after 1.0.0 release).

So we should not include/merge this PR (at least in its current form) before 1.1.0 release.

Comment on lines 1737 to 1745
/// Upgrade Session keys to include BEEFY key.
/// When this is removed, should also remove `OldSessionKeys`.
pub struct UpgradeSessionKeys;
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
fn on_runtime_upgrade() -> Weight {
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys);
Perbill::from_percent(50) * BlockWeights::get().max_block
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration was never released (and obviously never enacted on-chain) - don't remove it before we see it enacted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I didn't wanted to remove it :P I even left it in the list below :D Will readd the code, ty!

@acatangiu
Copy link
Contributor

FYI: opened a PR for a doc with a quick guide that IMO we should follow to make our lives easier: #120

@bkchr bkchr requested a review from acatangiu December 11, 2023 15:11
pallet_nomination_pools::migration::versioned_migrations::V5toV6<Runtime>,
pallet_nomination_pools::migration::versioned_migrations::V6ToV7<Runtime>,

runtime_parachains::scheduler::migration::v1::MigrateToV1<Runtime>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how to check if this was already run on-chain, but I see it was added here after the last release:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added after the release, to switch back to the fixed upstream one. However, I had included the fixed upstream migration directly in this repo here: https://github.com/polkadot-fellows/runtimes/pull/26/files#diff-efa4caeb17487ecb13d8f5eb7863c3241d84afa2e73fbf25909a2ca89df0f362R1739

pub type Migrations = (
pallet_collator_selection::migration::v1::MigrateToV1<Runtime>,
pallet_multisig::migrations::v1::MigrateToV1<Runtime>,
InitStorageVersions,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also remove struct InitStorageVersions defined and implemented below

(same for other system paras)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -817,49 +817,14 @@ pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Migrations to apply on runtime upgrade.
pub type Migrations =
(pallet_collator_selection::migration::v1::MigrateToV1<Runtime>, InitStorageVersions);
frame_support::migrations::VersionedMigration<0, 1, UniquesMigration, Uniques, RocksDbWeight>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the InitStorageVersions was executed, we need to reset the Uniques on-chain version back to 0 before running this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this init was never executed on chain. This was the reason the CI was failing for this pr.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkchr bkchr requested a review from ggwpez January 4, 2024 12:05
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know why we use --disable-idempotency-checks in the CI migration checks.
I will try it in a MR to see if we can enable it now (maybe at least for some runtimes).

@bkchr
Copy link
Contributor Author

bkchr commented Jan 4, 2024

I dont know why we use --disable-idempotency-checks in the CI migration checks.

https://github.com/polkadot-fellows/runtimes/pull/75/files#diff-9c4bfd050ca12885b582fbfd04536460a7a4a0770824ee46694010b1e4e53287R74

@ggwpez
Copy link
Member

ggwpez commented Jan 4, 2024

I dont know why we use --disable-idempotency-checks in the CI migration checks.

https://github.com/polkadot-fellows/runtimes/pull/75/files#diff-9c4bfd050ca12885b582fbfd04536460a7a4a0770824ee46694010b1e4e53287R74

Yea I cannot read 🙈 removed in #133

@bkchr bkchr enabled auto-merge (squash) January 4, 2024 13:29
@ggwpez
Copy link
Member

ggwpez commented Jan 4, 2024

@muharem its not counting your approval since your on-chain identity does not contain a github in the additional field.

@sandreim
Copy link
Contributor

sandreim commented Jan 5, 2024

@muharem its not counting your approval since your on-chain identity does not contain a github in the additional field.

it's not counting mine as well and I have my github in the additional field

Copy link
Contributor

@ordian ordian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked polkadot migration list in 1.0.1 and it checks out.

parachains_configuration::migration::v9::MigrateToV9<Runtime>,
// Migrate parachain info format
paras_registrar::migration::VersionCheckedMigrateToV1<Runtime, ParachainsToUnlock>,

// Upgrade SessionKeys to include BEEFY key
UpgradeSessionKeys,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an issue to track the removal of this in the next release so we don't forget?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't have an issue for this, but in the fellowship repo we can just remove always all the migrations.

@bkchr
Copy link
Contributor Author

bkchr commented Jan 5, 2024

@muharem its not counting your approval since your on-chain identity does not contain a github in the additional field.

it's not counting mine as well and I have my github in the additional field

The logs say something different:

ggwpez,acatangiu,kianenigma,shawntabrizi,gavofyork,davxy,eskimor,edwardmack,andresilva,pepyakin,rphmeier,bkchr,sandreim,tomaka,agryaznov,xlc,arkpar,ordian,KiChjang,noot,joepetrowski
Latest reviews are [{"user":"acatangiu","state":"APPROVED"},{"user":"joepetrowski","state":"APPROVED"},{"user":"muharem","state":"APPROVED"},{"user":"ggwpez","state":"APPROVED"},{"user":"sandreim","state":"APPROVED"},{"user":"ordian","state":"APPROVED"}]

@bkchr bkchr merged commit 3caec69 into main Jan 5, 2024
14 checks passed
@ggwpez ggwpez deleted the bkchr-cleanup-migrations branch January 5, 2024 11:31
ggwpez added a commit that referenced this pull request Jan 9, 2024
Enable one more check in the CI to ensure that our migrations are
idempotent. Can only merge after
#118

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
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.

8 participants