-
Notifications
You must be signed in to change notification settings - Fork 739
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
Snowbridge: deposit extra fee to beneficiary on Asset Hub #4175
Merged
serban300
merged 16 commits into
paritytech:master
from
Snowfork:deposit-fee-to-beneficiary
Apr 26, 2024
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8f86f35
Deposit fee to beneficiary
yrong 0a218c7
E2E tests
yrong 3fd810c
Add SetErrorHandler
yrong db52103
Revert "Add SetErrorHandler"
yrong bf3856b
Merge branch 'master' into deposit-fee-to-beneficiary
yrong 908442b
Add prdoc
yrong 54d8d4e
Merge branch 'master' into deposit-fee-to-beneficiary
yrong dee6ecc
Merge branch 'master' into deposit-fee-to-beneficiary
yrong 76755f9
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
yrong 3eed3aa
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
yrong bd36b4d
Merge branch 'master' into deposit-fee-to-beneficiary
claravanstaden 45481f9
Update prdoc/pr_4175.prdoc
yrong 3c7a66d
Update prdoc/pr_4175.prdoc
yrong 3c1ac1a
Merge branch 'master' into deposit-fee-to-beneficiary
yrong a194ca5
Merge branch 'master' into deposit-fee-to-beneficiary
yrong b79bc16
Merge branch 'master' into deposit-fee-to-beneficiary
yrong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Deposit extra fee to beneficiary on asset hub | ||
yrong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
Deposit both asset and fees to beneficiary so the fees will not get trapped. | ||
yrong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Another benefit is when fees left more than ED, could be used to create the beneficiary account in case it does not exist on asset hub. | ||
|
||
crates: | ||
- name: snowbridge-router-primitives |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could maybe add description before every instruction for
let mut instructions = vec![
:)One question: could you point me to the place or explain where
asset_hub_fee
anddestination.fee
is coming from? Is it withdrawn or burned somewhere on BH? Is it the user's money, or is it money from some sovereign account on BH? Or where does this money come from?I think it can be specific (not sure if compiles):
or maybe use
total_fee_asset(dest_para_fee should be 0 in this branch)
instead ofasset_hub_fee_asset
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to fix also
DepositReserveAsset {
branch?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern here is whether we should deposit unused fees directly to the beneficiary instead of depositing them into a sovereign account in the AH. If this is a valid scenario, then the process should resemble something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asset_hub_fee
from https://github.com/Snowfork/snowbridge/blob/3f90b1619d0bdbec8f50b63185b3dcc632321019/contracts/src/storage/AssetsStorage.sol#L15 which is a configurable storage on Ethereum, we charge it from the user and make sure that it can cover the execution cost on AH.destination.fee
is always zero for AH.I think so, it's from end user and we do want to send the unused back to the user.
Nope, that branch is for non-system parachain which may not accept
AssetHub-DOT
as fee asset, we're gonna to make some fix there later and this PR focus on AH only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, cool, thank you :)
Ok, got it. I saw that you use
Location::parent()
here for fees.assetId, so that would be probably changed and/orDestination.fee: u128
, let's see later.So, I think using exact assets for DepositAsset, as suggested above, is not a bad idea (or maybe some exact counter of unique assetIds :))