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

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

Merged
merged 14 commits into from
Oct 17, 2023

Conversation

bkontur
Copy link
Contributor

@bkontur bkontur commented Oct 11, 2023

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.

@paritytech-ci paritytech-ci requested review from a team October 11, 2023 12:07
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

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

LGTM!

@serban300
Copy link
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
Copy link
Contributor

@serban300 serban300 left a comment

Choose a reason for hiding this comment

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

Looks good !

polkadot/xcm/xcm-builder/src/filter_asset_location.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@franciscoaguirre franciscoaguirre left a comment

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

polkadot/xcm/xcm-builder/src/universal_exports.rs Outdated Show resolved Hide resolved
@bkontur bkontur enabled auto-merge (squash) October 17, 2023 07:28
@acatangiu
Copy link
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
117 checks passed
@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.

6 participants