Skip to content

[xcm] Small enhancements for NetworkExportTable and xcm-builder#1848

Merged
bkontur merged 14 commits into
masterfrom
bko-xcm-builder-enhancements
Oct 17, 2023
Merged

[xcm] Small enhancements for NetworkExportTable and xcm-builder#1848
bkontur merged 14 commits into
masterfrom
bko-xcm-builder-enhancements

Conversation

@bkontur

@bkontur bkontur commented Oct 11, 2023

Copy link
Copy Markdown
Contributor

Summary

This PR introduces several enhancements.

The current implementation of NetworkExportTable lacks remote location filtering support beyond NetworkId lookup. To provide more control and granularity, it's essential to allow configuration for bridging to different consensus NetworkId while restricting access e.g. to particular remote parachains.

Additionally, the StartsWith and Equals and StartsWithExplicitGlobalConsensus helper functions, which are in active use, are moved to the xcm-builder and frame_support modules for better code organization.

Adds a new LocationWithAssetFilters filter to enable location-based and asset-related filtering. This filter is useful for configuring the pallet_xcm filter for XcmTeleportFilter and XcmReserveTransferFilter to restrict specific assets.

Furthermore, the BridgeMessage fields are not accessible outside of xcm-builder, limiting the ability to create custom logic dependent on it.

@bkontur bkontur added the T6-XCM This PR/Issue is related to XCM. label Oct 11, 2023
@bkontur bkontur requested a review from a team as a code owner October 11, 2023 11:55
@bkontur bkontur requested a review from serban300 October 11, 2023 11:59
@paritytech-ci paritytech-ci requested review from a team October 11, 2023 12:07

@acatangiu acatangiu left a comment

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.

LGTM!

Comment thread polkadot/xcm/xcm-builder/src/matches_location.rs Outdated
Comment thread polkadot/xcm/xcm-builder/src/matches_location.rs Outdated
@serban300

Copy link
Copy Markdown
Contributor

Thank you for splitting these changes in a separate PR ! They were much easier to review this way.

@bkontur bkontur requested review from a team October 11, 2023 23:31

@serban300 serban300 left a comment

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.

Looks good !

Comment thread polkadot/xcm/xcm-builder/src/filter_asset_location.rs Outdated

@franciscoaguirre franciscoaguirre left a comment

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.

Looks good! Just left some nits

Comment thread polkadot/xcm/xcm-builder/src/universal_exports.rs Outdated
Comment thread polkadot/xcm/xcm-builder/src/universal_exports.rs
@bkontur bkontur enabled auto-merge (squash) October 17, 2023 07:28
@acatangiu

Copy link
Copy Markdown
Contributor

@paritytech/locks-review this small PR is already reviewed by bridges and xcm teams - needs locks-review as a formality just because of some imports changes to AH runtimes

@paritytech-ci paritytech-ci requested a review from a team October 17, 2023 08:57
@bkontur bkontur merged commit 5cdd819 into master Oct 17, 2023
@bkontur bkontur deleted the bko-xcm-builder-enhancements branch October 17, 2023 09:11
tdimitrov pushed a commit that referenced this pull request Oct 23, 2023
…1848)

## Summary

This PR introduces several enhancements.

The current implementation of `NetworkExportTable` lacks remote location
filtering support beyond `NetworkId` lookup. To provide more control and
granularity, it's essential to allow configuration for bridging to
different consensus `NetworkId` while restricting access e.g. to
particular remote parachains.

Additionally, the `StartsWith` and `Equals` and
`StartsWithExplicitGlobalConsensus` helper functions, which are in
active use, are moved to the `xcm-builder` and `frame_support` modules
for better code organization.

Adds a new `LocationWithAssetFilters` filter to enable location-based
and asset-related filtering. This filter is useful for configuring the
`pallet_xcm` filter for
[XcmTeleportFilter](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L212)
and
[XcmReserveTransferFilter](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L216)
to restrict specific assets.

Furthermore, the `BridgeMessage` fields are not accessible outside of
`xcm-builder`, limiting the ability to create custom logic dependent on
it.

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
svyatonik added a commit to svyatonik/runtimes that referenced this pull request Nov 3, 2023
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
…aritytech#1848)

## Summary

This PR introduces several enhancements.

The current implementation of `NetworkExportTable` lacks remote location
filtering support beyond `NetworkId` lookup. To provide more control and
granularity, it's essential to allow configuration for bridging to
different consensus `NetworkId` while restricting access e.g. to
particular remote parachains.

Additionally, the `StartsWith` and `Equals` and
`StartsWithExplicitGlobalConsensus` helper functions, which are in
active use, are moved to the `xcm-builder` and `frame_support` modules
for better code organization.

Adds a new `LocationWithAssetFilters` filter to enable location-based
and asset-related filtering. This filter is useful for configuring the
`pallet_xcm` filter for
[XcmTeleportFilter](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L212)
and
[XcmReserveTransferFilter](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L216)
to restrict specific assets.

Furthermore, the `BridgeMessage` fields are not accessible outside of
`xcm-builder`, limiting the ability to create custom logic dependent on
it.

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T6-XCM This PR/Issue is related to XCM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants