diff --git a/cumulus/Cargo.lock b/cumulus/Cargo.lock index eb4ca303306a1edba3295455cdb293b72e9b5a44..26b70fd243b38057f26442287679f180d0536474 100644 --- a/cumulus/Cargo.lock +++ b/cumulus/Cargo.lock @@ -6200,6 +6200,7 @@ dependencies = [ "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "try-runtime-cli", + "xcm", ] [[package]] @@ -6853,6 +6854,7 @@ dependencies = [ "tempfile", "try-runtime-cli", "westmint-runtime", + "xcm", ] [[package]] diff --git a/cumulus/parachain-template/node/Cargo.toml b/cumulus/parachain-template/node/Cargo.toml index 12c10a7a629570860347ac654bbc840171000ed4..10a6e4744a33a79dda174d54453e6258b6b8ac06 100644 --- a/cumulus/parachain-template/node/Cargo.toml +++ b/cumulus/parachain-template/node/Cargo.toml @@ -96,3 +96,4 @@ polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "maste polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } diff --git a/cumulus/parachain-template/node/src/chain_spec.rs b/cumulus/parachain-template/node/src/chain_spec.rs index 46b5841631e1aeb014954e4163e912a3019b25ba..afb760685c62c30b1943202ecdcafd35ea8ee36a 100644 --- a/cumulus/parachain-template/node/src/chain_spec.rs +++ b/cumulus/parachain-template/node/src/chain_spec.rs @@ -10,6 +10,9 @@ use sp_runtime::traits::{IdentifyAccount, Verify}; pub type ChainSpec = sc_service::GenericChainSpec<parachain_template_runtime::GenesisConfig, Extensions>; +/// The default XCM version to set in genesis config. +const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; + /// Helper function to generate a crypto pair from seed pub fn get_public_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public { TPublic::Pair::from_string(&format!("//{}", seed), None) @@ -211,5 +214,8 @@ fn testnet_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), + polkadot_xcm: parachain_template_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, } } diff --git a/cumulus/parachain-template/runtime/src/lib.rs b/cumulus/parachain-template/runtime/src/lib.rs index 944933f42cd4086dbaf09ec0dacf514f43292903..1020d64a60b7189b3237dce3bb87da35c0223f41 100644 --- a/cumulus/parachain-template/runtime/src/lib.rs +++ b/cumulus/parachain-template/runtime/src/lib.rs @@ -620,7 +620,7 @@ construct_runtime!( // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33, diff --git a/cumulus/polkadot-parachains/Cargo.toml b/cumulus/polkadot-parachains/Cargo.toml index 6b6294952e89161ff03fd676db3826acf7359989..d0d7c68c9524769235971dea0c1b301f48b3a6e9 100644 --- a/cumulus/polkadot-parachains/Cargo.toml +++ b/cumulus/polkadot-parachains/Cargo.toml @@ -84,6 +84,7 @@ polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "master" } [build-dependencies] substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/cumulus/polkadot-parachains/rococo-parachain/Cargo.toml b/cumulus/polkadot-parachains/rococo-parachain/Cargo.toml index e42f1612c806da337611d1a8320d41aed7e336ff..7ac9a3c8e97744fc79a197d911a3d101e2e6bd4d 100644 --- a/cumulus/polkadot-parachains/rococo-parachain/Cargo.toml +++ b/cumulus/polkadot-parachains/rococo-parachain/Cargo.toml @@ -89,6 +89,7 @@ std = [ "pallet-sudo/std", "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-xcm/std", "parachain-info/std", "parachains-common/std", "cumulus-pallet-aura-ext/std", diff --git a/cumulus/polkadot-parachains/rococo-parachain/src/lib.rs b/cumulus/polkadot-parachains/rococo-parachain/src/lib.rs index 218d5ff5d6ac93695baa489a4c82a5ee6932a840..a9e0ec482013b118f91d10f0a6747f3dd6d1a329 100644 --- a/cumulus/polkadot-parachains/rococo-parachain/src/lib.rs +++ b/cumulus/polkadot-parachains/rococo-parachain/src/lib.rs @@ -531,7 +531,7 @@ construct_runtime! { // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config} = 51, CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53, diff --git a/cumulus/polkadot-parachains/src/chain_spec.rs b/cumulus/polkadot-parachains/src/chain_spec.rs index c0ea616343137cfcc8751356d6ce6effa778d1a0..7bd8cdb8c54e996f41328b16fe1fc7aa800b25a0 100644 --- a/cumulus/polkadot-parachains/src/chain_spec.rs +++ b/cumulus/polkadot-parachains/src/chain_spec.rs @@ -34,6 +34,9 @@ pub type ShellChainSpec = sc_service::GenericChainSpec<shell_runtime::GenesisCon pub type SeedlingChainSpec = sc_service::GenericChainSpec<seedling_runtime::GenesisConfig, Extensions>; +/// The default XCM version to set in genesis config. +const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; + /// Helper function to generate a crypto pair from seed pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public { TPublic::Pair::from_string(&format!("//{}", seed), None) @@ -189,6 +192,9 @@ fn testnet_genesis( aura: rococo_parachain_runtime::AuraConfig { authorities: initial_authorities }, aura_ext: Default::default(), parachain_system: Default::default(), + polkadot_xcm: rococo_parachain_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, } } @@ -454,6 +460,9 @@ fn statemint_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), + polkadot_xcm: statemint_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, } } @@ -638,6 +647,9 @@ fn statemine_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), + polkadot_xcm: statemine_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, } } @@ -817,5 +829,8 @@ fn westmint_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), + polkadot_xcm: westmint_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, } } diff --git a/cumulus/polkadot-parachains/statemine/Cargo.toml b/cumulus/polkadot-parachains/statemine/Cargo.toml index 18f3b6c4e30d6a052c6d8bd2af76415323118976..9bb1ce05e2bfbdea0b858d74c65d148d83ff02eb 100644 --- a/cumulus/polkadot-parachains/statemine/Cargo.toml +++ b/cumulus/polkadot-parachains/statemine/Cargo.toml @@ -141,6 +141,7 @@ std = [ "pallet-transaction-payment-rpc-runtime-api/std", "pallet-uniques/std", "pallet-utility/std", + "pallet-xcm/std", "parachain-info/std", "cumulus-pallet-aura-ext/std", "pallet-asset-tx-payment/std", diff --git a/cumulus/polkadot-parachains/statemine/src/lib.rs b/cumulus/polkadot-parachains/statemine/src/lib.rs index 21d509441cd11d15fb864f2609fc681d1c6ea0a6..25dac6a5d5025045ff34380a8648eb923ba9507e 100644 --- a/cumulus/polkadot-parachains/statemine/src/lib.rs +++ b/cumulus/polkadot-parachains/statemine/src/lib.rs @@ -737,7 +737,7 @@ construct_runtime!( // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33, diff --git a/cumulus/polkadot-parachains/statemint/Cargo.toml b/cumulus/polkadot-parachains/statemint/Cargo.toml index cddf2624ae37dc01a581e0216deae04a54fd2dc4..4d7875bf99a97bd949f92531a7185e7a2b2c6fba 100644 --- a/cumulus/polkadot-parachains/statemint/Cargo.toml +++ b/cumulus/polkadot-parachains/statemint/Cargo.toml @@ -141,6 +141,7 @@ std = [ "pallet-transaction-payment-rpc-runtime-api/std", "pallet-uniques/std", "pallet-utility/std", + "pallet-xcm/std", "parachain-info/std", "cumulus-pallet-aura-ext/std", "pallet-asset-tx-payment/std", diff --git a/cumulus/polkadot-parachains/statemint/src/lib.rs b/cumulus/polkadot-parachains/statemint/src/lib.rs index a7a2305088b1416f55ff5a6269452a2b7a8ad24a..0648e43df07987e4584da3187d573c869cc7c5c6 100644 --- a/cumulus/polkadot-parachains/statemint/src/lib.rs +++ b/cumulus/polkadot-parachains/statemint/src/lib.rs @@ -750,7 +750,7 @@ construct_runtime!( // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33, diff --git a/cumulus/polkadot-parachains/westmint/Cargo.toml b/cumulus/polkadot-parachains/westmint/Cargo.toml index 99a9fbda7841ea723981df1e8157b2c45b96baa4..25cd4f59ce20aa61a0c1e901f4670dc7696cfa29 100644 --- a/cumulus/polkadot-parachains/westmint/Cargo.toml +++ b/cumulus/polkadot-parachains/westmint/Cargo.toml @@ -139,6 +139,7 @@ std = [ "pallet-transaction-payment-rpc-runtime-api/std", "pallet-uniques/std", "pallet-utility/std", + "pallet-xcm/std", "parachain-info/std", "cumulus-pallet-aura-ext/std", "pallet-asset-tx-payment/std", diff --git a/cumulus/polkadot-parachains/westmint/src/lib.rs b/cumulus/polkadot-parachains/westmint/src/lib.rs index c7145497bba0ab7d7ecd064a638af18a08321f49..665897a8a091eaa2a7e838b5425cd6455ae48793 100644 --- a/cumulus/polkadot-parachains/westmint/src/lib.rs +++ b/cumulus/polkadot-parachains/westmint/src/lib.rs @@ -722,7 +722,7 @@ construct_runtime!( // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,