-
Notifications
You must be signed in to change notification settings - Fork 378
[Enhancement] Use XCM V3 for initiate_teleport weight calc #2102
[Enhancement] Use XCM V3 for initiate_teleport weight calc #2102
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, good question. Let me check it out and come back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this requires you to actually look inside the holding register and determine just how many AssetInstance
s 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 <[email protected]>
) * 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 <[email protected]>
) * 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 <[email protected]>
) * 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 <[email protected]>
) (#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 <[email protected]> Co-authored-by: Roman Useinov <[email protected]>
) (#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 <[email protected]> Co-authored-by: Roman Useinov <[email protected]>
) (#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 <[email protected]> Co-authored-by: Roman Useinov <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
…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 <[email protected]>
…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 <[email protected]>
Fixes #1669