diff --git a/Cargo.lock b/Cargo.lock index 3ad0c414e0..d2d5a6d2a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8005,9 +8005,9 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "8.0.1" +version = "8.0.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2b0bade2eb6ce40af35a5af150692b4e150638f7f68c15735ab9cdf79650d68e" +checksum = "d32aa4911002f03a8aebd897e094980e7a9fb25d092e0f8db38e76e1e4f643ee" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -13313,9 +13313,9 @@ dependencies = [ [[package]] name = "staging-xcm" -version = "8.0.0" +version = "8.0.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5ccecaeae5eca8453760e96fcf65481b19898459971842004732e88cd3570741" +checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" dependencies = [ "array-bytes 6.2.2", "bounded-collections", diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index 11332421b3..017285b77b 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -26,7 +26,7 @@ pallet-staking = "29.0.0" sc-consensus-grandpa = "0.20.0" sp-runtime = "32.0.0" sp-consensus-beefy = "14.0.0" -xcm = { package = "staging-xcm", version = "8.0.0" } +xcm = { package = "staging-xcm", version = "8.0.1" } parachains-common = { version = "8.0.0" } cumulus-primitives-core = { version = "0.8.0" } diff --git a/integration-tests/emulated/helpers/Cargo.toml b/integration-tests/emulated/helpers/Cargo.toml index b486f9c160..b902647565 100644 --- a/integration-tests/emulated/helpers/Cargo.toml +++ b/integration-tests/emulated/helpers/Cargo.toml @@ -15,8 +15,8 @@ pallet-balances = { version = "29.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } # Cumulus xcm-emulator = { version = "0.6.0" } diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs index dabe978312..c761854512 100644 --- a/integration-tests/emulated/helpers/src/lib.rs +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -21,7 +21,7 @@ pub use pallet_message_queue; // Polkadot pub use pallet_xcm; -pub use xcm::prelude::{AccountId32, WeightLimit}; +pub use xcm::prelude::{AccountId32, VersionedAssets, Weight, WeightLimit}; // Cumulus pub use asset_test_utils; @@ -122,3 +122,101 @@ macro_rules! test_parachain_is_trusted_teleporter { } }; } + +#[macro_export] +macro_rules! test_chain_can_claim_assets { + ( $sender_para:ty, $runtime_call:ty, $network_id:expr, $assets:expr, $amount:expr ) => { + $crate::paste::paste! { + let sender = [<$sender_para Sender>]::get(); + let origin = <$sender_para as $crate::Chain>::RuntimeOrigin::signed(sender.clone()); + // Receiver is the same as sender + let beneficiary: Location = + $crate::AccountId32 { network: Some($network_id), id: sender.clone().into() }.into(); + let versioned_assets: $crate::VersionedAssets = $assets.clone().into(); + + <$sender_para>::execute_with(|| { + // Assets are trapped for whatever reason. + // The possible reasons for this might differ from runtime to runtime, so here we just drop them directly. + <$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::drop_assets( + &beneficiary, + $assets.clone().into(), + &XcmContext { origin: None, message_id: [0u8; 32], topic: None }, + ); + + type RuntimeEvent = <$sender_para as $crate::Chain>::RuntimeEvent; + assert_expected_events!( + $sender_para, + vec![ + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::AssetsTrapped { origin: beneficiary, assets: versioned_assets, .. } + ) => {}, + ] + ); + + let balance_before = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + + // Different origin or different assets won't work. + let other_origin = <$sender_para as $crate::Chain>::RuntimeOrigin::signed([<$sender_para Receiver>]::get()); + assert!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + other_origin, + bx!(versioned_assets.clone().into()), + bx!(beneficiary.clone().into()), + ).is_err()); + let other_versioned_assets: $crate::VersionedAssets = Assets::new().into(); + assert!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(other_versioned_assets.into()), + bx!(beneficiary.clone().into()), + ).is_err()); + + // Assets will be claimed to `beneficiary`, which is the same as `sender`. + assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(versioned_assets.clone().into()), + bx!(beneficiary.clone().into()), + )); + + assert_expected_events!( + $sender_para, + vec![ + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::AssetsClaimed { origin: beneficiary, assets: versioned_assets, .. } + ) => {}, + ] + ); + + // After claiming the assets, the balance has increased. + let balance_after = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + assert_eq!(balance_after, balance_before + $amount); + + // Claiming the assets again doesn't work. + assert!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(versioned_assets.clone().into()), + bx!(beneficiary.clone().into()), + ).is_err()); + + let balance = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + assert_eq!(balance, balance_after); + + // You can also claim assets and send them to a different account. + <$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::drop_assets( + &beneficiary, + $assets.clone().into(), + &XcmContext { origin: None, message_id: [0u8; 32], topic: None }, + ); + let receiver = [<$sender_para Receiver>]::get(); + let other_beneficiary: Location = + $crate::AccountId32 { network: Some($network_id), id: receiver.clone().into() }.into(); + let balance_before = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&receiver); + assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(versioned_assets.clone().into()), + bx!(other_beneficiary.clone().into()), + )); + let balance_after = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&receiver); + assert_eq!(balance_after, balance_before + $amount); + }); + } + }; +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml index 866b6c5840..14228e387d 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml @@ -20,9 +20,9 @@ pallet-asset-conversion = { version = "11.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } +xcm = { package = "staging-xcm", version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } -pallet-xcm = { version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } # Cumulus parachains-common = { version = "8.0.0" } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs new file mode 100644 index 0000000000..a08bc885c0 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs @@ -0,0 +1,30 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use asset_hub_kusama_runtime::ExistentialDeposit; +use integration_tests_helpers::test_chain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_chain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs index 4b7498c1c6..3bded12dd1 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod claim_assets; mod reserve_transfer; mod send; mod set_xcm_versions; diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml index 77b977f577..ce1a8587cf 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml @@ -21,8 +21,8 @@ pallet-message-queue = { version = "32.0.0" } # Polkadot polkadot-runtime-common = { version = "8.0.1" } -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } # Cumulus diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs new file mode 100644 index 0000000000..676b210170 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs @@ -0,0 +1,36 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use asset_hub_polkadot_runtime::ExistentialDeposit; +use integration_tests_helpers::test_chain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_chain_can_claim_assets!( + AssetHubPolkadot, + RuntimeCall, + NetworkId::Polkadot, + assets, + amount + ); +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs index eaf2a15e11..4029a58cae 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod claim_assets; mod fellowship_treasury; mod reserve_transfer; mod send; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml index bf134f8400..40b168d264 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml @@ -17,8 +17,8 @@ pallet-assets = { version = "30.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } # Cumulus diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs new file mode 100644 index 0000000000..976d90ebe5 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs @@ -0,0 +1,30 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use bridge_hub_kusama_runtime::ExistentialDeposit; +use integration_tests_helpers::test_chain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_chain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs index 4bd2c77fc2..91a6b7b08f 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -16,6 +16,7 @@ use crate::*; mod asset_transfers; +mod claim_assets; mod send_xcm; mod teleport; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml index 18026e77e3..c7e4151cee 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml @@ -17,8 +17,8 @@ pallet-assets = { version = "30.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } # Cumulus diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs new file mode 100644 index 0000000000..450788b92b --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs @@ -0,0 +1,36 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use bridge_hub_polkadot_runtime::ExistentialDeposit; +use integration_tests_helpers::test_chain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_chain_can_claim_assets!( + AssetHubPolkadot, + RuntimeCall, + NetworkId::Polkadot, + assets, + amount + ); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs index 1884e8cc2d..b0560761ee 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -16,6 +16,7 @@ use crate::*; mod asset_transfers; +mod claim_assets; mod send_xcm; mod teleport; diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml index 2a41407b8a..e05924df6b 100644 --- a/relay/kusama/Cargo.toml +++ b/relay/kusama/Cargo.toml @@ -81,7 +81,7 @@ pallet-treasury = { default-features = false , version = "28.0.0" } pallet-utility = { default-features = false , version = "29.0.0" } pallet-vesting = { default-features = false , version = "29.0.0" } pallet-whitelist = { default-features = false , version = "28.0.0" } -pallet-xcm = { default-features = false , version = "8.0.1" } +pallet-xcm = { default-features = false , version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } frame-election-provider-support = { default-features = false , version = "29.0.0" } @@ -98,7 +98,7 @@ runtime-common = { package = "polkadot-runtime-common", default-features = false runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "8.0.1" } primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false , version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false , version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 34b4bc8bc7..631e9f4ac2 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -2599,6 +2599,13 @@ sp_api::impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::here()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/relay/kusama/src/weights/pallet_xcm.rs b/relay/kusama/src/weights/pallet_xcm.rs index 027570ad3e..724f5c5498 100644 --- a/relay/kusama/src/weights/pallet_xcm.rs +++ b/relay/kusama/src/weights/pallet_xcm.rs @@ -51,6 +51,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(35_514_000, 0) + .saturating_add(Weight::from_parts(0, 3488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml index 5a363430fb..27a5a40f2e 100644 --- a/relay/polkadot/Cargo.toml +++ b/relay/polkadot/Cargo.toml @@ -79,7 +79,7 @@ pallet-whitelist = { default-features = false , version = "28.0.0" } pallet-vesting = { default-features = false , version = "29.0.0" } pallet-utility = { default-features = false , version = "29.0.0" } frame-election-provider-support = { default-features = false , version = "29.0.0" } -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } frame-benchmarking = { default-features = false, optional = true , version = "29.0.0" } @@ -94,7 +94,7 @@ runtime-common = { package = "polkadot-runtime-common", default-features = false runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "8.0.1" } primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false , version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false , version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index f6f3537e12..178f7e66f7 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -2486,6 +2486,13 @@ sp_api::impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::here()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/relay/polkadot/src/weights/pallet_xcm.rs b/relay/polkadot/src/weights/pallet_xcm.rs index 3e82626c00..0e606a50e8 100644 --- a/relay/polkadot/src/weights/pallet_xcm.rs +++ b/relay/polkadot/src/weights/pallet_xcm.rs @@ -51,6 +51,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(35_299_000, 0) + .saturating_add(Weight::from_parts(0, 3488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 2a773ae560..4e062aed53 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -67,12 +67,12 @@ sp-weights = { default-features = false, version = "28.0.0" } primitive-types = { version = "0.12.2", default-features = false, features = ["codec", "scale-info", "num-traits"] } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml index 26b0c80801..102c205335 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml @@ -19,7 +19,7 @@ frame-support = { default-features = false, version = "29.0.0" } sp-std = { default-features = false, version = "14.0.0" } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } [features] default = [ "std" ] diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 7c5ded40cd..192ef60fec 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -1428,6 +1428,13 @@ impl_runtime_apis! { }); Some((assets, fee_index as u32, dest, verify)) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs index 8832066a4c..482a11b7b4 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs @@ -47,6 +47,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(39_122_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml index 62e8223ff0..2c2affff30 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml @@ -62,12 +62,12 @@ sp-version = { default-features = false, version = "30.0.0" } sp-weights = { default-features = false, version = "28.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml index e049be2504..8fd8267b69 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml @@ -19,7 +19,7 @@ frame-support = { default-features = false, version = "29.0.0" } sp-std = { default-features = false, version = "14.0.0" } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } [features] default = [ "std" ] diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 539bb55fd2..6feef077ca 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -1298,6 +1298,13 @@ impl_runtime_apis! { }); Some((assets, fee_index as u32, dest, verify)) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs index 8cbf8e7f4f..8a3e9507bc 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs @@ -47,6 +47,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(38_075_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index c8dcfc8aca..6b5ba3f8c1 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -60,12 +60,12 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 19d181363a..d030e2c27c 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -865,6 +865,13 @@ impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs index 82bed2b1fb..53f8f55452 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs @@ -47,6 +47,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(34_674_000, 0) + .saturating_add(Weight::from_parts(0, 3555)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 3d5dcdf978..9299cd55b3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -60,12 +60,12 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 6ccbd55d46..a3880b3b16 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -866,6 +866,13 @@ impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs index abdccc9ca0..7653c823cd 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs @@ -47,6 +47,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(35_411_000, 0) + .saturating_add(Weight::from_parts(0, 3555)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/collectives/collectives-polkadot/Cargo.toml b/system-parachains/collectives/collectives-polkadot/Cargo.toml index 2f1e0ec511..4f471ef555 100644 --- a/system-parachains/collectives/collectives-polkadot/Cargo.toml +++ b/system-parachains/collectives/collectives-polkadot/Cargo.toml @@ -59,12 +59,12 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index b87991bd42..42d1472af3 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -1021,6 +1021,13 @@ impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } let whitelist: Vec = vec![ diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs index 96a89b0292..5584d02126 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs @@ -47,6 +47,12 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + Weight::from_parts(36_978_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml index 80e9012b40..5a2c3bc633 100644 --- a/system-parachains/encointer/Cargo.toml +++ b/system-parachains/encointer/Cargo.toml @@ -71,10 +71,10 @@ sp-version = { default-features = false, version = "30.0.0" } sp-genesis-builder = { default-features = false, version = "0.8.0" } # Polkadot dependencies -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/gluttons/glutton-kusama/Cargo.toml b/system-parachains/gluttons/glutton-kusama/Cargo.toml index 7a0dd078ca..5473fffcfd 100644 --- a/system-parachains/gluttons/glutton-kusama/Cargo.toml +++ b/system-parachains/gluttons/glutton-kusama/Cargo.toml @@ -37,7 +37,7 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" }