Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ substrate-wasm-builder = { path = "../../../../../substrate/utils/wasm-builder",

[features]
default = ["std"]
# When enabled the `state_version` is set to `1`.
# This means that the chain will start using the new state format. The migration is lazy, so
# it requires to write a storage value to use the new state format. To migrate all the other
# storage values that aren't touched the state migration pallet is added as well.
# This pallet will migrate the entire state, controlled through some account.
#
# This feature should be removed when the main-net will be migrated.
state-trie-version-1 = []
Copy link
Contributor

Choose a reason for hiding this comment

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

oh now I remembre, this is used for multiple network so the feature was needed to have one running V0 while another one was already migrated (likely westend/rococo a long time ago).
Sounds ok to remove it so migration got started everywhere. One point I am not sure is related to the account use as controller: currently it is hardcoded to :

pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
	pub const RootMigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));

probably would need a different one per network, this is not really convenient.
Worst case, what can happen with this chain is some parachain moving to hybrid mode (both v0 and v1 in tree, if warpsync is not use by the parachain this should not be an issue) and not being able to migrate because no account to process the typescript driven migration.

Copy link
Member Author

@ggwpez ggwpez Apr 17, 2024

Choose a reason for hiding this comment

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

Okay thanks for the context. For Rococo it is probably fine, as it will be decommissioned soon anyway.
Just going to leave it as is, and hope that DevOps has the keys. Otherwise we do another upgrade or root call etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

I confirm we have the key to 0x8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52 to be able to process the migration.

runtime-benchmarks = [
"assets-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
Expand Down
19 changes: 0 additions & 19 deletions cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ impl_opaque_keys! {
}
}

#[cfg(feature = "state-trie-version-1")]
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
Expand All @@ -120,19 +119,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
state_version: 1,
};

#[cfg(not(feature = "state-trie-version-1"))]
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 1_010_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 14,
state_version: 0,
};

/// The version information used to identify this runtime when compiled natively.
#[cfg(feature = "std")]
pub fn native_version() -> NativeVersion {
Expand Down Expand Up @@ -932,7 +918,6 @@ construct_runtime!(
PoolAssets: pallet_assets::<Instance3> = 55,
AssetConversion: pallet_asset_conversion = 56,

#[cfg(feature = "state-trie-version-1")]
StateTrieMigration: pallet_state_trie_migration = 70,
}
);
Expand Down Expand Up @@ -1668,15 +1653,13 @@ cumulus_pallet_parachain_system::register_validate_block! {
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
}

#[cfg(feature = "state-trie-version-1")]
parameter_types! {
// The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high)
pub const MigrationSignedDepositPerItem: Balance = CENTS;
pub const MigrationSignedDepositBase: Balance = 2_000 * CENTS;
pub const MigrationMaxKeyLen: u32 = 512;
}

#[cfg(feature = "state-trie-version-1")]
impl pallet_state_trie_migration::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
Expand All @@ -1694,13 +1677,11 @@ impl pallet_state_trie_migration::Config for Runtime {
type MaxKeyLen = MigrationMaxKeyLen;
}

#[cfg(feature = "state-trie-version-1")]
frame_support::ord_parameter_types! {
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
pub const RootMigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
}

#[cfg(feature = "state-trie-version-1")]
#[test]
fn ensure_key_ss58() {
use frame_support::traits::SortedMembers;
Expand Down