Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Migrate Slot Depositors in Crowdloan Migration #5173

Merged
merged 3 commits into from
Mar 30, 2022

Conversation

shawntabrizi
Copy link
Member

@shawntabrizi shawntabrizi commented Mar 22, 2022

This PR fixes an issue with the existing Crowdloan migration (#4772), where the deposits tracking in the Slots pallet was not migrated to the new accounts.

@shawntabrizi shawntabrizi added B7-runtimenoteworthy C3-medium PR touches the given topic and has a medium impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. E0-runtime_migration PR introduces code that might require downstream chains to run a runtime upgrade. labels Mar 22, 2022
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Mar 22, 2022
let account_info = frame_system::Account::<T>::take(old_fund_account);
frame_system::Account::<T>::insert(new_fund_account, account_info);
let account_info = frame_system::Account::<T>::take(&old_fund_account);
frame_system::Account::<T>::insert(&new_fund_account, account_info);
Copy link
Contributor

@emostov emostov Mar 23, 2022

Choose a reason for hiding this comment

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

Just to make sure I understand, if this migration runs twice things break; we would overwrite new_fund_account here with some empty info?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but not sure if there is a way around this...

Copy link
Contributor

Choose a reason for hiding this comment

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

you can and should guard the migration by something, either StorageVersion, custom storage, or at the minimum spec_verion

Copy link
Contributor

@emostov emostov left a comment

Choose a reason for hiding this comment

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

Generally looks good - only potential issue I see is #5173 (comment)

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

minor issues, but LGTM.

Just makre sure to correct the other migration in Polkadot, if there is going to be a 9181 replacing 9180.

@shawntabrizi
Copy link
Member Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 8ca8adc into master Mar 30, 2022
@paritytech-processbot paritytech-processbot bot deleted the shawntabrizi-fix-crowdloan-migration branch March 30, 2022 18:41
@louismerlin louismerlin added D1-audited 👍 PR contains changes to critical logic that has been properly reviewed and externally audited. and removed D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C3-medium PR touches the given topic and has a medium impact on builders. D1-audited 👍 PR contains changes to critical logic that has been properly reviewed and externally audited. E0-runtime_migration PR introduces code that might require downstream chains to run a runtime upgrade.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants