Ensure outbound XCMs are decodable with limits + add EnsureDecodableXcm router (for testing purposes)#4186
Merged
Merged
Conversation
acatangiu
reviewed
Apr 18, 2024
bkontur
commented
Apr 18, 2024
ggwpez
reviewed
Apr 19, 2024
ggwpez
reviewed
Apr 19, 2024
EnsureDecodableXcm router (for testing purposes) to ensure outbound XCMs are decodableEnsureDecodableXcm router (for testing purposes)
Co-authored-by: Adrian Catangiu <adrian@parity.io>
fe80e39 to
f7e94f4
Compare
This was referenced Apr 22, 2024
franciscoaguirre
approved these changes
Apr 22, 2024
| ); | ||
| let sender_account_balance_before = T::TransactAsset::balance(&sender_account); | ||
|
|
||
| // generate holding and add possible required fees |
Contributor
There was a problem hiding this comment.
Where do you add the possible required fee?
Contributor
Author
There was a problem hiding this comment.
right bellow - required fees = expected_assets_in_holding
for a in expected_assets_in_holding.into_inner() {
holding.push(a);
}
Contributor
Author
There was a problem hiding this comment.
there was just executor.set_holding(expected_assets_in_holding) before, which could possibly remove previously executor.set_holding(holding.clone()
Comment on lines
+53
to
+54
| /// - `depositable_count` specifies the count of assets we plan to add to the holding on top of | ||
| /// those generated by the `worst_case_holding` implementation. |
Contributor
Author
There was a problem hiding this comment.
@franciscoaguirre :), any other suggestion?
acatangiu
reviewed
Apr 22, 2024
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 23, 2024
…uter` (#4236) This PR: - moves `validate_xcm_nesting` from `XcmpQueue` into the `VersionedXcm` - adds `validate_xcm_nesting` to the `ParentAsUmp` - adds `validate_xcm_nesting` to the `ChildParachainRouter` Based on discussion [here](#4186 (comment)) and/or [here](#4186 (comment)) and/or [here]() ## Question/TODO - [x] To the [comment](#4186 (comment)) - Why was `validate_xcm_nesting` added just to the `XcmpQueue` router and nowhere else? What kind of problem `MAX_XCM_DECODE_DEPTH` is solving? (see [comment](#4236 (comment)))
acatangiu
approved these changes
Apr 23, 2024
This was referenced Jun 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
EnsureDecodableXcm(testing) router that attempts to encode and decode passed XCMmessageto ensure that the receiving side will be able to decode, at least with the same XCM version.pallet_xcm/pallet_xcm_benchmarksassets data generationRelates to investigation of https://substrate.stackexchange.com/questions/11288 and missing fix #2129 which did not get into the fellows 1.1.X release.
Questions/TODOs
BoundedVec exceeds its limitFungible asset of zero amount is not allowedsortto theprepend_withas we did for reanchor here? @serban300 (created separate/follow-up PR: [xcm] Assets: sort afterprepend_with#4235)XcmpQueue->validate_xcm_nesting, why not to added to theParentAsUmporChildParachainRouter? @franciscoaguirre (created separate/follow-up PR: Addvalidate_xcm_nestingto theParentAsUmpandChildParachainRouter#4236)SendController::send_blobreplaceVersionedXcm::<()>::decode(withVersionedXcm::<()>::decode_with_depth_limit(MAX_XCM_DECODE_DEPTH, data)?