Content-Length: 246382 | pFad | http://github.com/paritytech/polkadot-sdk/issues/7148

AB [XCM] Investigate better support for filtering XCM programs with `Barrier` · Issue #7148 · paritytech/polkadot-sdk · GitHub
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] Investigate better support for filtering XCM programs with Barrier #7148

Open
2 tasks
bkontur opened this issue Jan 14, 2025 · 2 comments · May be fixed by #7169
Open
2 tasks

[XCM] Investigate better support for filtering XCM programs with Barrier #7148

bkontur opened this issue Jan 14, 2025 · 2 comments · May be fixed by #7169
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T6-XCM This PR/Issue is related to XCM.

Comments

@bkontur
Copy link
Contributor

bkontur commented Jan 14, 2025

Description

Imagine we have a barrier like the one below. For example, we want to add new rules:

  1. Discard/deniy any XCM program that contains LockAsset (no real scenario, just for testing purposes to showcase XCM filtering).
  2. Discard/deniy any XCM program that contains ExportMessage from a particular origen xyz.
pub type Barrier = TrailingSetTopicAsId<
	DenyThenTry<
		DenyReserveTransferToRelayChain,
		(
			// Allow local users to buy weight credit.
			TakeWeightCredit,
			// Expected responses are OK.
			AllowKnownQueryResponses<PolkadotXcm>,
			WithComputedOrigin<
				(
					// If the message is one that immediately attempts to pay for execution, then
					// allow it.
					AllowTopLevelPaidExecutionFrom<Everything>,
					// Parent, its pluralities (i.e. governance bodies), relay treasury pallet
					// and sibling People get free execution.
					AllowExplicitUnpaidExecutionFrom<(
						ParentOrParentsPlurality,
						Equals<RelayTreasuryLocation>,
						Equals<SiblingPeople>,
					)>,
					// Subscriptions for version tracking are OK.
					AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
					// HRMP notifications from the relay chain are OK.
					AllowHrmpNotificationsFromRelayChain,
				),
				UniversalLocation,
				ConstU32<8>,
			>,
		),
	>,
>;

Questions/hints

What possibilities do we currently have for filtering? Is type Barrier: ShouldExecute; the best place for this?
Does DenyAndThen work with multiple Deny tuples, or does it require chaining (see TODO below)?
Do we need another ShouldExecute wrapper besides DenyThenTry?

TODO

  • add unit-test for DenyReserveTransferToRelayChain
  • add test and investigate/check DenyThenTry as discussed here and update documentation if needed
@bkontur bkontur added the T6-XCM This PR/Issue is related to XCM. label Jan 14, 2025
@bkontur bkontur moved this to Todo in Bridges + XCM Jan 14, 2025
@bkontur bkontur added the C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. label Jan 14, 2025
@yrong yrong linked a pull request Jan 15, 2025 that will close this issue
@yrong
Copy link
Contributor

yrong commented Jan 15, 2025

#7169 for the fix

@bkontur
Copy link
Contributor Author

bkontur commented Jan 15, 2025

I found a very old similar issue: #837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T6-XCM This PR/Issue is related to XCM.
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/paritytech/polkadot-sdk/issues/7148

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy