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

Ensure outbound XCMs are decodable with limits + add EnsureDecodableXcm router (for testing purposes) #4186

Merged
merged 8 commits into from Apr 23, 2024

Conversation

bkontur
Copy link
Contributor

@bkontur bkontur commented Apr 18, 2024

This PR:

  • adds EnsureDecodableXcm (testing) router that attempts to encode and decode passed XCM message to ensure that the receiving side will be able to decode, at least with the same XCM version.
  • fixes pallet_xcm / pallet_xcm_benchmarks assets data generation

Relates 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

@bkontur bkontur requested a review from a team as a code owner April 18, 2024 09:30
@bkontur bkontur added R0-silent Changes should not be mentioned in any release notes T6-XCM This PR/Issue is related to XCM. labels Apr 18, 2024
@bkontur bkontur changed the title Add EnsureDecodableXcm router (for testing purposes) to ensure outbound XCMs are decodable Ensure outbound XCMs are decodable with limits + add EnsureDecodableXcm router (for testing purposes) Apr 19, 2024
@bkontur bkontur marked this pull request as draft April 22, 2024 07:03
@@ -157,15 +155,29 @@ benchmarks_instance_pallet! {
);
let sender_account_balance_before = T::TransactAsset::balance(&sender_account);

// generate holding and add possible required fees
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you add the possible required fee?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right bellow - required fees = expected_assets_in_holding

            for a in expected_assets_in_holding.into_inner() {
				holding.push(a);
			}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franciscoaguirre :), any other suggestion?

github-merge-queue bot pushed a commit that referenced this pull request Apr 22, 2024
Adds sorting to the XCM Assets' `prepend_with`, which could modify the
order of `AssetId` locations.

Relates to: #4186 (the
same fix for `reanchored`)
Part of: #2129
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 acatangiu added this pull request to the merge queue Apr 23, 2024
Merged via the queue into master with commit 118cd6f Apr 23, 2024
137 of 140 checks passed
@acatangiu acatangiu deleted the bko-xcm-codec-tests branch April 23, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants