Closed joepetrowski closed 1 month ago
With https://kusama.subsquare.io/referenda/258 and https://polkadot.subsquare.io/referenda/122 we now have (k)DOT
on Kusama AssetHub and (p)KSM
on Polkadot AssetHub, both of which are marked as sufficient
on their respective side. Meaning that fees and execution can be bought on either side with both DOT
and KSM
.
So we no longer need to manage (and periodically balance) these sovereign accounts of AHs on each respective side.
But, I believe we still need to use asset conversion (i.e. pKSM <> DOT
and kDOT <> KSM
pools) to figure out "the exchange rate" at which to spend non-native asset for buying execution on remote chain.
E.g.: Alice transfers 10 DOT from PAH
(Polkadot AssetHub) to KAH
(Kusama AssetHub) - and specifies that she wants to pay fees from transferred DOT - so Alice pays:
tx_fee
on PAH
X weight
for execution of ExportMessage
on PBH
(Polkadot BridgeHub) - X weight
on Polkadot -> 1 DOT
(we have hardcoded exchange rate between weight and DOT on Polkadot)Y weight
for XCM execution on target KAH
- Y weight
on Kusama -> ??? DOT
(we know kusama_weight
-> KSM
conversion, but we don't know how much DOT
to charge)So, my guess is we'd use AssetConversion
for #3
, but don't know how/if we can hook that up to weight->asset calculator to make it "just work" for everyone.
I think ultimately we will need https://github.com/paritytech/polkadot-sdk/issues/606 to make that work. Asset Conversion can publish recent rates of selected assets (e.g. KSM, USDT, ETH, etc.) and the Bridge Hub could subscribe to those.
This is all concerning target AssetHub, not BridgeHub.
I spoke to @bkontur and have more detail/context on what happens at target AH:
On AssetHub
s we configure new XCM Trader which uses this multiplier to convert weight
->asset_amount
based on the asset's Existential Deposit.
I guess this is ok(ish):
weight
--static-foreign-asset-ED-based-ratio
--> foreign-asset
but it'd be better if we could use AssetConversion
here to do:
weight
--static-native-asset-ED-based-ratio
--> native-asset
--dynamic-pool-ratio
--> foreign-asset
,that way, all weight "costs" the same in native token, regardless of what is used to pay.
I think ultimately we will need https://github.com/paritytech/polkadot-sdk/issues/606 to make that work. Asset Conversion can publish recent rates of selected assets (e.g. KSM, USDT, ETH, etc.) and the Bridge Hub could subscribe to those.
Right now, we don't charge anything on target BH so we don't need this, but yes, we would use it if we start charging (possibly XCM HRMP delivery fee to target AH).
Ok, so we have https://github.com/paritytech/polkadot-sdk/issues/105 exactly for what I described above.
I guess we can close this issue then. 👍
close on behalf of https://github.com/paritytech/polkadot-sdk/issues/105
At least initially, we expect the Polkadot<>Kusama bridge to maintain some assets on each side with which to buy execution. For example, we'd expect the Kusama Asset Hub (AH) to have some DOT in its sovereign account on Polkadot's AH, and then charge users extra KSM for transacting on Kusama's AH over the bridge to Polkadot's AH, where the XCM program would withdraw some DOT from its sovereign account to pay for execution locally.
This has some flaws, like ensuring that the correct additional amount is withdrawn on the Kusama side, and that it will be sufficient given the current weight-to-fee rate on Polkadot's AH, and the fact that this account would need to be occasionally topped up via governance.
By using asset conversion, the bridge could buy execution (accurately) in any asset it sends over, provided there is a pool for it (e.g. a pKSM <> DOT pair).