Skip to content

Re-visit pallet_xcm benchmarks for teleport_assets / reserve_transfer_assets / transfer_assets #2874

@bkontur

Description

@bkontur

Relates to the: https://github.com/polkadot-fellows/runtimes/issues/231#issue-2178704646

reserve_transfer_assets - https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L997-L1003
teleport_assets - https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L940-L945
transfer_assets - https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L1299-L1308

Is this adding ok? And does not double the actual weights?

T::WeightInfo::reserve_transfer_assets().saturating_add(w)
T::WeightInfo::teleport_assets().saturating_add(w)
T::WeightInfo::transfer_assets().saturating_add(w)

For example for AssetHubRococo for pallet_xcm::reserve_transfer_assets, it adds:

  1. benchamark for transfer_reserve_asset which is configured to transfer to Parent, which covers reserve, send+delivery
    https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs#L73-L97

  2. benchmark for pallet_xcm::reserve_transfer_assets, which is configured for delvering to sibling parachain, which also covers reserve+fee handling, send+delivery
    https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs#L99-L117

Why we adds "reserve+delivery-to-parent" + "reserve+delivery-to-sibling"?

I think we should remove maybe those: .saturating_add(w)

TODO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions