This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Remove state migration from westend runtime. #6737
Merged
paritytech-processbot
merged 10 commits into
paritytech:master
from
cheme:clean_westend_mig
Feb 22, 2023
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b1d55c6
clean state_trie_migration from westend
cheme 893f458
update cargo.lock
cheme 10819c8
Revert "clean state_trie_migration from westend"
cheme 0d0ef73
cleanup.
cheme 5289745
use storage_alias
cheme d4c688a
Revert "use storage_alias"
cheme 6b53ed0
Revert "Revert "use storage_alias""
cheme 71b2f32
Force alias.
cheme e4321f0
magic
cheme e46e6f8
Merge branch 'master' into clean_westend_mig
cheme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1097,19 +1097,6 @@ parameter_types! { | |||||||||||||||||
| pub const MigrationMaxKeyLen: u32 = 512; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| impl pallet_state_trie_migration::Config for Runtime { | ||||||||||||||||||
| type RuntimeEvent = RuntimeEvent; | ||||||||||||||||||
| type Currency = Balances; | ||||||||||||||||||
| type SignedDepositPerItem = MigrationSignedDepositPerItem; | ||||||||||||||||||
| type SignedDepositBase = MigrationSignedDepositBase; | ||||||||||||||||||
| type ControlOrigin = EnsureRoot<AccountId>; | ||||||||||||||||||
| type SignedFilter = frame_support::traits::NeverEnsureOrigin<AccountId>; | ||||||||||||||||||
|
|
||||||||||||||||||
| // Use same weights as substrate ones. | ||||||||||||||||||
| type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>; | ||||||||||||||||||
| type MaxKeyLen = MigrationMaxKeyLen; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| construct_runtime! { | ||||||||||||||||||
| pub enum Runtime where | ||||||||||||||||||
| Block = Block, | ||||||||||||||||||
|
|
@@ -1178,9 +1165,6 @@ construct_runtime! { | |||||||||||||||||
| // Fast unstake pallet: extension to staking. | ||||||||||||||||||
| FastUnstake: pallet_fast_unstake = 30, | ||||||||||||||||||
|
|
||||||||||||||||||
| // State trie migration pallet, only temporary. | ||||||||||||||||||
| StateTrieMigration: pallet_state_trie_migration = 35, | ||||||||||||||||||
|
|
||||||||||||||||||
| // Parachains pallets. Start indices at 40 to leave room. | ||||||||||||||||||
| ParachainsOrigin: parachains_origin::{Pallet, Origin} = 41, | ||||||||||||||||||
| Configuration: parachains_configuration::{Pallet, Call, Storage, Config<T>} = 42, | ||||||||||||||||||
|
|
@@ -1243,7 +1227,7 @@ impl Get<&'static str> for StakingMigrationV11OldPallet { | |||||||||||||||||
| /// | ||||||||||||||||||
| /// Should be cleared after every release. | ||||||||||||||||||
| pub type Migrations = ( | ||||||||||||||||||
| init_state_migration::InitMigrate, | ||||||||||||||||||
| clean_state_migration::CleanMigrate, | ||||||||||||||||||
| // "Use 2D weights in XCM v3" <https://github.com/paritytech/polkadot/pull/6134> | ||||||||||||||||||
| pallet_xcm::migration::v1::MigrateToV1<Runtime>, | ||||||||||||||||||
| parachains_ump::migration::v1::MigrateToV1<Runtime>, | ||||||||||||||||||
|
|
@@ -1908,43 +1892,64 @@ mod remote_tests { | |||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| mod init_state_migration { | ||||||||||||||||||
| mod clean_state_migration { | ||||||||||||||||||
| use super::Runtime; | ||||||||||||||||||
| use frame_support::traits::OnRuntimeUpgrade; | ||||||||||||||||||
| use pallet_state_trie_migration::{AutoLimits, MigrationLimits, MigrationProcess}; | ||||||||||||||||||
| use frame_support::{pallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade}; | ||||||||||||||||||
| use pallet_state_trie_migration::MigrationLimits; | ||||||||||||||||||
|
|
||||||||||||||||||
| #[cfg(not(feature = "std"))] | ||||||||||||||||||
| use sp_std::prelude::*; | ||||||||||||||||||
|
|
||||||||||||||||||
| struct Pallet<T>(sp_std::marker::PhantomData<T>); | ||||||||||||||||||
|
|
||||||||||||||||||
| impl<T> frame_support::traits::PalletInfoAccess for Pallet<T> { | ||||||||||||||||||
| fn index() -> usize { | ||||||||||||||||||
| 35 | ||||||||||||||||||
| } | ||||||||||||||||||
| fn name() -> &'static str { | ||||||||||||||||||
| "StateTrieMigration" | ||||||||||||||||||
| } | ||||||||||||||||||
| fn module_name() -> &'static str { | ||||||||||||||||||
| "pallet_state_trie_migration" | ||||||||||||||||||
| } | ||||||||||||||||||
| fn crate_version() -> frame_support::traits::CrateVersion { | ||||||||||||||||||
| frame_support::traits::CrateVersion { major: 4u16, minor: 0u8, patch: 0u8 } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| #[storage_alias] | ||||||||||||||||||
| type AutoLimits<T> = StorageValue<Pallet<T>, Option<MigrationLimits>, ValueQuery>; | ||||||||||||||||||
|
||||||||||||||||||
| type AutoLimits<T> = StorageValue<Pallet<T>, Option<MigrationLimits>, ValueQuery>; | |
| type AutoLimits = StorageValue<StateTrieMigration, Option<MigrationLimits>, ValueQuery>; |
Outdated
Member
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.
Suggested change
| type MigrationProcess<T> = StorageValue<Pallet<T>, u32, ValueQuery>; | |
| #[storage_alias] | |
| type SignedMigrationMaxLimits<T> = StorageValue<Pallet<T>, MigrationLimits, OptionQuery>; | |
| type MigrationProcess = StorageValue<StateTrieMigration, u32, ValueQuery>; | |
| #[storage_alias] | |
| type SignedMigrationMaxLimits = StorageValue<StateTrieMigration, MigrationLimits, OptionQuery>; |
Outdated
Member
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.
You can use storage_alias to have the definition of them without including the pallet.
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.
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.