chore: AH Migration backport for Kintsugi
This PR aims to protect Kintsugi's cross chain transfers from the upcoming AHM. During the migration, the inference of KSM reserves may lead to lost of funds, so we need to deactivate those transfers during the process.
A bit more context about this issue: https://forum.polkadot.network/t/mandatory-action-guide-for-ahm-broken-native-crosschain-transfers/14634
The proposed solution follows the approach of the ORML team implemented here: https://github.com/open-web3-stack/open-runtime-module-library/pull/1033.
The affected extrinsics in Kintsugi are:
-
xtokens-> all extrinsics.xtokensuse aReserveProviderto determine the reserve, so the patch is needed here. -
pallet_xcm-> This old xcm version doesn't automatically infer the reserves, so theoretically it's not affected. However, theReserveProviderdefined onXcmExecutorisn't being taken into account by the extrinsics belonging to this pallet for some reason I couldn't figure out, but probably related to the old xcm version. I'm afraid that they keep using Kusama as the reserve after the migration which will result on a conflict with thextokensreserve (AssetHub). This might end up creating unexpected issues, so for the sake of security I've disabled transferring KSM usingpallet_xcmduring and after the migration. If the codebase is updated in the future to newer xcm versions this block might be removed, in the meanwhile, please usextokensto transfer KSM.
Please note that all other reserves aren't affected by this patch and keep working as usual. The migration status should be changed by calling the xtokens.set_migration_phase extrinsic. This extrinsic is only callable by the root origin on Kintsugi, let us know if you prefer to use a different origin.
As the Interbtc codebase deps are too far in the past, the time doesn't allow to bump everything and bring that change with the ORML crates, so we'll be using an ORML fork from the exact commit used by the Interbtc codebase. The fork is located in the R0gue GitHub organization, concretely here: https://github.com/r0gue-io/open-runtime-module-library/tree/master.
IMPORTANT: While this branch contains the patch for both Interlay and Kintsugi (just for convenience, to allow us compiling the whole workspace), it should only be used on Kintsugi yet. The branch sets off from the 1.25.6 tag, so it's not suitable for an Interlay upgrade. However, backporting the patch should be straightforward.
Note: I'm pushing this branch against the master branch. I'm not aware of Interbtc upgrades policies, so let me know if I should push it against another branch
Changed the base to kintsugi-1.25, which corresponds to 1.25.6 for easier reviewing