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.
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
feat: Connectors v2 message PoC #1292
feat: Connectors v2 message PoC #1292
Changes from 16 commits
65a3d17
690430e
b5eb58c
4588b91
0839851
394fd4e
6a86151
3ba9230
9c84f3a
ccc22b0
af67315
492fdb3
7726985
93662a1
3db1233
6cc8863
7cacb2b
7f60bd4
c064dca
dd2356e
51542c5
af3ea8e
572fb34
4ecddf9
2ab8593
618f7c2
bdbf65d
14b3f09
6a06ba4
d774926
05dd755
6b06a9d
e045d0e
787cc53
2f22dae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 would implement this as a
Into
/From
GeneralCurrencyIndex
to/fromCurrencyId
instead.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.
Could you give a short feedback if c064dca matches your expectations? Then I will add the rest.
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.
This won't work because this would assume that every token would have to have an
evm_address
. We could either make it optional, which is still a weak abstraction in my opinion, or we can use theMultiLocation
field of the metadata to represent the EVM address of that token, assuming we are registering the asset as it being an asset in a Connector-connected Domain, if that makes sense? By this last part I mean, lets's say that Domain X has a TokenX
with an EVM addressEA
; if we registerX
on theCentrifuge Chain
just to register/list a token we handle on DomainX
, that approach could work, because when sending/receiving transfers from/to that Domain, we can expect the respective entry in the asset registry to have a MultiLocation holding an EVM address; if it doesn't, we throw an error.Maybe I am making this sound too complicated, but I am coming from a perspective where every token listed in the asset registry (apart from Tranche tokens) is a potential token that could be transferred through XCM; by using
MultiLocation
to hold anEVM
address that wouldn't fit that purpose, but since that's not the purpose we would be registering the token in the registry in the first place, I think that's fine.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.
I definitely get your point! This is purely based on the last ConnectorsV2 sync we had were we decided to add
evm_address
to the metadata of currencies in the asset registry. I am not sure though how to deterministically derive 32 bytes from the flexibleMultiLocation
which could be quite scaffolded, e.g.Here
vs.X2(para, pallet_instance, general_index)
etc. How would you handle that?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.
We could use a
X2(DomainId, AccountKey20 { network: NetworkId, key: [u8; 20] }}
; but that's probably trying to make a shoe out of a shoe box. I remember @offerijns suggesting in that sync to maybe use a type likeDomainAddress
; the issue with that is that we already have thelocation
field on theMetadata
type.As I am thinking and writing about this, it becomes clearer how there's an abstraction leakage here, in the sense of trying to use a design / abstraction (the asset registry) for something it's not quite designed for. The best would be if we could change the
Meadata.location
field to be something likeenum GlobalLocation { Polkadot(VersionedMultiLocation), EVM(chainId, address) }
but we can't do that unless if we change the orml pallet itself.I have to think a bit more about 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.
Why not use XCM MultiLocations for this, weren't they explicitly designed to support multiple consensus systems, so also able to represent EVM addresses? We can/should look at how Snowbridge intents to do 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.
Yeah that's the discussion above, specifically the
X2
+AccountKey20
suggestion."Yes" although as we see - at least in XCM v2 - it's not that idiomatic to try and identify an EVM token using
MultiLocation
. Might need to revisit V3 to hopefully find better support.Absolutely, good point!
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.
Block local domain!
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.
Great catch! 05dd755
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.
Block local domain!
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.
Great catch! 05dd755
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.
Do we have an issue for tracking that. This would be really important!
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 mean the FIXME
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.
We do not have an existing Github issue but this is part of the asset metadata update which is owned by @NunoAlexandre
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.
Improved message in 05dd755