Skip to content

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

Merged
acatangiu merged 8 commits into
masterfrom
bko-xcm-codec-tests
Apr 23, 2024
Merged

Ensure outbound XCMs are decodable with limits + add EnsureDecodableXcm router (for testing purposes)#4186
acatangiu merged 8 commits into
masterfrom
bko-xcm-codec-tests

Conversation

@bkontur

@bkontur bkontur commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

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-no-crate-publish-required The change does not require any crates to be re-published. T6-XCM This PR/Issue is related to XCM. labels Apr 18, 2024
Comment thread polkadot/xcm/xcm-builder/src/routing.rs Outdated
Comment thread cumulus/pallets/xcmp-queue/src/lib.rs Outdated
Comment thread polkadot/xcm/xcm-builder/src/routing.rs
Comment thread polkadot/xcm/xcm-builder/src/routing.rs Outdated
@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
@bkontur bkontur force-pushed the bko-xcm-codec-tests branch from fe80e39 to f7e94f4 Compare April 22, 2024 07:15
@bkontur bkontur marked this pull request as ready for review April 22, 2024 09:13
@bkontur bkontur self-assigned this Apr 22, 2024
);
let sender_account_balance_before = T::TransactAsset::balance(&sender_account);

// generate holding and add possible required fees

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

Choose a reason for hiding this comment

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

😄

Copy link
Copy Markdown
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
Comment thread polkadot/xcm/xcm-builder/src/routing.rs Outdated
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published. T6-XCM This PR/Issue is related to XCM.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants