Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[xcm-v3] Bridging xcm:v3:Transact and handling AccountId32 on target chain (with different globalConsensus) #6517

Closed
1 task
bkontur opened this issue Jan 6, 2023 · 3 comments

Comments

@bkontur
Copy link
Contributor

bkontur commented Jan 6, 2023

Story:

  • bridging xcm:v3:Transact calls from Rococo:Statemine(1000) -> Rococo:BridgeHub(1013) -> substrate-relayer -> Wococo:BridgeHub(1014) -> Wococo:Westmint(1000)
  • some on Rococo:Statemine account can submit extrinsic xcm:Transact(System::remark_with_event) like this: submit_extrinsic
  • message comes and is dispatched on Wococo:Westmint as: received_bridged_message
  • account in received Event::Remark is sovereign account of Wococo:BridgeHub(1014)

Problem and proof-of-concept

  • System::remark_with_event does validation let who = ensure_signed(origin)?;
  • to pass ensure_signed xcm config needs to have some implementation for OriginConverter that returns RuntimeOrigin::signed(...)
  • here is very very naive xcm ConvertOrigin implementation BridgedSignedAccountId32AsNative, which just converts MultiLocation{ parents: 2, interior: X3(GlobalConsensus(Rococo), Parachain(1000), AccountId32 { network: Rococo, id: ... })} to the configured local bridge-hub sovereign account LocationConverter::convert(MultiLocation { parents: 1, interior: X1(Parachain(1014)) }) (I know this impl is no-go for any production, it is just PoC to trigger successful dispatch + test )

Question:

  • what should be the "proper/correct/recommended" way to handle this AccountId conversion from different globalConsensus ?
@bkontur
Copy link
Contributor Author

bkontur commented Jan 6, 2023

@gavofyork @KiChjang @joepetrowski could you, please, check this and maybe give me some hints/leads (maybe I am totally missing something)?

also I just found something about "Origin aliasing" paritytech/polkadot-sdk#925, which looks similar, but I dont know

@KiChjang
Copy link
Contributor

KiChjang commented Jan 10, 2023

Unless I'm misunderstanding something, I think you can simply convert the ID in the AccountId32 junction directly to a local SS58 address. You'll most likely create a new struct under xcm-builder to allow this.

@bkontur
Copy link
Contributor Author

bkontur commented Jan 24, 2023

something similiar #6612

@bkontur bkontur closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants