Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCM: Create general asset weight weighing framework #736

Open
Tracked by #925
gavofyork opened this issue Jan 16, 2023 · 0 comments
Open
Tracked by #925

XCM: Create general asset weight weighing framework #736

gavofyork opened this issue Jan 16, 2023 · 0 comments
Labels
T6-XCM This PR/Issue is related to XCM.

Comments

@gavofyork
Copy link
Member

Right now the (multi-)asset weighing code is very boilerplatey - it's complex and must be duplicated and customised for all chains which provide asset operations over XCM. Ideally, the asset operation benchmarks (i.e. the set of functions able to implement XcmWeightInfo<RuntimeCall>::withdraw_asset, ::reserve_asset_deposited &c.) should be wholly constructible from the xcm_executor::Config::AssetTransactor type definition.

To do this, we'll need to be able to build an enum AssetImpl of all different implementations of an XCM asset. We will need to able to identify the AssetImpl value from any given MultiAsset::id value. We will also need to iterate over all variants of this type. Finally we'll need to be able to create a MultiAsset value for each variant.

So types which normally implement TransactAsset could also conventionally implement a new, sibling trait BenchmarkTransactAsset. This would provide the above facilities. This trait could have default-implemented functions where the general benchmarking implementation is actually contained. Alternatively it could be contained in a struct which is generic over a BenchmarkTransactAsset impl.

These benchmarking functions could then be conventionally used for implementing the asset instructions of XcmWeightInfo.

@gavofyork gavofyork mentioned this issue Jan 16, 2023
30 tasks
@KiChjang KiChjang added the T6-XCM This PR/Issue is related to XCM. label Mar 4, 2023
@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
claravanstaden pushed a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
bkchr pushed a commit that referenced this issue Apr 10, 2024
* how-to-integrate-message-lane-module

* added README stub for bridge-runtime-common

* added README stub for pallet-bridge-call-dispatch

* bridge-runtime-common documentation

* call dispatch module documentation

* some fixes

* more fixes

* more fixes

* more fixes

* more fixes for runtime-common/README.md

* more fixes in call-dispatch/README.md

* more fixes in call-dispatch/README.md

* more fixes in call-dispatch/README.md

* more fixes in message-lane/README.md

* more fixes in message-lane/README.md

* Wrap most text at 100 characters

* Clean up some of the formatting

* Fix broken link

* Stop running CI for README changes

* Don't run any CI steps on documentation changes

Co-authored-by: Hernando Castano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

No branches or pull requests

2 participants