mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Add claim_assets extrinsic to pallet-xcm (#3403)
If an XCM execution fails or ends with leftover assets, these will be trapped. In order to claim them, a custom XCM has to be executed, with the `ClaimAsset` instruction. However, arbitrary XCM execution is not allowed everywhere yet and XCM itself is still not easy enough to use for users out there with trapped assets. This new extrinsic in `pallet-xcm` will allow these users to easily claim their assets, without concerning themselves with writing arbitrary XCMs. Part of fixing https://github.com/paritytech/polkadot-sdk/issues/3495 --------- Co-authored-by: command-bot <> Co-authored-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
committed by
GitHub
parent
c0e52a9ed6
commit
650886683d
@@ -731,6 +731,13 @@ impl_runtime_apis! {
|
||||
// Reserve transfers are disabled
|
||||
None
|
||||
}
|
||||
|
||||
fn get_asset() -> Asset {
|
||||
Asset {
|
||||
id: AssetId(Location::parent()),
|
||||
fun: Fungible(ExistentialDeposit::get()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -17,25 +17,23 @@
|
||||
//! Autogenerated weights for `pallet_xcm`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
|
||||
//! DATE: 2024-02-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! DATE: 2024-02-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! WORST CASE MAP SIZE: `1000000`
|
||||
//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
|
||||
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-westend-dev")`, DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// ./target/production/polkadot-parachain
|
||||
// target/production/polkadot-parachain
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=coretime-westend-dev
|
||||
// --wasm-execution=compiled
|
||||
// --pallet=pallet_xcm
|
||||
// --no-storage-info
|
||||
// --no-median-slopes
|
||||
// --no-min-squares
|
||||
// --extrinsic=*
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --json
|
||||
// --extrinsic=*
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
|
||||
// --pallet=pallet_xcm
|
||||
// --chain=coretime-westend-dev
|
||||
// --header=./cumulus/file_header.txt
|
||||
// --output=./cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/
|
||||
|
||||
@@ -64,8 +62,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `74`
|
||||
// Estimated: `3539`
|
||||
// Minimum execution time: 17_946_000 picoseconds.
|
||||
Weight::from_parts(18_398_000, 0)
|
||||
// Minimum execution time: 18_410_000 picoseconds.
|
||||
Weight::from_parts(18_657_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 3539))
|
||||
.saturating_add(T::DbWeight::get().reads(5))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
@@ -86,8 +84,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `106`
|
||||
// Estimated: `3571`
|
||||
// Minimum execution time: 47_982_000 picoseconds.
|
||||
Weight::from_parts(49_215_000, 0)
|
||||
// Minimum execution time: 56_616_000 picoseconds.
|
||||
Weight::from_parts(57_751_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 3571))
|
||||
.saturating_add(T::DbWeight::get().reads(6))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
@@ -128,8 +126,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 6_042_000 picoseconds.
|
||||
Weight::from_parts(6_257_000, 0)
|
||||
// Minimum execution time: 6_014_000 picoseconds.
|
||||
Weight::from_parts(6_412_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 0))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
@@ -139,8 +137,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 1_845_000 picoseconds.
|
||||
Weight::from_parts(1_993_000, 0)
|
||||
// Minimum execution time: 1_844_000 picoseconds.
|
||||
Weight::from_parts(1_957_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 0))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
@@ -164,8 +162,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `74`
|
||||
// Estimated: `3539`
|
||||
// Minimum execution time: 24_062_000 picoseconds.
|
||||
Weight::from_parts(24_666_000, 0)
|
||||
// Minimum execution time: 24_067_000 picoseconds.
|
||||
Weight::from_parts(24_553_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 3539))
|
||||
.saturating_add(T::DbWeight::get().reads(7))
|
||||
.saturating_add(T::DbWeight::get().writes(5))
|
||||
@@ -188,8 +186,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `292`
|
||||
// Estimated: `3757`
|
||||
// Minimum execution time: 26_486_000 picoseconds.
|
||||
Weight::from_parts(27_528_000, 0)
|
||||
// Minimum execution time: 27_023_000 picoseconds.
|
||||
Weight::from_parts(27_620_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 3757))
|
||||
.saturating_add(T::DbWeight::get().reads(6))
|
||||
.saturating_add(T::DbWeight::get().writes(4))
|
||||
@@ -200,8 +198,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 1_881_000 picoseconds.
|
||||
Weight::from_parts(2_008_000, 0)
|
||||
// Minimum execution time: 1_866_000 picoseconds.
|
||||
Weight::from_parts(1_984_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 0))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
@@ -211,8 +209,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `89`
|
||||
// Estimated: `13454`
|
||||
// Minimum execution time: 15_971_000 picoseconds.
|
||||
Weight::from_parts(16_455_000, 0)
|
||||
// Minimum execution time: 16_425_000 picoseconds.
|
||||
Weight::from_parts(16_680_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 13454))
|
||||
.saturating_add(T::DbWeight::get().reads(5))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
@@ -223,8 +221,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `93`
|
||||
// Estimated: `13458`
|
||||
// Minimum execution time: 16_603_000 picoseconds.
|
||||
Weight::from_parts(17_037_000, 0)
|
||||
// Minimum execution time: 16_171_000 picoseconds.
|
||||
Weight::from_parts(16_564_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 13458))
|
||||
.saturating_add(T::DbWeight::get().reads(5))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
@@ -235,8 +233,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `106`
|
||||
// Estimated: `15946`
|
||||
// Minimum execution time: 17_821_000 picoseconds.
|
||||
Weight::from_parts(18_200_000, 0)
|
||||
// Minimum execution time: 17_785_000 picoseconds.
|
||||
Weight::from_parts(18_123_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 15946))
|
||||
.saturating_add(T::DbWeight::get().reads(6))
|
||||
}
|
||||
@@ -256,8 +254,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `142`
|
||||
// Estimated: `6082`
|
||||
// Minimum execution time: 23_878_000 picoseconds.
|
||||
Weight::from_parts(24_721_000, 0)
|
||||
// Minimum execution time: 23_903_000 picoseconds.
|
||||
Weight::from_parts(24_769_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 6082))
|
||||
.saturating_add(T::DbWeight::get().reads(7))
|
||||
.saturating_add(T::DbWeight::get().writes(3))
|
||||
@@ -268,8 +266,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `136`
|
||||
// Estimated: `11026`
|
||||
// Minimum execution time: 10_566_000 picoseconds.
|
||||
Weight::from_parts(11_053_000, 0)
|
||||
// Minimum execution time: 10_617_000 picoseconds.
|
||||
Weight::from_parts(10_843_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 11026))
|
||||
.saturating_add(T::DbWeight::get().reads(4))
|
||||
}
|
||||
@@ -279,8 +277,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `100`
|
||||
// Estimated: `13465`
|
||||
// Minimum execution time: 16_020_000 picoseconds.
|
||||
Weight::from_parts(16_619_000, 0)
|
||||
// Minimum execution time: 16_656_000 picoseconds.
|
||||
Weight::from_parts(17_106_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 13465))
|
||||
.saturating_add(T::DbWeight::get().reads(5))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
@@ -301,8 +299,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `142`
|
||||
// Estimated: `13507`
|
||||
// Minimum execution time: 32_136_000 picoseconds.
|
||||
Weight::from_parts(32_610_000, 0)
|
||||
// Minimum execution time: 31_721_000 picoseconds.
|
||||
Weight::from_parts(32_547_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 13507))
|
||||
.saturating_add(T::DbWeight::get().reads(10))
|
||||
.saturating_add(T::DbWeight::get().writes(4))
|
||||
@@ -315,8 +313,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `32`
|
||||
// Estimated: `1517`
|
||||
// Minimum execution time: 3_336_000 picoseconds.
|
||||
Weight::from_parts(3_434_000, 0)
|
||||
// Minimum execution time: 3_439_000 picoseconds.
|
||||
Weight::from_parts(3_619_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 1517))
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(2))
|
||||
@@ -327,10 +325,22 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `7669`
|
||||
// Estimated: `11134`
|
||||
// Minimum execution time: 23_977_000 picoseconds.
|
||||
Weight::from_parts(24_413_000, 0)
|
||||
// Minimum execution time: 24_657_000 picoseconds.
|
||||
Weight::from_parts(24_971_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 11134))
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
/// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1)
|
||||
/// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
fn claim_assets() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `90`
|
||||
// Estimated: `3555`
|
||||
// Minimum execution time: 34_028_000 picoseconds.
|
||||
Weight::from_parts(34_697_000, 0)
|
||||
.saturating_add(Weight::from_parts(0, 3555))
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user