paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.8k stars 652 forks source link

xcm-executor: validate destinations for ReserveWithdraw and Teleport transfers #5660

Closed acatangiu closed 3 days ago

acatangiu commented 2 weeks ago

This change adds the required validation for stronger UX guarantees when using InitiateReserveWithdraw or InitiateTeleport XCM instructions. Execution of the instructions will fail if the local chain is not configured to trust the "destination" or "reserve" chain as a reserve/trusted-teleporter for the provided "assets".

With this change, misuse of InitiateReserveWithdraw/InitiateTeleport fails on origin with no overall side-effects, rather than failing on destination (with side-effects to origin's assets issuance).

The commit also makes the same validations for pallet-xcm transfers, and adds regression tests.

paritytech-cmd-bot-polkadot-sdk[bot] commented 3 days ago

Created backport PR for stable2407:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-5660-to-stable2407
git worktree add --checkout .worktree/backport-5660-to-stable2407 backport-5660-to-stable2407
cd .worktree/backport-5660-to-stable2407
git reset --hard HEAD^
git cherry-pick -x b5ac7a9d59298eddcd0b6e9470afed7cc9e403d4
git push --force-with-lease
paritytech-cmd-bot-polkadot-sdk[bot] commented 3 days ago

Successfully created backport PR for stable2409: