wormhole-foundation / wormhole-explorer

We could have named this super-parakeet. Tweet tweet.
Other
30 stars 29 forks source link

Payload parser support for gateway payloads #676

Open gipsh opened 1 year ago

gipsh commented 1 year ago

When a user sends a tx to osmosis it is routed through wormchain (chain id 3104) Currently we see the transaction in wormholescan as tx with destination wormchain. We want to include also the routing information on the API so we can include that in the front end.

Example a tx to osmosis: https://wormholescan.io/#/tx/6/00000000000000000000000061e44e506ca5659e6c0bba9b678586fa2d729756/7632?network=TESTNET

The decoded payload looks like this

{
    "amount": "100000",
    "callerAppId": "UNKNOWN",
    "fee": "",
    "fromAddress": "000000000000000000000000e6990c7e206d418d62b9e50c8e61f59dc360183b",
    "parsedPayload": null,
    "payload": "eyJnYXRld2F5X3RyYW5zZmVyIjp7ImNoYWluIjoyMCwibm9uY2UiOjc0MDcsInJlY2lwaWVudCI6ImIzTnRiekZrT0RrNGVYaG9ZWEV3ZDNOaE0zSnhkVE4xZVROaFpqY3phSFZyZG5SeFpETjBialV6TlE9PSIsImZlZSI6IjAifX0=",
    "payloadType": 3,
    "toAddress": "c2e72b7bb32bfe2a3a4960e384e8c53d7a7c4a6c3b43b12f7f0e01532f3dea8d",
    "toChain": 3104,
    "tokenAddress": "0000000000000000000000005425890298aed601595a70ab815c96711a31bc65",
    "tokenChain": 6
}

And if we also de code the inner payload we see this:

{"gateway_transfer":{"chain":20,"nonce":7407,"recipient":"b3NtbzFkODk4eXhoYXEwd3NhM3JxdTN1eTNhZjczaHVrdnRxZDN0bjUzNQ==","fee":"0"}}

We need to add a new parser to the payload parser to support this kind of payloads where the destination chain is 3104. And add the gateway_transfer data to the db.

Also an app id should be added to the VAA with "OSMOSIS".

The recipient is base64 encoded, should be persisted unencoded like: osmo1d898yxhaq0wsa3rqu3uy3af73hukvtqd3tn535

Acceptance Criteria

Notes

ftocal commented 1 year ago

Deployed in staging-mainnet and staging-testnet

SamantaCasal commented 1 year ago

QA ok! Details on https://github.com/orgs/wormhole-foundation/projects/1/views/1?pane=issue&itemId=37354539