This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 378
Fixes for gav-xcm-v3 #1835
Merged
Merged
Fixes for gav-xcm-v3 #1835
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
23f0bcd
Fix for FungiblesAdapter - trait changes: Contains -> AssetChecking
bkontur a6dd610
Fix for missing weight for `fn unpaid_execution()`
bkontur 288ba7b
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur 8c08657
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur ccc49d1
Used NonLocalMint for all NonZeroIssuance
bkontur 499316b
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur fa1cddb
Fix
bkontur d9e7673
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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.
@joepetrowski
I am not sure about this change, could you please check it?
there is a change for
FungiblesAdapter
: Contains -> AssetChecking:actual master -
CheckAsset: Contains<Assets::AssetId>,
https://github.com/paritytech/polkadot/blob/master/xcm/xcm-builder/src/fungibles_adapter.rs#L265
new xcm v3 -
CheckAsset: AssetChecking<Assets::AssetId>,
https://github.com/paritytech/polkadot/blob/gav-xcm-v3/xcm/xcm-builder/src/fungibles_adapter.rs#L298
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.
I'm not sure of the motivation to change this interface, but from reviewing its introduction, especially the docs on
MintLocation
, I don't think the logic is correct, that if an asset has some issuance then itsMintLocation
should beLocal
.We could say that the
MintLocation
of bridged/para assets isNonLocal
, however other locations within the network still trust system paras to the extent that they trust Polkadot governance, so would see the asset on Statemint as "equally local".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.
@joepetrowski @KiChjang
here is also some more description: paritytech/polkadot#4097 search for "Reverse Checking" with future issue: https://github.com/paritytech/polkadot/issues/6125
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.
I don't think
NonZeroIssuance
should be changed at all. What looks to me is that it's meant to be used in conjunction withLocalMint
,NonLocalMint
andDualMint
, rather than haveAssetChecking
directly implemented on it.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.
@joepetrowski
ok, next iteration :), I put everywhere
NonLocalMint
,Lets say:
What is the basic use case for Moonbeam to use Statemint?
"Somebody" from Moonbeam should create asset for GLMR at first?
Then MoonbeamUser can transfer GLMR to some StatemintUserAccount? Then some StatemintUserAccount can transfer to other accounts or move something back to the Moonbeam (but not more then he receives), so this means
NonLocalMint
?What would be example for
LocalMint
from the Statemint perspective?You wrote here before:
e.g.: How could I resolve/check that in the code? I am checking structs:
AssetDetails
/AssetAccount
/AssetMetadata
or similar: implementation for
DualMint
, how could we differ/tell that some Asset should beLocalMint
orNonLocalMint
?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.
The
CreateOrigin
should ensure that only Moonbeam itself, i.e. via their Root origin (however it is accessed) could create GLMR. So yeah, they'd need some referendum to send a message to Statemint registering GLMR.Right, so they should have (probably already do) some dispatchable function that will construct an XCM to send to Statemint. Something like
fn reserve_transfer_asset(GLMR, Statemint, my_address) { ... }
, and inside it would put together the[BuyExecution, ReserveAssetDeposited, ...]
etc. instructions. For UX they'd probably want toWithdrawAsset
from the Moonbeam sovereign account and charge a slightly higher tx fee on the Moonbeam side to cover it. Then their treasury can top up the sovereign account DOT every now and then.We are not dealing with teleports, so I'm not sure how much this
MintLocation
applies to e.g. GLMR. Since thepara
origin corresponding to Moonbeam conforms to theCreateOrigin = ForeignCreators
, "this chain" (being Moonbeam) can mint the asset on Statemint. But, as I read these docs (full enum below), the key part for me is: "We ensure that...Based on that, I would call all parachain token
NonLocalMint
. An example ofLocalMint
would be DOT and the assets created under the first (existing) instance of the Assets pallet, e.g. USDT. So, as to how to resolve it in code, I would say:pallet_balances || pallet_assets::Instance1
areLocal
and any assets underpallet_assets::Instance2
areNonLocal
. @KiChjang wdyt?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.
@joepetrowski
ok, Joe, thank you, so I will change it to something like this:
and later for westmint/bridge-hub stuff to:
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.
@joepetrowski If instance 1 of the assets pallet refers to the one created using integer IDs and instance 2 of the assets pallet represents those created with
MultiLocation
IDs, then this makes sense. Although I do have to echo your sentiment about how this may not be very relevant, as it is only used for teleports. I don't really see Statemint/e allowing for teleports between community parachains anytime soon; the most obvious use cases are however between system parachains teleporting DOT/KSM to each other.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.
@joepetrowski
so, I pushed there:
LocalMint<NonZeroIssuance<AccountId, Assets>>
,or do we want to fix this just for DOT/KSM (which means allow relay chain currency)? in this case, how is identified "DOT/KSM" as AssetId?
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.
It would just be
{ parents: 1, interior: Here }
, which should correspond to the Balances pallet, not an AssetId.