Skip to content

DNM: PoC for SwapAssetAdapter to use hold and release pattern#9657

Closed
athei wants to merge 1 commit intoat/tx_paymentfrom
at/tx_payment2
Closed

DNM: PoC for SwapAssetAdapter to use hold and release pattern#9657
athei wants to merge 1 commit intoat/tx_paymentfrom
at/tx_payment2

Conversation

@athei
Copy link
Copy Markdown
Member

@athei athei commented Sep 5, 2025

We don't want to merge it yet. Just to show how it will work and that it passes all tests. Building on #9590

For accounts that only hold a sufficient asset but no native balance we need to get creative: We increase the pre dispatch fee by the ed. This is because even when increasing the providers of an account, dusting will still happen when an account is below ed. Hence we need to make sure that in addition to the actual fee there is at least the ed inside the hold. Pallet's wont touch the ed as long as they use KeepAlive when transferring from the hold.

@athei athei requested a review from a team as a code owner September 5, 2025 10:54
@athei athei changed the base branch from master to at/tx_payment September 5, 2025 10:54
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/17491163502
Failed job name: test-linux-stable-no-try-runtime

@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/17491163502
Failed job name: test-linux-stable

@acatangiu acatangiu added the T17-primitives Changes to primitives that are not covered by any other label. label Sep 5, 2025
@acatangiu
Copy link
Copy Markdown
Contributor

Didn't review the implementation, but all tests are passing so we know it works! 👍

@athei
Copy link
Copy Markdown
Member Author

athei commented Sep 8, 2025

Yeah it works in general. It is more of a soft failure: Transactions might pre-charge an additional ed. But on parachains this is very cheap. So hopefully not an issue in practice. Talking about additional cents you need in your wallet to send a tx.

@athei
Copy link
Copy Markdown
Member Author

athei commented Sep 22, 2025

The hold and release pattern didn't work out. We switched to a simpler model not requiring holds: #9780

@athei athei closed this Sep 22, 2025
@athei athei deleted the at/tx_payment2 branch October 3, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T17-primitives Changes to primitives that are not covered by any other label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants