Add AllowTransferAndSwap
Filter for pallet_xcm
#2789
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As parachains we want to allow sending of XCMs that combine various transfer and swap instructions. The most flexible way of doing this is allowing
pallet_xcm::execute
for some subset of instructions. We have thus written anXcmExecuteFilter
that allows some instructions (ClearOrigin | SetFeesMode | BuyExecution | ExchangeAsset | WithdrawAsset | TransferAsset | DepositAsset | ExpectAsset | InitiateReserveWithdraw | DepositReserveAsset | TransferReserveAsset
) we consider necessary for the functionality but hard to exploit.The filter further limits the amount of instructions and the maximum recursion depth to allow for deterministic weight of the filter itself.
We hope to establish this filter as a default so UIs can send XCMs to
pallet_xcm
for any parachain (that usespallet_xcm
and this filter).Developed with @dmoka and @jak-pan for HydraDX.
We've been running the filter in production on Basilisk for a while.
See here for the original PR.