open-runtime-module-library icon indicating copy to clipboard operation
open-runtime-module-library copied to clipboard

propose xcm-transact module in the case parachain send `Transact` to relaychain

Open zqhxuyuan opened this issue 3 years ago • 0 comments

Alghough we have send_as_sovereign in xcm module. but sometimes parachain want to relaychain execute something by Transact, as the internal call of Transact can do anything that parachain expected, the most common scene is staking related operation. As I discovered some projects, they all have similar implementation.

  • construct relaychain related Call object and also have to specify parameters.
  • use utility batch_all if they're multiple xcm message needs to be executed
  • use utility as_derivative if they want using derivate account

those implemenation including: Acala | bifrost | parallel | moonbeam |...

also there're some distinctive design points:

  • moonbeam xcm-transactor has account_index register process, as they may have many derivate account
  • pint xcm-calls use a more dynamic way to construct Call.

we could offer a common implemenation like xTokens did before. of cause this module should abide by design rules like:

  • dependency as less as possible
  • extensible, that's parachain can self-custom as easy as possible

zqhxuyuan avatar Dec 01 '21 08:12 zqhxuyuan