solana-labs / explorer

Explorer for Solana clusters
https://explorer.solana.com
MIT License
231 stars 291 forks source link

[Bug] txinspector does not use Anchor IDL #287

Open ochaloup opened 1 year ago

ochaloup commented 1 year ago

Describe the bug

When using the txinspector page of the Solana Explorer (https://explorer.solana.com/tx/inspector) it does interpret neither information about the transaction from known programs (SystemProgram) nor for programs with Anchor IDL. The Explorer nicely shown account names and interpret the data content from IDL when working with transaction that was executed. For simulation the nicely decoded content is missing.

To Reproduce

For example. A transaction that transfers a sol. Inspector says only https://explorer.solana.com/tx/inspector?message=gAIAAQQdf%252BNF4vaC7NoLOfzcE%252FqE5VaEtHGRPaRHkQIpHbFzJBiGoZBmybh97HYucJ3h5FxehAi%252BzKz9%252BN2LjsQggSAN3t52AycOon%252BY8xHl8rpwvxTrDs5dy3xRkY%252F97p1yuMIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQJEKSTjgRBFfbR%252FWefwt9Cy6op9qTr%252BVIZmphqOakVAQMCAQIMAgAAAADKmjsAAAAAAA%253D%253D&cluster=devnet

(generated like with CLI command solana transfer -ud --from /tmp/test.keyapir FzzFmEA3TKnKbsuStkLHp7Px5Kkrbs2DEetUXWyjHvgR 1 --dump-transaction-message --sign-only --blockhash CTJ8dtbA8M7oXJKE2sB43wyD9KajPUbwykDBLepdHZWY

image

Expected behavior

Inspector page should show information about known programs and programs with IDL as it's for executed transactions.

That's how the information is shown and nicely presented for executed transactions.

https://explorer.solana.com/tx/4LdTuz7Vy5By576hGmXbBLTFiFd1DkZshVfSFprQxigVJKJXYCz4JKEDD5rpRespTsoj3mdu79WQLWm7isEKUvYL?cluster=devnet

We can see there are labels From Address, To Address for accounts, and data is interpreted as Transfer Amount (SOL).

image

ngundotra commented 1 year ago

@mcintyre94 happy to help explain how the anchor stuff works, but this seems like p small useful change.

Feel free to unassign urself. Lmk what you what this protocol to be.

Separately from this issue, I think I should probably transfer admin role to you or @steveluscher & be unassignable 😂