-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add missing XCM benchmarks for ReserveAssetDeposited #4923
Add missing XCM benchmarks for ReserveAssetDeposited #4923
Conversation
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs |
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs |
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs |
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
|
…kckyeung/xcm-benchmark-reserve-asset-deposited
…-- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs |
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
|
…kckyeung/xcm-benchmark-reserve-asset-deposited
…-- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs |
This reverts commit c748a05.
Shucks, the problem here is obvious -- Westend doesn't regard Westmint as a proper reserve location for WND! |
@@ -1547,13 +1547,18 @@ sp_api::impl_runtime_apis! { | |||
Westmint::get(), | |||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WndLocation::get()) }, | |||
)); | |||
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = Some(( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either indentation is wrong or gh is showing it wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GH does that a lot, the greyer areas all have messed up formatting because it apparently has a different tab size than the black areas.
@@ -1,4 +1,4 @@ | |||
// Copyright 2017-2021 Parity Technologies (UK) Ltd. | |||
// Copyright 2021 Parity Technologies (UK) Ltd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright 2021 Parity Technologies (UK) Ltd. | |
// Copyright 2022 Parity Technologies (UK) Ltd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like file_header.txt
needs to be changed as well.
let (trusted_reserve, transferable_reserve_asset) = T::TrustedReserve::get() | ||
.ok_or(BenchmarkError::Skip)?; | ||
|
||
let assets: MultiAssets = vec![ transferable_reserve_asset ].into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to refresh my memory on this as it was a while ago since I last looked at it: XCM benchmarks are all per-asset right? and then later on, elsewhere we sum all the weights per asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure what you mean by that, but this transferable_reserve_asset
is provided by configuration, and so if the chain maintainer wants to benchmark different assets, they'll have to specify it via the TrustedReserve
associated type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.saturating_add(T::DbWeight::get().reads(7 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(5 as Weight)) | ||
} | ||
// Storage: Benchmark Override (r:0 w:0) | ||
pub(crate) fn reserve_asset_deposited() -> Weight { | ||
(2_000_000_000_000 as Weight) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume will be replaced at some point by bench-bot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, because Westmint doesn't have a configured reserve location, so it can't be benched, and as such, any incoming ReserveAssetDeposited
should have a high cost as it can't really be executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
/benchmark xcm westend pallet_xcm_benchmarks::fungible |
Benchmark Westend XCM for branch "kckyeung/xcm-benchmark-reserve-asset-deposited" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
|
…kckyeung/xcm-benchmark-reserve-asset-deposited
…-- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs
bot merge |
Waiting for commit status. |
This PR adds the missing weights and benchmark code for the
ReserveAssetDeposited
XCM instruction.Aims to fix #4915.