-
Notifications
You must be signed in to change notification settings - Fork 809
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
DepositAsset need failure recover of holding #912
Comments
Ah, I found my testcase missing the Appendix which have RefundSurplus instruction inside. and RefundSurplus will refund asset in total_surplus to holding, then Config::AssetTrap can continue executed. |
Yeah, using Closing this for now, feel free to reopen if you think there's anything more that we need to address here. |
@KiChjang I've add Xcm([
ReserveAssetDeposited(MultiAssets([MultiAsset {
id: Concrete(MultiLocation { parents: 1, interior: X2(Parachain(1), GeneralKey([65])) }), fun: Fungible(500) }])
),
ClearOrigin,
BuyExecution {
fees: MultiAsset { id: Concrete(MultiLocation { parents: 1, interior: X2(Parachain(1), GeneralKey([65])) }), fun: Fungible(500) },
weight_limit: Limited(100)
},
SetAppendix(Xcm([
RefundSurplus
])),
DepositAsset {
assets: Wild(All),
max_assets: 1,
beneficiary: MultiLocation { parents: 0, interior: X1(AccountId32 { network: Any, id: [1111111] }) }
}
]) and the log shows how can I recover the |
Okay, it looks like that all the error messages that |
My instinct is telling me that the best way to handle this is to add a new "recovery register" for cases where XCM execution failed and some assets were taken from holding. Additionally, it may also be a good idea to allow the appendix or the error handler to somehow gain access to these funds and operate upon them. |
Actually, now that I think about it, the |
Closing, as this is the responsibility of the sender to ensure that the recipient handles the asset kind that's being sent over -- the recipient has no way of representing the asset otherwise. |
* wait for foreign asset to be created * rustfmt * safety commit * updated cumulus * upgrade code hash * increase block time * completed test * fixe usings * remove test
Bumps [ripemd](https://github.com/RustCrypto/hashes) from 0.1.1 to 0.1.3. - [Release notes](https://github.com/RustCrypto/hashes/releases) - [Commits](RustCrypto/hashes@ripemd-v0.1.1...ripemd-v0.1.3) --- updated-dependencies: - dependency-name: ripemd dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Current the logic of DepositAsset is first take assets from holding, then do AssetTransactor::deposit_asset(). If deposit_asset() throw Error, for example receiver not recognize token from sender, and for now it has no mechanism of recover holding, thus Config::AssetTrap would't be executed, in this case it'll cause token lossing.
I've test this case in orml: paraA transfer tokenA to paraB, and we let paraB not recognize tokenA temporary which will throw an Error. and in my test result, when execute xcm on paraB side,it will loss tokenA, this's not we wanted.
So maybe we need recover holding data when deposit_asset cause an Error. and this ability may extend to other instructions? cc @gavofyork @KiChjang
The text was updated successfully, but these errors were encountered: