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

update state version to 1 on acala #2799

Merged
merged 4 commits into from
Nov 10, 2024
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
4 changes: 4 additions & 0 deletions runtime/acala/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ sp-staking = { workspace = true }
sp-std = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
pallet-state-trie-migration = { workspace = true, optional = true }

# cumulus
cumulus-pallet-aura-ext = { workspace = true }
Expand Down Expand Up @@ -199,6 +200,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"pallet-state-trie-migration/std",

"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
Expand Down Expand Up @@ -295,6 +297,7 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
"pallet-state-trie-migration/runtime-benchmarks",

"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
Expand Down Expand Up @@ -355,6 +358,7 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-treasury/try-runtime",
"pallet-utility/try-runtime",
"pallet-state-trie-migration/try-runtime",

"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
Expand Down
26 changes: 25 additions & 1 deletion runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
state_version: 0,
state_version: 1,
};

/// The version information used to identify this runtime when compiled
Expand Down Expand Up @@ -1830,6 +1830,28 @@ impl orml_parameters::Config for Runtime {
type WeightInfo = ();
}

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 MigrationSignedDepositPerItem: Balance = dollar(KAR);
pub MigrationSignedDepositBase: Balance = dollar(KAR);
pub const MigrationMaxKeyLen: u32 = 512;
}

impl pallet_state_trie_migration::Config for Runtime {
// An origin that can control the whole pallet: should be Root, or a part of your council.
type ControlOrigin = EnsureRootOrTwoThirdsTechnicalCommittee;
// specific account for the migration, can trigger the signed migrations.
type SignedFilter = frame_support::traits::NeverEnsureOrigin<AccountId>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type RuntimeHoldReason = RuntimeHoldReason;
type MaxKeyLen = MigrationMaxKeyLen;
type SignedDepositPerItem = MigrationSignedDepositPerItem;
type SignedDepositBase = MigrationSignedDepositBase;
// Replace this with weight based on your runtime.
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;
}

construct_runtime!(
pub enum Runtime {
// Core & Utility
Expand Down Expand Up @@ -1939,6 +1961,8 @@ construct_runtime!(
// Parachain System, always put it at the end
ParachainSystem: cumulus_pallet_parachain_system = 30,

StateTrieMigration: pallet_state_trie_migration = 254,

// Temporary
Sudo: pallet_sudo = 255,
}
Expand Down
4 changes: 0 additions & 4 deletions runtime/karura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ sp-staking = { workspace = true }
sp-std = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
pallet-state-trie-migration = { workspace = true, optional = true }

# cumulus
cumulus-pallet-aura-ext = { workspace = true }
Expand Down Expand Up @@ -201,7 +200,6 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"pallet-state-trie-migration/std",

"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
Expand Down Expand Up @@ -300,7 +298,6 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
"pallet-state-trie-migration/runtime-benchmarks",

"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
Expand Down Expand Up @@ -361,7 +358,6 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-treasury/try-runtime",
"pallet-utility/try-runtime",
"pallet-state-trie-migration/try-runtime",

"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
Expand Down
24 changes: 0 additions & 24 deletions runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1837,28 +1837,6 @@ impl orml_parameters::Config for Runtime {
type WeightInfo = ();
}

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 MigrationSignedDepositPerItem: Balance = dollar(KAR);
pub MigrationSignedDepositBase: Balance = dollar(KAR);
pub const MigrationMaxKeyLen: u32 = 512;
}

impl pallet_state_trie_migration::Config for Runtime {
// An origin that can control the whole pallet: should be Root, or a part of your council.
type ControlOrigin = EnsureRootOrTwoThirdsTechnicalCommittee;
// specific account for the migration, can trigger the signed migrations.
type SignedFilter = frame_support::traits::NeverEnsureOrigin<AccountId>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type RuntimeHoldReason = RuntimeHoldReason;
type MaxKeyLen = MigrationMaxKeyLen;
type SignedDepositPerItem = MigrationSignedDepositPerItem;
type SignedDepositBase = MigrationSignedDepositBase;
// Replace this with weight based on your runtime.
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;
}

construct_runtime!(
pub enum Runtime {
// Core & Utility
Expand Down Expand Up @@ -1969,8 +1947,6 @@ construct_runtime!(
// Parachain System, always put it at the end
ParachainSystem: cumulus_pallet_parachain_system = 30,

StateTrieMigration: pallet_state_trie_migration = 254,
zjb0807 marked this conversation as resolved.
Show resolved Hide resolved

// Temporary
Sudo: pallet_sudo = 255,
}
Expand Down
Loading