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

Add missing XCM benchmarks for ReserveAssetDeposited #4923

Merged

Conversation

KiChjang
Copy link
Contributor

@KiChjang KiChjang commented Feb 15, 2022

This PR adds the missing weights and benchmark code for the ReserveAssetDeposited XCM instruction.

Aims to fix #4915.

@KiChjang KiChjang added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Feb 15, 2022
@KiChjang
Copy link
Contributor Author

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 15, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-02-15 06:44:00 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-02-15 06:44:00 Took active validators from set with wrong size    
2022-02-15 06:44:00 Took active validators from set with wrong size.    
2022-02-15 06:44:00 Took active validators from set with wrong size    
2022-02-15 06:44:01 WARNING: benchmark error overrided - reserve_asset_deposited    
Error: 
   0: �[91mInvalid input: An overflow would occur�[0m

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

@KiChjang
Copy link
Contributor Author

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 15, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-02-15 07:45:54 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-02-15 07:45:54 Took active validators from set with wrong size    
2022-02-15 07:45:54 Took active validators from set with wrong size.    
2022-02-15 07:45:54 Took active validators from set with wrong size    
2022-02-15 07:45:55 WARNING: benchmark error overrided - reserve_asset_deposited    
Error: 
   0: �[91mInvalid input: An overflow would occur�[0m

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

@KiChjang
Copy link
Contributor Author

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 16, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-02-16 03:04:29 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-02-16 03:04:29 Took active validators from set with wrong size    
2022-02-16 03:04:29 Took active validators from set with wrong size.    
2022-02-16 03:04:29 Took active validators from set with wrong size    
2022-02-16 03:04:30 WARNING: benchmark error overrided - reserve_asset_deposited    
Error: 
   0: �[91mInvalid input: An overflow would occur�[0m

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

@KiChjang
Copy link
Contributor Author

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 16, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "withdraw_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.71
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.71
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "transfer_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    32.19
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    32.19
              µs

Reads = 2
Writes = 2

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "transfer_reserve_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    48.86
              µs

Reads = 7
Writes = 5

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    48.86
              µs

Reads = 7
Writes = 5

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "reserve_asset_deposited", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Benchmark Override (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=  2000000
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=  2000000
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "receive_teleported_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.95
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.95
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "deposit_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.63
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.63
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "deposit_reserve_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    39.82
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    39.82
              µs

Reads = 6
Writes = 4

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "initiate_teleport", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     40.6
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     40.6
              µs

Reads = 6
Writes = 4


Parity Bot and others added 3 commits February 16, 2022 03:56
…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
@KiChjang
Copy link
Contributor Author

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 16, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-02-16 05:23:46 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-02-16 05:23:46 Took active validators from set with wrong size    
2022-02-16 05:23:46 Took active validators from set with wrong size.    
2022-02-16 05:23:46 Took active validators from set with wrong size    
2022-02-16 05:23:47 WARNING: benchmark error overrided - reserve_asset_deposited    
2022-02-16 05:23:47 WARNING: benchmark error overrided - reserve_asset_deposited    
Error: 
   0: �[91mInvalid input: An overflow would occur�[0m

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

@KiChjang
Copy link
Contributor Author

KiChjang commented Mar 2, 2022

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Mar 2, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "withdraw_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.34
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.34
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "transfer_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    34.79
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    34.79
              µs

Reads = 2
Writes = 2

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "transfer_reserve_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    54.39
              µs

Reads = 7
Writes = 5

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    54.39
              µs

Reads = 7
Writes = 5

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "reserve_asset_deposited", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Benchmark Override (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=  2000000
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=  2000000
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "receive_teleported_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.02
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.02
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "deposit_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    23.56
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    23.56
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "deposit_reserve_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    43.83
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    43.83
              µs

Reads = 6
Writes = 4

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "initiate_teleport", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    43.56
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    43.56
              µs

Reads = 6
Writes = 4


…kckyeung/xcm-benchmark-reserve-asset-deposited
Parity Bot and others added 4 commits March 3, 2022 00:29
…-- 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
@KiChjang
Copy link
Contributor Author

KiChjang commented Mar 3, 2022

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Mar 3, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-03-03 01:36:00 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-03-03 01:36:00 Took active validators from set with wrong size    
2022-03-03 01:36:00 Took active validators from set with wrong size.    
2022-03-03 01:36:00 Took active validators from set with wrong size    
2022-03-03 01:36:01 panicked at 'called `Result::unwrap()` on an `Err` value: ExecutorError { index: 0, xcm_error: UntrustedReserveLocation, weight: 0 }', /home/benchbot/bench-bot/git/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs:120:31    
Error: 
   0: �[91mInvalid input: Error executing and verifying runtime benchmark: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
      WASM backtrace:

          0: 0x360c - <unknown>!rust_begin_unwind
          1: 0x335d - <unknown>!core::panicking::panic_fmt::h633e90478f775536
          2: 0x2f69 - <unknown>!core::result::unwrap_failed::h0c0e604c8197d044
          3: 0x3c7f75 - <unknown>!core::ops::function::FnOnce::call_once{{vtable.shim}}::hd6c7cdee995672bc
          4: 0x3aaf2d - <unknown>!pallet_xcm_benchmarks::fungible::benchmarking::<impl frame_benchmarking::utils::Benchmarking for pallet_xcm_benchmarks::fungible::pallet::Pallet<T,I>>::run_benchmark::ha3f648a92f4fb25f
          5: 0x3741a4 - <unknown>!<westend_runtime::Runtime as frame_benchmarking::utils::runtime_decl_for_Benchmark::Benchmark<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<sp_runtime::multiaddress::MultiAddress<<<sp_runtime::MultiSignature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId,()>,westend_runtime::Call,sp_runtime::MultiSignature,(frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<westend_runtime::Runtime>,frame_system::extensions::check_spec_version::CheckSpecVersion<westend_runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<westend_runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<westend_runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<westend_runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<westend_runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<westend_runtime::Runtime>,pallet_transaction_payment::ChargeTransactionPayment<westend_runtime::Runtime>)>>>>::dispatch_benchmark::h840c97a038fbfa86
          6: 0x43313f - <unknown>!Benchmark_dispatch_benchmark
   0: �[0m

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

@KiChjang
Copy link
Contributor Author

KiChjang commented Mar 3, 2022

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((
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2022-03-03 at 09 36 11

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright 2021 Parity Technologies (UK) Ltd.
// Copyright 2022 Parity Technologies (UK) Ltd.

Copy link
Contributor Author

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();
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@kianenigma kianenigma left a 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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Member

@shawntabrizi shawntabrizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@KiChjang
Copy link
Contributor Author

KiChjang commented Mar 8, 2022

/benchmark xcm westend pallet_xcm_benchmarks::fungible

@parity-benchapp
Copy link

parity-benchapp bot commented Mar 8, 2022

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)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "withdraw_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     20.3
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     20.3
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "transfer_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    32.19
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    32.19
              µs

Reads = 2
Writes = 2

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "transfer_reserve_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    50.73
              µs

Reads = 7
Writes = 5

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    50.73
              µs

Reads = 7
Writes = 5

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "reserve_asset_deposited", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Benchmark Override (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=  2000000
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=  2000000
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "receive_teleported_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.62
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.62
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "deposit_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.43
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.43
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "deposit_reserve_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.76
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.76
              µs

Reads = 6
Writes = 4

Pallet: "pallet_xcm_benchmarks::fungible", Extrinsic: "initiate_teleport", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     41.2
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     41.2
              µs

Reads = 6
Writes = 4


Parity Bot and others added 3 commits March 8, 2022 01:50
…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
@KiChjang
Copy link
Contributor Author

KiChjang commented Mar 8, 2022

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot paritytech-processbot bot merged commit 2c14500 into master Mar 8, 2022
@paritytech-processbot paritytech-processbot bot deleted the kckyeung/xcm-benchmark-reserve-asset-deposited branch March 8, 2022 05:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reserveTransferAssets does not work in Westend 0.9.16
3 participants