You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
* 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]>
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 thexcm_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 theAssetImpl
value from any givenMultiAsset::id
value. We will also need to iterate over all variants of this type. Finally we'll need to be able to create aMultiAsset
value for each variant.So types which normally implement
TransactAsset
could also conventionally implement a new, sibling traitBenchmarkTransactAsset
. 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 aBenchmarkTransactAsset
impl.These benchmarking functions could then be conventionally used for implementing the asset instructions of
XcmWeightInfo
.The text was updated successfully, but these errors were encountered: