Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Implement AliasOrigin processing in XCVM #7245

Merged
merged 32 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
43044fc
Implement AliasOrigin processing in XCVM
KiChjang May 17, 2023
59b6056
add builder types and first test
vstam1 May 22, 2023
cb0ff78
switch to more general builder types
vstam1 May 22, 2023
7efcc39
clone target for RemovePrefixAccountId32
vstam1 May 22, 2023
c1c41f6
change builder types
vstam1 May 23, 2023
97f1f31
change AliasForeignAccountId32 and add test for AliasCase
vstam1 May 24, 2023
d984c95
add Aliasers type to xcm configs
vstam1 May 24, 2023
19e3123
add benchmark
vstam1 May 24, 2023
312461d
merge master
vstam1 May 24, 2023
f115cca
benchmark fix
vstam1 May 24, 2023
c7c3473
add benchmark function for runtimes
vstam1 May 24, 2023
39743b6
fix alias_origin result types
vstam1 May 24, 2023
de583b6
fix benchmark test
vstam1 May 24, 2023
7530772
add runtime-benchmarks feature in pallet-xcm-benchmarks
vstam1 May 24, 2023
f29f111
fmt
vstam1 May 24, 2023
56c7e03
remove AliasCase, add test and fmt
vstam1 May 25, 2023
e3f71ed
Merge branch 'master' into kckyeung/xcm-alias-origin
vstam1 May 25, 2023
a325ee9
address feedback
vstam1 May 30, 2023
31c12fd
merge master
vstam1 May 30, 2023
9b74bfb
Merge branch 'master' into kckyeung/xcm-alias-origin
vstam1 May 31, 2023
e2c2da2
".git/.scripts/commands/bench/bench.sh" xcm kusama pallet_xcm_benchma…
May 31, 2023
0f9bba5
".git/.scripts/commands/bench/bench.sh" xcm westend pallet_xcm_benchm…
May 31, 2023
cb82d9b
".git/.scripts/commands/bench/bench.sh" xcm rococo pallet_xcm_benchma…
May 31, 2023
26f2062
address feedback
vstam1 Jun 1, 2023
e5c910b
lock
vstam1 Jun 2, 2023
f3e4342
merge master
vstam1 Jun 2, 2023
da0c6d4
".git/.scripts/commands/bench/bench.sh" xcm kusama pallet_xcm_benchma…
Jun 2, 2023
c34c201
".git/.scripts/commands/bench/bench.sh" xcm westend pallet_xcm_benchm…
Jun 2, 2023
046c7d1
".git/.scripts/commands/bench/bench.sh" xcm rococo pallet_xcm_benchma…
Jun 2, 2023
e7d8749
Merge branch 'master' into kckyeung/xcm-alias-origin
vstam1 Jun 5, 2023
a6350e1
change doc
vstam1 Jun 5, 2023
2f2c80c
fmt
vstam1 Jun 5, 2023
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
5 changes: 5 additions & 0 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,11 @@ sp_api::impl_runtime_apis! {
// Kusama doesn't support exporting messages
Err(BenchmarkError::Skip)
}

fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> {
// The XCM executor of Kusama doesn't have a configured `Aliasers`
Err(BenchmarkError::Skip)
}
}

let whitelist: Vec<TrackedStorageKey> = vec![
Expand Down
161 changes: 110 additions & 51 deletions runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,25 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-04-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024

// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --pallet=pallet_xcm_benchmarks::generic
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_xcm_benchmarks::generic
// --chain=kusama-dev
// --header=./file_header.txt
// --template=./xcm/pallet-xcm-benchmarks/template.hbs
// --output=./runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
// --output=./runtime/kusama/src/weights/xcm/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -46,141 +47,199 @@ use sp_std::marker::PhantomData;
/// Weights for `pallet_xcm_benchmarks::generic`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo<T> {
// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
pub(crate) fn report_holding() -> Weight {
Weight::from_parts(25_878_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
Weight::from_ref_time(32_612_000 as u64)
vstam1 marked this conversation as resolved.
Show resolved Hide resolved
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
pub(crate) fn buy_execution() -> Weight {
Weight::from_parts(3_697_000 as u64, 0)
Weight::from_ref_time(2_806_000 as u64)
}
// Storage: XcmPallet Queries (r:1 w:0)
// Proof Skipped: XcmPallet Queries (max_values: None, max_size: None, mode: Measured)
pub(crate) fn query_response() -> Weight {
Weight::from_parts(13_458_000 as u64, 0)
Weight::from_ref_time(11_074_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
pub(crate) fn transact() -> Weight {
Weight::from_parts(13_597_000 as u64, 0)
Weight::from_ref_time(12_264_000 as u64)
}
pub(crate) fn refund_surplus() -> Weight {
Weight::from_parts(3_839_000 as u64, 0)
Weight::from_ref_time(2_863_000 as u64)
}
pub(crate) fn set_error_handler() -> Weight {
Weight::from_parts(3_657_000 as u64, 0)
Weight::from_ref_time(2_687_000 as u64)
}
pub(crate) fn set_appendix() -> Weight {
Weight::from_parts(3_757_000 as u64, 0)
Weight::from_ref_time(2_620_000 as u64)
}
pub(crate) fn clear_error() -> Weight {
Weight::from_parts(3_651_000 as u64, 0)
Weight::from_ref_time(2_636_000 as u64)
}
pub(crate) fn descend_origin() -> Weight {
Weight::from_parts(4_589_000 as u64, 0)
Weight::from_ref_time(3_490_000 as u64)
}
pub(crate) fn clear_origin() -> Weight {
Weight::from_parts(3_661_000 as u64, 0)
Weight::from_ref_time(2_604_000 as u64)
}
// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
pub(crate) fn report_error() -> Weight {
Weight::from_parts(21_351_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
Weight::from_ref_time(27_643_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: XcmPallet AssetTraps (r:1 w:1)
// Proof Skipped: XcmPallet AssetTraps (max_values: None, max_size: None, mode: Measured)
pub(crate) fn claim_asset() -> Weight {
Weight::from_parts(7_674_000 as u64, 0)
Weight::from_ref_time(26_138_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
pub(crate) fn trap() -> Weight {
Weight::from_parts(3_606_000 as u64, 0)
Weight::from_ref_time(4_544_000 as u64)
}
// Storage: XcmPallet VersionNotifyTargets (r:1 w:1)
// Proof Skipped: XcmPallet VersionNotifyTargets (max_values: None, max_size: None, mode: Measured)
// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
pub(crate) fn subscribe_version() -> Weight {
Weight::from_parts(30_453_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
Weight::from_ref_time(61_712_000 as u64)
.saturating_add(T::DbWeight::get().reads(8 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: XcmPallet VersionNotifyTargets (r:0 w:1)
// Proof Skipped: XcmPallet VersionNotifyTargets (max_values: None, max_size: None, mode: Measured)
pub(crate) fn unsubscribe_version() -> Weight {
Weight::from_parts(5_543_000 as u64, 0)
Weight::from_ref_time(8_716_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
pub(crate) fn initiate_reserve_withdraw() -> Weight {
Weight::from_parts(25_464_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
Weight::from_ref_time(32_027_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
pub(crate) fn burn_asset() -> Weight {
Weight::from_parts(5_194_000 as u64, 0)
Weight::from_ref_time(4_368_000 as u64)
}
pub(crate) fn expect_asset() -> Weight {
Weight::from_parts(3_698_000 as u64, 0)
Weight::from_ref_time(2_905_000 as u64)
}
pub(crate) fn expect_origin() -> Weight {
Weight::from_parts(3_786_000 as u64, 0)
Weight::from_ref_time(2_784_000 as u64)
}
pub(crate) fn expect_error() -> Weight {
Weight::from_parts(3_645_000 as u64, 0)
Weight::from_ref_time(4_252_000 as u64)
}
pub(crate) fn expect_transact_status() -> Weight {
Weight::from_parts(3_645_000 as u64, 0)
Weight::from_ref_time(2_846_000 as u64)
}
// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
pub(crate) fn query_pallet() -> Weight {
Weight::from_parts(22_993_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
Weight::from_ref_time(34_727_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
pub(crate) fn expect_pallet() -> Weight {
Weight::from_parts(4_043_000 as u64, 0)
Weight::from_ref_time(8_310_000 as u64)
}
// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
pub(crate) fn report_transact_status() -> Weight {
Weight::from_parts(21_668_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
Weight::from_ref_time(27_834_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
pub(crate) fn clear_transact_status() -> Weight {
Weight::from_parts(3_673_000 as u64, 0)
Weight::from_ref_time(2_721_000 as u64)
}
pub(crate) fn set_topic() -> Weight {
Weight::from_parts(3_661_000 as u64, 0)
Weight::from_ref_time(2_633_000 as u64)
}
pub(crate) fn clear_topic() -> Weight {
Weight::from_parts(3_647_000 as u64, 0)
Weight::from_ref_time(2_652_000 as u64)
}
pub(crate) fn set_fees_mode() -> Weight {
Weight::from_parts(3_599_000 as u64, 0)
Weight::from_ref_time(2_656_000 as u64)
}
pub(crate) fn unpaid_execution() -> Weight {
Weight::from_parts(3_111_000 as u64, 0)
Weight::from_ref_time(2_834_000 as u64)
}
}
1 change: 1 addition & 0 deletions runtime/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ impl xcm_executor::Config for XcmConfig {
type UniversalAliases = Nothing;
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions runtime/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ impl xcm_executor::Config for XcmConfig {
type UniversalAliases = Nothing;
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
}

parameter_types! {
Expand Down
5 changes: 5 additions & 0 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,11 @@ sp_api::impl_runtime_apis! {
// Rococo doesn't support exporting messages
Err(BenchmarkError::Skip)
}

fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> {
// The XCM executor of Rococo doesn't have a configured `Aliasers`
Err(BenchmarkError::Skip)
}
}

let whitelist: Vec<TrackedStorageKey> = vec![
Expand Down
Loading