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

Add claim_assets extrinsic to pallet-xcm #3403

Merged
merged 28 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cce9e41
feat(pallet-xcm): Add extrinsic
franciscoaguirre Feb 20, 2024
6b70fab
docs(prdoc): Add PRDoc
franciscoaguirre Feb 20, 2024
83b98a7
".git/.scripts/commands/fmt/fmt.sh"
Feb 20, 2024
26bb21a
fix(pallet-xcm): Add placeholders for benchmark
franciscoaguirre Feb 20, 2024
dafc0f3
fix(pallet-xcm): Fix claim_assets benchmark
franciscoaguirre Feb 20, 2024
ff4a49c
fix(pallet-xcm): Make get_valid_asset return the existential deposit …
franciscoaguirre Feb 20, 2024
961da48
fix(pallet-xcm): Add get_valid_asset to mock runtime
franciscoaguirre Feb 20, 2024
ff557cc
Merge branch 'master' into claim-assets-extrinsic
franciscoaguirre Feb 20, 2024
9afa9c4
".git/.scripts/commands/fmt/fmt.sh"
Feb 20, 2024
4631b48
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
c02b434
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
8149023
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
0eb77ca
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
bffad43
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
ca63b79
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
e672b17
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
6f0f2b5
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
849ccec
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
7d18b0e
chore(rococo-runtime): Update pallet_xcm weights
franciscoaguirre Feb 20, 2024
8e74da2
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Feb 20, 2024
82f076b
chore(pallet-xcm): Rename get_valid_asset to get_asset
franciscoaguirre Feb 22, 2024
61a00ee
fix(pallet-xcm): Move debug to the start of the function
franciscoaguirre Feb 22, 2024
3faf3bc
Merge branch 'master' into claim-assets-extrinsic
franciscoaguirre Feb 22, 2024
fcb17a9
".git/.scripts/commands/fmt/fmt.sh"
Feb 22, 2024
622c0a4
fix(claim_assets): Log origin_location instead of location
franciscoaguirre Feb 22, 2024
e7ffc40
docs(prdoc): Add description for Runtime Dev audience
franciscoaguirre Feb 22, 2024
d045fe9
Apply suggestions from code review
acatangiu Feb 27, 2024
448aad5
Merge branch 'master' into claim-assets-extrinsic
acatangiu Feb 27, 2024
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 @@ -1435,6 +1435,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 XcmBridgeHubRouterConfig<ToWestendXcmRouterInstance> for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-12-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-02-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-r43aesjn-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -64,8 +64,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 25_003_000 picoseconds.
Weight::from_parts(25_800_000, 0)
// Minimum execution time: 22_136_000 picoseconds.
Weight::from_parts(22_518_000, 0)
.saturating_add(Weight::from_parts(0, 3610))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 88_832_000 picoseconds.
Weight::from_parts(90_491_000, 0)
// Minimum execution time: 92_277_000 picoseconds.
Weight::from_parts(94_843_000, 0)
.saturating_add(Weight::from_parts(0, 3610))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(3))
Expand All @@ -118,8 +118,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `6196`
// Minimum execution time: 138_911_000 picoseconds.
Weight::from_parts(142_483_000, 0)
// Minimum execution time: 120_110_000 picoseconds.
Weight::from_parts(122_968_000, 0)
.saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(5))
Expand Down Expand Up @@ -148,8 +148,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `496`
// Estimated: `6208`
// Minimum execution time: 146_932_000 picoseconds.
Weight::from_parts(153_200_000, 0)
// Minimum execution time: 143_116_000 picoseconds.
Weight::from_parts(147_355_000, 0)
.saturating_add(Weight::from_parts(0, 6208))
.saturating_add(T::DbWeight::get().reads(12))
.saturating_add(T::DbWeight::get().writes(7))
Expand All @@ -170,8 +170,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_081_000 picoseconds.
Weight::from_parts(7_397_000, 0)
// Minimum execution time: 6_517_000 picoseconds.
Weight::from_parts(6_756_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -181,8 +181,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_007_000 picoseconds.
Weight::from_parts(2_183_000, 0)
// Minimum execution time: 1_894_000 picoseconds.
Weight::from_parts(2_024_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -208,8 +208,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 28_790_000 picoseconds.
Weight::from_parts(29_767_000, 0)
// Minimum execution time: 27_314_000 picoseconds.
Weight::from_parts(28_787_000, 0)
.saturating_add(Weight::from_parts(0, 3610))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(5))
Expand All @@ -234,8 +234,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `363`
// Estimated: `3828`
// Minimum execution time: 30_951_000 picoseconds.
Weight::from_parts(31_804_000, 0)
// Minimum execution time: 29_840_000 picoseconds.
Weight::from_parts(30_589_000, 0)
.saturating_add(Weight::from_parts(0, 3828))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
Expand All @@ -246,45 +246,45 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_164_000 picoseconds.
Weight::from_parts(2_311_000, 0)
// Minimum execution time: 1_893_000 picoseconds.
Weight::from_parts(2_017_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:4 w:2)
/// Storage: `PolkadotXcm::SupportedVersion` (r:5 w:2)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn migrate_supported_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `162`
// Estimated: `11052`
// Minimum execution time: 16_906_000 picoseconds.
Weight::from_parts(17_612_000, 0)
.saturating_add(Weight::from_parts(0, 11052))
.saturating_add(T::DbWeight::get().reads(4))
// Measured: `159`
// Estimated: `13524`
// Minimum execution time: 19_211_000 picoseconds.
Weight::from_parts(19_552_000, 0)
.saturating_add(Weight::from_parts(0, 13524))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `PolkadotXcm::VersionNotifiers` (r:4 w:2)
/// Storage: `PolkadotXcm::VersionNotifiers` (r:5 w:2)
/// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn migrate_version_notifiers() -> Weight {
// Proof Size summary in bytes:
// Measured: `166`
// Estimated: `11056`
// Minimum execution time: 17_443_000 picoseconds.
Weight::from_parts(18_032_000, 0)
.saturating_add(Weight::from_parts(0, 11056))
.saturating_add(T::DbWeight::get().reads(4))
// Measured: `163`
// Estimated: `13528`
// Minimum execution time: 19_177_000 picoseconds.
Weight::from_parts(19_704_000, 0)
.saturating_add(Weight::from_parts(0, 13528))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0)
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:0)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn already_notified_target() -> Weight {
// Proof Size summary in bytes:
// Measured: `173`
// Estimated: `13538`
// Minimum execution time: 18_992_000 picoseconds.
Weight::from_parts(19_464_000, 0)
.saturating_add(Weight::from_parts(0, 13538))
.saturating_add(T::DbWeight::get().reads(5))
// Estimated: `16013`
// Minimum execution time: 20_449_000 picoseconds.
Weight::from_parts(21_075_000, 0)
.saturating_add(Weight::from_parts(0, 16013))
.saturating_add(T::DbWeight::get().reads(6))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
Expand All @@ -304,36 +304,36 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `6152`
// Minimum execution time: 28_011_000 picoseconds.
Weight::from_parts(28_716_000, 0)
// Minimum execution time: 26_578_000 picoseconds.
Weight::from_parts(27_545_000, 0)
.saturating_add(Weight::from_parts(0, 6152))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:3 w:0)
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:0)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn notify_target_migration_fail() -> Weight {
// Proof Size summary in bytes:
// Measured: `206`
// Estimated: `8621`
// Minimum execution time: 9_533_000 picoseconds.
Weight::from_parts(9_856_000, 0)
.saturating_add(Weight::from_parts(0, 8621))
.saturating_add(T::DbWeight::get().reads(3))
// Estimated: `11096`
// Minimum execution time: 11_646_000 picoseconds.
Weight::from_parts(11_944_000, 0)
.saturating_add(Weight::from_parts(0, 11096))
.saturating_add(T::DbWeight::get().reads(4))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2)
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn migrate_version_notify_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `173`
// Estimated: `11063`
// Minimum execution time: 17_628_000 picoseconds.
Weight::from_parts(18_146_000, 0)
.saturating_add(Weight::from_parts(0, 11063))
.saturating_add(T::DbWeight::get().reads(4))
// Measured: `170`
// Estimated: `13535`
// Minimum execution time: 19_301_000 picoseconds.
Weight::from_parts(19_664_000, 0)
.saturating_add(Weight::from_parts(0, 13535))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2)
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
/// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
Expand All @@ -349,12 +349,12 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn migrate_and_notify_old_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `215`
// Estimated: `11105`
// Minimum execution time: 34_877_000 picoseconds.
Weight::from_parts(35_607_000, 0)
.saturating_add(Weight::from_parts(0, 11105))
.saturating_add(T::DbWeight::get().reads(10))
// Measured: `212`
// Estimated: `13577`
// Minimum execution time: 35_715_000 picoseconds.
Weight::from_parts(36_915_000, 0)
.saturating_add(Weight::from_parts(0, 13577))
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1)
Expand All @@ -365,8 +365,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `1588`
// Minimum execution time: 5_370_000 picoseconds.
Weight::from_parts(5_616_000, 0)
// Minimum execution time: 4_871_000 picoseconds.
Weight::from_parts(5_066_000, 0)
.saturating_add(Weight::from_parts(0, 1588))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -377,10 +377,22 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `7740`
// Estimated: `11205`
// Minimum execution time: 26_820_000 picoseconds.
Weight::from_parts(27_143_000, 0)
// Minimum execution time: 25_150_000 picoseconds.
Weight::from_parts(26_119_000, 0)
.saturating_add(Weight::from_parts(0, 11205))
.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: `160`
// Estimated: `3625`
// Minimum execution time: 38_248_000 picoseconds.
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))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,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()),
}
}
}

use pallet_xcm_bridge_hub_router::benchmarking::{
Expand Down
Loading
Loading