paritytech / polkadot-sdk

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

snowbridge: improve destination fee handling to avoid trapping fees dust #5563

Closed acatangiu closed 4 days ago

acatangiu commented 3 weeks ago

On messages Ethereum -> Polkadot Asset Hub: whether they are a token transfer or a Transact for registering new token, make sure to handle unspent fees, rather than trapping them.

This PR deposits them to Snowbridge's sovereign account on Asset Hub.

acatangiu commented 3 weeks ago

cc @vgeddes, @alistair-singh, @claravanstaden, @yrong

paritytech-cicd-pr commented 3 weeks ago

The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable 2/3 Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7236477

yrong commented 3 weeks ago

In https://github.com/paritytech/polkadot-sdk/pull/4175 we only cover the trapping on AH, thanks for the fix.

Btw:

cargo test -p bridge-hub-rococo-integration-tests --lib tests::snowbridge::send_token_from_ethereum_to_penpal  -- --nocapture

failed with the error

2024-09-04T05:57:38.016390Z TRACE xcm::execute: Message executed result=Err(ExecutorError { index: 3, xcm_error: FailedToTransactAsset("Account cannot exist with the funds that would be given"), weight: Weight { ref_time: 1000000000, proof_size: 65536 } })

I think we may need to increase the destination_fee on penpal or a lower ED here could also work.

acatangiu commented 3 weeks ago

I think we may need to increase the destination_fee on penpal

Yes, and once this change is deployed you also need to check this in UIs in production, to avoid failures for users.

Check that beneficiary on final dest either:

cc @alistair-singh

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

Created backport PR for stable2407:

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

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

Successfully created backport PR for stable2409: