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 all 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
118 changes: 59 additions & 59 deletions runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-06-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
Expand Down Expand Up @@ -68,76 +68,76 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 31_951_000 picoseconds.
Weight::from_parts(32_879_000, 3676)
// Minimum execution time: 32_102_000 picoseconds.
Weight::from_parts(33_749_000, 3676)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
pub(crate) fn buy_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_691_000 picoseconds.
Weight::from_parts(2_783_000, 0)
// Minimum execution time: 2_624_000 picoseconds.
Weight::from_parts(2_714_000, 0)
}
/// 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 {
// Proof Size summary in bytes:
// Measured: `169`
// Estimated: `3634`
// Minimum execution time: 10_819_000 picoseconds.
Weight::from_parts(11_035_000, 3634)
// Minimum execution time: 10_599_000 picoseconds.
Weight::from_parts(10_882_000, 3634)
.saturating_add(T::DbWeight::get().reads(1))
}
pub(crate) fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 12_035_000 picoseconds.
Weight::from_parts(12_454_000, 0)
// Minimum execution time: 11_985_000 picoseconds.
Weight::from_parts(12_274_000, 0)
}
pub(crate) fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_874_000 picoseconds.
Weight::from_parts(2_981_000, 0)
// Minimum execution time: 2_739_000 picoseconds.
Weight::from_parts(2_862_000, 0)
}
pub(crate) fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_632_000 picoseconds.
Weight::from_parts(2_703_000, 0)
// Minimum execution time: 2_533_000 picoseconds.
Weight::from_parts(2_646_000, 0)
}
pub(crate) fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_554_000 picoseconds.
Weight::from_parts(2_642_000, 0)
// Minimum execution time: 2_563_000 picoseconds.
Weight::from_parts(2_647_000, 0)
}
pub(crate) fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_642_000 picoseconds.
Weight::from_parts(2_761_000, 0)
// Minimum execution time: 2_512_000 picoseconds.
Weight::from_parts(2_574_000, 0)
}
pub(crate) fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_406_000 picoseconds.
Weight::from_parts(3_535_000, 0)
// Minimum execution time: 3_307_000 picoseconds.
Weight::from_parts(3_448_000, 0)
}
pub(crate) fn clear_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_568_000 picoseconds.
Weight::from_parts(2_647_000, 0)
// Minimum execution time: 2_524_000 picoseconds.
Weight::from_parts(2_614_000, 0)
}
/// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
/// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
Expand All @@ -157,8 +157,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 27_298_000 picoseconds.
Weight::from_parts(27_716_000, 3676)
// Minimum execution time: 27_275_000 picoseconds.
Weight::from_parts(27_861_000, 3676)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
Expand All @@ -168,17 +168,17 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `226`
// Estimated: `3691`
// Minimum execution time: 14_960_000 picoseconds.
Weight::from_parts(15_461_000, 3691)
// Minimum execution time: 14_731_000 picoseconds.
Weight::from_parts(15_006_000, 3691)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
pub(crate) fn trap() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_667_000 picoseconds.
Weight::from_parts(2_736_000, 0)
// Minimum execution time: 2_446_000 picoseconds.
Weight::from_parts(2_581_000, 0)
}
/// Storage: XcmPallet VersionNotifyTargets (r:1 w:1)
/// Proof Skipped: XcmPallet VersionNotifyTargets (max_values: None, max_size: None, mode: Measured)
Expand All @@ -200,8 +200,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 34_532_000 picoseconds.
Weight::from_parts(35_207_000, 3676)
// Minimum execution time: 34_319_000 picoseconds.
Weight::from_parts(34_708_000, 3676)
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand All @@ -211,8 +211,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_196_000 picoseconds.
Weight::from_parts(5_283_000, 0)
// Minimum execution time: 4_974_000 picoseconds.
Weight::from_parts(5_155_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
Expand All @@ -233,45 +233,45 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 31_259_000 picoseconds.
Weight::from_parts(31_897_000, 3676)
// Minimum execution time: 30_858_000 picoseconds.
Weight::from_parts(31_858_000, 3676)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
pub(crate) fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_102_000 picoseconds.
Weight::from_parts(4_197_000, 0)
// Minimum execution time: 4_059_000 picoseconds.
Weight::from_parts(4_125_000, 0)
}
pub(crate) fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_758_000 picoseconds.
Weight::from_parts(2_870_000, 0)
// Minimum execution time: 2_657_000 picoseconds.
Weight::from_parts(2_741_000, 0)
}
pub(crate) fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_629_000 picoseconds.
Weight::from_parts(2_755_000, 0)
// Minimum execution time: 2_585_000 picoseconds.
Weight::from_parts(2_653_000, 0)
}
pub(crate) fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_639_000 picoseconds.
Weight::from_parts(2_713_000, 0)
// Minimum execution time: 2_552_000 picoseconds.
Weight::from_parts(2_632_000, 0)
}
pub(crate) fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_842_000 picoseconds.
Weight::from_parts(2_928_000, 0)
// Minimum execution time: 2_682_000 picoseconds.
Weight::from_parts(2_763_000, 0)
}
/// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
/// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
Expand All @@ -291,17 +291,17 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 34_560_000 picoseconds.
Weight::from_parts(34_859_000, 3676)
// Minimum execution time: 34_316_000 picoseconds.
Weight::from_parts(34_682_000, 3676)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
pub(crate) fn expect_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 8_179_000 picoseconds.
Weight::from_parts(8_362_000, 0)
// Minimum execution time: 7_938_000 picoseconds.
Weight::from_parts(8_071_000, 0)
}
/// Storage: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
/// Proof Skipped: unknown `0x3a696e747261626c6f636b5f656e74726f7079` (r:1 w:1)
Expand All @@ -321,44 +321,44 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 27_036_000 picoseconds.
Weight::from_parts(27_743_000, 3676)
// Minimum execution time: 28_002_000 picoseconds.
Weight::from_parts(28_184_000, 3676)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
pub(crate) fn clear_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_614_000 picoseconds.
Weight::from_parts(2_688_000, 0)
// Minimum execution time: 2_520_000 picoseconds.
Weight::from_parts(2_617_000, 0)
}
pub(crate) fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_551_000 picoseconds.
Weight::from_parts(2_656_000, 0)
// Minimum execution time: 2_506_000 picoseconds.
Weight::from_parts(2_560_000, 0)
}
pub(crate) fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_597_000 picoseconds.
Weight::from_parts(2_708_000, 0)
// Minimum execution time: 2_503_000 picoseconds.
Weight::from_parts(2_605_000, 0)
}
pub(crate) fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_610_000 picoseconds.
Weight::from_parts(2_758_000, 0)
// Minimum execution time: 2_511_000 picoseconds.
Weight::from_parts(2_597_000, 0)
}
pub(crate) fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_766_000 picoseconds.
Weight::from_parts(3_372_000, 0)
// Minimum execution time: 2_617_000 picoseconds.
Weight::from_parts(2_715_000, 0)
}
}
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 @@ -2299,6 +2299,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