-
Notifications
You must be signed in to change notification settings - Fork 828
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
Fix issue with InitiateTransfer and UnpaidExecution #7423
Conversation
/cmd prdoc --audience runtime_dev --bump patch |
/cmd fmt |
…e unpaid execution
/cmd fmt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The executor implementation looks good, just some code factoring comments.
The barrier isn't correct/complete:
- needs to verify against altered origin and not physical origin (unless it relies on other barriers to alter the physical origin to the computed one)
- needs to allow multiple asset transfer instructions before origin alter and unpaid exec instructions
Please also add regression tests for above scenarios ^ before fixing them
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
/cmd fmt |
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]>
All GitHub workflows were cancelled due to failure one of the required jobs. |
/cmd fmt |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7423-to-stable2407
git worktree add --checkout .worktree/backport-7423-to-stable2407 backport-7423-to-stable2407
cd .worktree/backport-7423-to-stable2407
git reset --hard HEAD^
git cherry-pick -x c4b41457ccc7a4a81e8b188dfbc14957cdfc002b
git push --force-with-lease |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7423-to-stable2409
git worktree add --checkout .worktree/backport-7423-to-stable2409 backport-7423-to-stable2409
cd .worktree/backport-7423-to-stable2409
git reset --hard HEAD^
git cherry-pick -x c4b41457ccc7a4a81e8b188dfbc14957cdfc002b
git push --force-with-lease |
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]> (cherry picked from commit c4b4145)
Successfully created backport PR for |
Backport #7423 into `stable2412` from franciscoaguirre. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Francisco Aguirre <[email protected]>
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]>
Fix issue where setting the
remote_fees
field ofInitiateTransfer
toNone
could lead to unintended bypassing of fees in certain conditions.Changes made to fix this:
remote_fees: None
now results in theUnpaidExecution
instruction being appended after the origin altering instruction, be itAliasOrigin
orClearOrigin
. This meanspreserve_origin: true
must be set if you want to have any chance of not paying for fees.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.AllowExplicitUnpaidExecutionFrom
barrier to allow receiving assets (via teleport or reserve asset transfer) and altering the origin before actually usingUnpaidExecution
. This is to allow unpaid teleports to work withInitiateTransfer
.AliasOrigin
instruction it now takes a new genericAliasers
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 ofAliasOrigin
.