Transaction introspection
Transaction introspection turns compiled Solana transaction data into views that an engineer can inspect. It supports direct decoding from transaction values and remote inspection through RPC, so callers can examine message structure, account roles, instructions, execution results, and parsed program data.
Introspection paths
The system has two related paths. Local inspection starts with bytes or an existing transaction value. RPC-backed inspection starts with a transaction signature or an RPC response and adds cluster context and execution metadata.
flowchart LR
A[Transaction bytes or value] --> B[Local transaction inspection]
B --> C[Message and instruction view]
D[Transaction signature] --> E[RPC transaction request]
E --> F[Encoded or parsed transaction response]
F --> G[Transaction and execution metadata]
C --> H[Engineer-facing inspection]
G --> H
Use local transaction inspection when the transaction data is already available. Use RPC transaction introspection when the source of truth is a validator and the inspection needs slot, block time, status, balances, logs, or other execution data.
References: transaction.go• L34-44 rpc/getTransaction.go• L25-41 rpc/getTransaction.go• L79-100 rpc/types.go• L235-279
Local transaction inspection
Local inspection decodes a compiled transaction into its signatures and message. The message exposes account keys, signer and writable roles, the recent block hash, version-specific data, and compiled instructions whose indexes point into the account list.
The transaction value supports several inspection views:
- Binary input can be decoded from bytes, base64, or base58.
- Account and program indexes can be resolved to public keys and account metadata.
- Registered program decoders can turn instruction data into typed instruction values.
- A tree view can show signatures, message data, accounts, and decoded instructions for a person to read.
Versioned transactions need special care. A v0 message can refer to address lookup tables, so account and instruction inspection is complete only after those table addresses are supplied. An unknown program decoder does not make the transaction invalid; the tree view can still show the program, raw data, and account list.
References: transaction.go• L46-120 transaction.go• L137-165 transaction.go• L767-855 message.go• L32-44 message.go• L110-151 registry.go• L27-32 registry.go• L80-117
RPC-backed transaction introspection
RPC-backed inspection combines transaction content with data returned by a Solana node. The general transaction request can return binary or JSON-shaped content. The parsed request asks the node for account roles and instruction data in a form that is easier to inspect without local program decoders.
The response gives an engineer two useful views:
| View | Main purpose |
|---|---|
| Encoded transaction | Reconstruct the local Transaction value from base58 or base64 content. |
| JSON transaction | Read message fields as structured data. |
| Parsed transaction | Read account roles and program instructions with parsed program information when the node provides it. |
| Transaction metadata | Inspect execution status, fees, balances, inner instructions, logs, rewards, return data, and compute use. |
The request also controls commitment and the highest transaction version the caller accepts. A node can return no result for an unknown or unavailable signature, and a request can fail when the response contains a version above the requested limit.
References: rpc/getTransaction.go• L25-76 rpc/getTransaction.go• L79-159 rpc/getParsedTransaction.go• L12-54 rpc/types.go• L85-143 rpc/types.go• L536-615
Inspection boundaries
Inspection describes the transaction data that is available at a boundary. Local decoding can show signed message content, but it does not prove that the cluster accepted or executed the transaction. RPC metadata describes the node's observed result at the requested commitment and can omit fields when the node did not record them.
The two paths also differ in how much interpretation they provide. Local instruction decoding depends on a decoder registered for the program. RPC parsed output depends on the node and may represent an instruction as parsed information or as raw program data. Treat missing parsed data as an inspection limit, not as proof that the instruction had no effect.
References: transaction.go• L664-724 transaction.go• L877-889 rpc/types.go• L235-279 rpc/getParsedTransaction.go• L56-92
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the transaction wire discriminator and the local byte, base58, and base64 entry points aligned for legacy, v0, and v1 transactions.
- Keep account lookup resolution aligned with instruction account indexes before changing local instruction display or decoding.
- Keep RPC response envelope handling aligned with every supported transaction encoding.
- Keep parsed instruction fields aligned with the node's JSON shape, including raw and parsed instruction variants.
- Keep the requested maximum transaction version aligned with the versions that local decoding and RPC result types can represent.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A v0 transaction has unresolved address lookup tables. | Account and instruction inspection cannot resolve all account indexes. | Fetch the referenced tables and set them on the message before resolving accounts. |
| An instruction program has no registered decoder. | Typed instruction data is unavailable, although raw data and accounts can still be shown. | Register the program decoder when typed local inspection is required. |
| RPC returns no transaction for the signature. | The RPC call returns ErrNotFound instead of an inspectable result. | Check the error and query at a suitable commitment or history range. |
| RPC returns a transaction version above the requested maximum. | The node rejects the request. | Set MaxSupportedTransactionVersion to a version the caller can handle. |
| Execution metadata contains a non-null error. | The transaction was recorded but its execution failed. | Inspect Meta.Err instead of treating a returned transaction as success. |
Key files
| File | Why to read it |
|---|---|
| transaction.go | Defines the local transaction value, input decoders, account resolution, and human-readable tree view. |
| message.go | Explains message versions, account lookup tables, and the account data needed to resolve compiled instructions. |
| registry.go | Shows how program-specific instruction decoders become available to local inspection. |
| rpc/getTransaction.go | Defines the general RPC transaction request and the encoded or JSON response envelope. |
| rpc/getParsedTransaction.go | Defines the RPC path that requests node-parsed transaction content. |
| rpc/types.go | Defines transaction metadata, parsed messages, parsed instructions, and data access helpers. |