ComposableFi / composable-ibc

A trustless, cross-chain bridging protocol.
https://picasso.network
76 stars 50 forks source link

feat(solana): manual instruction ls accounts propagation to cross chain calls #457

Open dzmitry-lahoda opened 9 months ago

dzmitry-lahoda commented 9 months ago

https://github.com/ComposableFi/emulated-light-client/issues/111#issuecomment-1821336979

dzmitry-lahoda commented 9 months ago
{
 "svm": {

   // all accounts from instuctions must be passed to client TX
 // ixs contain program ids, account and input data
   "instructions": [
   "borsch of ix as in invoke",
   "borsch of ix as in invoke",
...   
  ]
  // basicaly hook can do some extra work with without being contract for some reason and build ix on fly
// fully json  encoded
 "extra_accounts" : [ AccountMeta(R/W),  AccountMeta,... ] // 

  }
}

so expected that relayer parses memo,

if memo is json and json has svm then it MUST be like above (same logic as in Osmssis).

instructions to be parsed for accounts and extra_accounts. all sorted set with proper R/W and passed as extra (after all accounts of ibc) to call.

Please document above spec or in code that it works - i mean please make above to be doc comment or MD file.

dzmitry-lahoda commented 9 months ago

extra_accounts is optional, may not be here, instuctions is must and must not be empty. svm is optional, memo can be json, but not svm.

dzmitry-lahoda commented 9 months ago

this is blocker for cross chain calls on solana (whatever they are maid - osmosis hook/ics27/cvm)