Skip to content
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

Initial POCs improving snowbridge #5212

Closed
yrong opened this issue Aug 2, 2024 · 0 comments
Closed

Initial POCs improving snowbridge #5212

yrong opened this issue Aug 2, 2024 · 0 comments

Comments

@yrong
Copy link
Contributor

yrong commented Aug 2, 2024

Context

Currently For transfer from AH to Ethereum, the bridge/export fee is configured in BridgeTable as EthereumBaseFee which will cover the execution cost on Ethreum, it will be charged from end user on AH directly.

It's problematic as the fee is volatile(e.g. affected by gas_price, exchange_rate) and can't be a runtime configuration.

Another issue is that by default we depend on SovereignPaidRemoteExporter routing the message to Ethreum through BH, internally it will WithdrawAsset from the Parachain sovereign and use that to BuyExecution on BH, means it requires an extra process to top-up the sov which is tedious.

Solution

For the first issue we need to move the execution cost on Ethreum out from the EthereumBaseFee and make it an user input which can be estimated by some runtime api. As Adrian suggested here, we can build custom XCM programs paying fees in various assets as we want and execute it using pallet_xcm::execute directly.

For the second issue we'd like to custom an Exporter which burns the fee from the user on AH and teleports to BH to pay fees, and we want to DescendOrigin to user which is required for the upcoming Transact feature.

Challenge

The challenge here is how to make sure the fee is burnt on AH reliably and how to stopping anyone from descending to any origin. There are limitations in current implementation of xcm as follows:

  • The SendXcm trait doesnt really have access to the source origin.

  • The FeeReason enum doesnt really have access to the destination.

we explore with 2 options and make a POC for each as follows:

@yrong yrong changed the title Initial thought improving snowbridge Initial POCs improving snowbridge Aug 2, 2024
@yrong yrong closed this as completed Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant