-
Notifications
You must be signed in to change notification settings - Fork 710
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
Make bridge fees as params of reserve_transfer_assets
#3931
Comments
IIUC you would like to add extra fee parameters to For better understanding of the request, can you provide an example end-to-end use case and explain the missing pieces/current limitations? Ideally please provide a proposal for this new extrinsic function signature, what are these new fees params, who calculates them to pass into pallet-xcm, and how is pallet-xcm supposed to use them to fix/support the described e2e use-case. From the high-level understanding I have now, I believe we will not need new fee params once we have #690 and #3434. This way you can charge fees along the way from this new |
Thanks for the information above and good to know that. I'm not keen on adding a bridge-specific extrinsic, actually in this PR I attempted to just reuse the current The main concern is to not force the user to have |
I still think you should clearly explain here your e2e use-case and limitations encountered. You've referenced some PRs where you tried some solutions, but expecting others to understand the problem by auditing Snowbridge code will yield very little success :) |
Sure, let me try to be more specific. Just as #3847 (comment) describes the ideal extrinsic signature is:
In my case param I realize my previous PR is not ideal or even correct, it will cause distraction so please just ignore it. Meanwhile, I added a new PR here Snowfork#135 which follows the pattern above. This PR is only for demonstration and internal discussion. I don't want to pollute existing codes so add a separate extrinsic only for the Ethereum bridge, there are very few snowbridge specific codes involved so hope it's easy to understand now. The e2e test is:
@acatangiu Let me know if anything more I can provide. |
Thank you! This clears it up significantly 👍 So what we really need is a way to be able to use different assets as fees for different hops along the way. I am seeing similar issue when thinking about more complex transfers over the P<>K bridge. The problem is we can't (or shouldn't) add dedicated extrinsics to I will think about a more generic solution to both our problems. |
@acatangiu Hey Adrian, any update here? Seems the runtime api query_delivery_fees is already merged, which can be leverged to estimate the delivery cost for the export xcm to remote network like Ethereum. So based on that is the next step to remove the remote portion from the runtime config BridgeHubEthereumBaseFee and make it an user input for the reserve_transfer_assets? Please let me know WDYT and anything I can help. |
Hey Ron, sorry for the delay in answering here. The best way to achieve this and many other scenarios using a scalable solution is to use I've also opened #4736 to create a tool for easier building of these complex/custom asset transfer scenarios. In the meantime, once runtimes https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.8 are live, they will include:
So you can have the Snowbridge UI build custom XCM programs paying fees in various assets at each hop and directly execute it using Or you can use pallet_xcm::transfer_assets_using_type_and_then() (see emulated tests for examples) to initiate transfer to the first hop, while specifying using XCM what happens further. |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
Context
Currently, the bridge/export fee is configured in
BridgeTable
aspolkadot-sdk/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs
Lines 867 to 870 in 52e1037
As Snowbridge is delivering more bridge features(e.g. transfer native token like DOT to Ethereum, transfer WETH back to Ethereum, Call Arbitrary Transact on Ethereum, etc...) each has a different cost, it does not make sense to be a runtime configuration anymore. Instead, we'd like the fees to be params of the extrinsic
reserve_transfer_assets
.Another issue is that it's the total cost including the cost of the two hops execution on BridgeHub and on Ethereum. We'd like to separate them as two different fees. For the first hop fee in Relay token and the second hop fee in
WETH
.We can provide runtime APIs to calculate fees for each of the hops and it's the prerequisite to remove the exchange-rate on BH which is another runtime configuration difficult to maintain on chain.
Request
reserve_transfer_assets
Solution
There is an attempt for the enhancement in Snowfork#132 which could be problematic. Maybe it's better to add another extrinsic into
pallet-xcm
specific for this case as the fee modal here is somehow different from the current implementation.Meanwhile, notice Parity team is also trying to improve the xcm fee, potential relevant issues/pull requests including:
#3847
#690
#3434
#3872
We'd suggest taking the use case here into consideration as well.
No response
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: