-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with InitiateTransfer and UnpaidExecution (#7423)
Fix issue where setting the `remote_fees` field of `InitiateTransfer` to `None` could lead to unintended bypassing of fees in certain conditions. Changes made to fix this: - `remote_fees: None` now results in the `UnpaidExecution` instruction being appended *after* the origin altering instruction, be it `AliasOrigin` or `ClearOrigin`. This means `preserve_origin: true` must be set if you want to have any chance of not paying for fees. - The `AliasOrigin` instruction is not appended if the executor is called with the root location (`Here`) since it would alias to itself. Although this self-aliasing could be done, it needs the ecosystem to add a new aliasing instruction, so we just skip it. - Tweaked the `AllowExplicitUnpaidExecutionFrom` barrier to allow receiving assets (via teleport or reserve asset transfer) and altering the origin before actually using `UnpaidExecution`. This is to allow unpaid teleports to work with `InitiateTransfer`. - For this, the barrier now executes origin altering instructions and keeps track of the modified origin. It then checks if this final origin has enough permissions to not pay for fees. In order to follow the `AliasOrigin` instruction it now takes a new generic `Aliasers` that should be set to the XCM config item of the same name. This new generic has a default value of `()`, effectively disallowing the use of `AliasOrigin`. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Adrian Catangiu <[email protected]>
- Loading branch information
1 parent
1ac2e96
commit c4b4145
Showing
8 changed files
with
652 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.