paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Pay tx fee with assets by using the asset conversion pallet #14340

Closed jsidorenko closed 1 year ago

jsidorenko commented 1 year ago

Allows to pay for the tx in any assets by swapping it into the native, given the liquidity pool exists

cumulus companion: https://github.com/paritytech/cumulus/pull/2148

xlc commented 1 year ago

We have implemented & deployed this since beginning for Acala so I have a few questions here to make sure you have considered them.

joepetrowski commented 1 year ago
  • How do you benchmark this? How does this effect the base tx weight? How do you ensure the weight is correctly consumed for tx that required conversion vs the one does not require conversion?

This needs to be addressed.

  • How do you ensure someone doesn't accidentally spend all the funds to perform a swap on a pool with no liquidity?

We don't, this is something that wallets and UIs can (and should) handle.

  • How do you handle weight refund?

Look at the PR.

  • Would you handle multi path swap? (because the direct path is not available or low on liquidity or unbalanced)

On Asset Hub we won't need to since everything can only pair with DOT, but this would be a nice addition (and should at least be documented in the README).

jsidorenko commented 1 year ago

bot merge