[Enhancement] Use XCM V3 for initiate_teleport weight calc#2102
[Enhancement] Use XCM V3 for initiate_teleport weight calc#2102paritytech-processbot[bot] merged 9 commits intomasterfrom
Conversation
| Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), | ||
| Self::Wild(asset) => match asset { | ||
| All => weight.saturating_mul(MAX_ASSETS as u64), | ||
| AllOf { .. } => weight, |
There was a problem hiding this comment.
I'm actually still uncertain about this -- comments on AllOfCounted says that each individual instance of an NFT is considered a different class of asset, and so wouldn't it make more sense to use the number of NFT instances as an upper bound here?
There was a problem hiding this comment.
Hmm, good question. Let me check it out and come back to you.
There was a problem hiding this comment.
Yeah, I think this makes sense. I'm not sure though where the NFT instance count should be coming from in this case.
There was a problem hiding this comment.
So this requires you to actually look inside the holding register and determine just how many AssetInstances there are... We could match against fun in AllOf and see if it's a NonFungible, and if so, it would basically be weight * MaxAssetsIntoHolding::get(), otherwise it's just weight.
There was a problem hiding this comment.
@KiChjang One thing that disturbs me a bit is the comment below, should we then do something like weight * MaxAssetsIntoHolding::get() * 2 to be safe?
/// The maximum number of assets we target to have in the Holding Register at any one time.
///
/// NOTE: In the worse case, the Holding Register may contain up to twice as many assets as this
/// and any benchmarks should take that into account.
type MaxAssetsIntoHolding: Get<u32>;|
bot rebase |
|
Rebased |
|
bot merge |
|
Waiting for commit status. |
* [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <>
) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
) (#2239) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
) (#2240) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
) (#2238) * Wwstmint test for ReceiveTeleportedAsset * Missing fix for `weigh_multi_assets` * Added tests for statemine/statemint * [Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102) * [Enhancement] Use XCM V3 for initiate_teleport weight calc * deref * replicate in all the runtimes * fmt * better handling for AllOf * fmt * small type fix * replicate the fix for all runtimes --------- Co-authored-by: parity-processbot <> * removed `frame_support::sp_tracing::try_init_simple();` * Review fixes * Removed `as u64` --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Revert "[Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102)" This reverts commit 8230ec4. * updating weight format * We expect to pay 1bn+ for a teleport at the current weights. * The test isn't needed and hardcoded scale is hand to maintain. * remove unused imports --------- Co-authored-by: Giles Cope <gilescope@gmail.com>
* Revert "[Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102)" This reverts commit 8230ec4. * updating weight format * We expect to pay 1bn+ for a teleport at the current weights. * The test isn't needed and hardcoded scale is hand to maintain. * remove unused imports --------- Co-authored-by: Giles Cope <gilescope@gmail.com>
* Revert "[Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102)" This reverts commit 8230ec4. * updating weight format * We expect to pay 1bn+ for a teleport at the current weights. * The test isn't needed and hardcoded scale is hand to maintain. * remove unused imports --------- Co-authored-by: Giles Cope <gilescope@gmail.com>
…2402) * Revert "[Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102)" This reverts commit 8230ec4. * updating weight format * We expect to pay 1bn+ for a teleport at the current weights. * The test isn't needed and hardcoded scale is hand to maintain. * remove unused imports --------- Co-authored-by: Giles Cope <gilescope@gmail.com>
…2403) * Revert "[Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102)" This reverts commit 8230ec4. * updating weight format * We expect to pay 1bn+ for a teleport at the current weights. * The test isn't needed and hardcoded scale is hand to maintain. * remove unused imports --------- Co-authored-by: Giles Cope <gilescope@gmail.com>
Fixes #1669