Skip to content
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

tx-info command should emit human-readable dest'n {address, caller}, nonce, etc #70

Open
boojamya opened this issue Mar 25, 2024 · 1 comment

Comments

@boojamya
Copy link
Member

This would be a nice to have to help troubleshoot tx.

It would intake a tx-hash and a source-domain and output things like:

  • destination address
  • destination caller
  • weather or not the CCTP nonce has been used or not
  • ect

Some of the above info is encoded so giving the ability for the relayer to make this info human readable could be very helpful.

@boojamya boojamya self-assigned this Mar 25, 2024
@jonathanpberger jonathanpberger changed the title There should be a tx-info command tx-info command should emit human-readable dest'n {address, caller}, nonce, etc Apr 1, 2024
@Reecepbcups
Copy link
Contributor

Reecepbcups commented Apr 11, 2024

An example to get the ETH address out of the Cosmos event logs

Query the Tx hash & get the logs

https://www.mintscan.io/noble/tx/5931A0DF16C0D29006CBAB3FD1762F31BF2AE61CE21E36899AC245FA046C867F?height=4593256 :

[{'events': [{'type': 'burn', 'attributes': [{'key': 'burner', 'value': 'noble1x74lhe0pqqv7rcg4pc4svtxhm9hnf79pxpfqfv'}, {'key': 'amount', 'value': '43060000000uusdc'}]}, {'type': 'circle.cctp.v1.DepositForBurn', 'attributes': [{'key': 'amount', 'value': '"43060000000"'}, {'key': 'burn_token', 'value': '"487039debedbf32d260137b0a6f66b90962bec777250910d253781de326a716d"'}, {'key': 'depositor', 'value': '"noble186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswppd63"'}, {'key': 'destination_caller', 'value': '""'}, {'key': 'destination_domain', 'value': '1'}, {'key': 'destination_token_messenger', 'value': '"AAAAAAAAAAAAAAAAayVTLhBgzhDMOwqZ5Wg7kb/eaYI="'}, {'key': 'mint_recipient', 'value': '"AAAAAAAAAAAAAAAAj7YDV80kNsJIP/pmD4ZR8jAsxV8="'}, {'key': 'nonce', 'value': '"3710"'}]}, {'type': 'circle.cctp.v1.MessageSent', 'attributes': [{'key': 'message', 'value': '"AAAAAAAAAAQAAAABAAAAAAAADn4AAAAAAAAAAAAAAABX1OrxCRV3prfRISAq+9KAgTTxFwAAAAAAAAAAAAAAAGslUy4QYM4QzDsKmeVoO5G/3mmCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASHA53r7b8y0mATewpvZrkJYr7HdyUJENJTeB3jJqcW0AAAAAAAAAAAAAAACPtgNXzSQ2wkg/+mYPhlHyMCzFXwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoGk3UAAAAAAAAAAAAAAAAAPq1/YfZ6L1c57r1kDFSXFz0/NvA="'}]}, {'type': 'coin_received', 'attributes': [{'key': 'receiver', 'value': 'noble12l2w4ugfz4m6dd73yysz477jszqnfughxvkss5'}, {'key': 'amount', 'value': '43060000000uusdc'}, {'key': 'receiver', 'value': 'noble1x74lhe0pqqv7rcg4pc4svtxhm9hnf79pxpfqfv'}, {'key': 'amount', 'value': '43060000000uusdc'}]}, {'type': 'coin_spent', 'attributes': [{'key': 'spender', 'value': 'noble186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswppd63'}, {'key': 'amount', 'value': '43060000000uusdc'}, {'key': 'spender', 'value': 'noble12l2w4ugfz4m6dd73yysz477jszqnfughxvkss5'}, {'key': 'amount', 'value': '43060000000uusdc'}, {'key': 'spender', 'value': 'noble1x74lhe0pqqv7rcg4pc4svtxhm9hnf79pxpfqfv'}, {'key': 'amount', 'value': '43060000000uusdc'}]}, {'type': 'message', 'attributes': [{'key': 'action', 'value': '/circle.cctp.v1.MsgDepositForBurn'}, {'key': 'sender', 'value': 'noble186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswppd63'}, {'key': 'sender', 'value': 'noble12l2w4ugfz4m6dd73yysz477jszqnfughxvkss5'}]}, {'type': 'noble.fiattokenfactory.MsgBurn', 'attributes': [{'key': 'amount', 'value': '{"denom":"uusdc","amount":"43060000000"}'}, {'key': 'from', 'value': '"noble12l2w4ugfz4m6dd73yysz477jszqnfughxvkss5"'}]}, {'type': 'transfer', 'attributes': [{'key': 'recipient', 'value': 'noble12l2w4ugfz4m6dd73yysz477jszqnfughxvkss5'}, {'key': 'sender', 'value': 'noble186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswppd63'}, {'key': 'amount', 'value': '43060000000uusdc'}, {'key': 'recipient', 'value': 'noble1x74lhe0pqqv7rcg4pc4svtxhm9hnf79pxpfqfv'}, {'key': 'sender', 'value': 'noble12l2w4ugfz4m6dd73yysz477jszqnfughxvkss5'}, {'key': 'amount', 'value': '43060000000uusdc'}]}]}]

from the above mint_recipient:
echo AAAAAAAAAAAAAAAAj7YDV80kNsJIP/pmD4ZR8jAsxV8= | base64 --decode | od -A n -t x1

 00 00 00 00 00 00 00 00 00 00 00 00 8f b6 03 57
 cd 24 36 c2 48 3f fa 66 0f 86 51 f2 30 2c c5 5f
 
 Which is the destination address -> 0x8fb60357cd2436c2483ffa660f8651f2302cc55f shown in mintscan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants