Instruction decoding, simulation, and profiling
Instruction inspection turns raw transaction data into readable instruction cards. It also lets an engineer test the same message against a cluster without sending it. The page joins program-aware decoding, published program interfaces, simulation results, and compute-unit views so a transaction can be understood as recorded and as a possible execution. It is part of the broader transaction inspection flow and connects with the transaction detail route, instruction card rendering, and transaction sharing experiences.
Instruction decoding
Instruction decoding maps a program address and instruction data to a shared parsed shape. The transaction page and inspector use that shape to choose a detail card while keeping raw accounts and bytes available when no decoder can explain the instruction.
Parser dispatch
The parser dispatcher is the program-aware routing layer. It selects a parser by program address and accepts both RPC pre-parsed instructions and raw transaction instructions. This gives callers one program lookup rule for both input forms. The application composes the dispatcher for transaction routes with built-in decoders and package-backed decoders for common Solana programs, including System, Token, Token-2022, Lighthouse, Pyth, Serum/OpenBook, Mango, Token Swap, and Wormhole (app/…/instruction-parser-dispatcher.ts• L4-45, app/…/mango-client.ts• L6-12, app/…/serum-client.ts• L6-13, app/…/token-swap-client.ts• L6-12, app/…/wormhole-client.ts• L6-11).
Each parser supplies a stable program label and a decode path. A known program with an unsupported instruction discriminator becomes a program-aware unknown result. An unregistered program remains raw. Duplicate program registrations fail at startup so two decoders cannot claim the same program (packages/…/dispatcher.ts• L21-27, packages/…/dispatcher.ts• L53-81).
References: app/…/instruction-parser-dispatcher.ts• L4-45 packages/…/dispatcher.ts• L21-27 packages/…/dispatcher.ts• L53-81 packages/…/parser.ts• L55-76
Parser provider
The parser provider makes the chosen dispatcher available to all transaction views through the client tree. The transaction layout installs it once. Instruction cards then use the shared parser service instead of building their own program map (app/…/layout.tsx• L1-12, app/…/instruction-parser-provider.tsx• L6-10).
This boundary keeps parser rules separate from card views. A view that asks for the parser without the provider fails with an explicit wiring error rather than silently using a different parser set (app/…/provider.tsx• L6-23).
References: app/…/layout.tsx• L1-12 app/…/instruction-parser-provider.tsx• L6-10 app/…/provider.tsx• L6-23
Instruction node assembly
Instruction nodes are the shared tree that connects transaction instructions to their cards. The transaction view keeps RPC-parsed instructions as parsed values and converts partially decoded instructions to byte form by resolving their account keys from the transaction message (app/…/instruction-nodes.ts• L20-35).
The assembly groups inner instructions, also called cross-program invocations (CPIs), under the outer instruction at the matching message index. It preserves their order across RPC groups. If an instruction names an account that the message does not contain, that node stays undefined so the page can show an unknown placeholder without shifting later positions (app/…/instruction-nodes.ts• L15-27, app/…/instruction-nodes.spec.ts• L44-61). Mainnet inner instructions from slots before recording began are treated as unavailable rather than as an empty set (app/…/trusted-inner-instructions.ts• L4-16).
The transaction section passes this tree to the shared instruction surface. That surface supplies raw byte data to the card layer and renders outer and child nodes in their transaction order (app/…/InstructionsSection.tsx• L22-53, app/…/node.ts• L3-27, app/…/InstructionNodeCards.tsx• L9-43).
References: app/…/instruction-nodes.ts• L11-35 app/…/instruction-nodes.spec.ts• L26-61 app/…/InstructionsSection.tsx• L15-53 app/…/trusted-inner-instructions.ts• L4-16 app/…/node.ts• L3-27 app/…/InstructionNodeCards.tsx• L9-43
Instruction cards
Instruction cards are the user-facing result of decoding. The transaction page passes each instruction node through the shared card surface, which applies program-specific routes before the dynamic IDL path and then uses an unknown card when neither path can explain the instruction (app/…/InstructionsSection.tsx• L42-53, app/…/TxInstructionSurface.tsx• L1-93).
The transaction route keeps a dedicated card ahead of the generic IDL route for special programs. Program Metadata owns every instruction on its program address: content operations use its typed content view, while other operations can fall back to IDL decoding. Name-only cards preserve a readable program and operation name when a package decoder cannot provide fields. RPC-parsed token batch instructions also have a dedicated route, so they do not fail through the ordinary token card (app/…/InstructionsSection.tsx• L42-53, app/…/InstructionCardView.tsx• L8-49).
Most cards use a shared declaration for a title and labeled fields. Cards that need account data or transaction-log events can add that data through their own view. Cards keep the raw instruction available for account and byte views. They validate the expected field shape before showing structured data when an RPC value could share a type label without being decoded by the application (app/…/define-instruction-card.tsx• L8-27, app/…/AddressLookupTableDetailsCard.tsx• L63-83, app/…/AssociatedTokenDetailsCard.tsx• L51-68, app/…/types.ts• L631-817).
The shared card receives raw data directly in inspector views or loads it for a top-level transaction instruction when needed. It does not request raw data for inner instructions, and it stops retrying when a completed fetch confirms that the data is unavailable (app/…/InstructionCard.tsx• L40-71).
The inspector uses the same goal through a different entry path. It relates outer instructions to inner instructions so the reader can connect a program call to the calls it makes. Its shared card view lets transaction and inspector surfaces reuse card content while keeping their own controls and address display (app/…/InstructionsSection.tsx• L120-184, packages/…/decode-instructions.ts• L175-184, app/…/InstructionCardView.tsx• L8-49).
References: app/…/InstructionsSection.tsx• L15-53 app/…/TxInstructionSurface.tsx• L1-93 app/…/InstructionNodeCards.tsx• L9-43 app/…/define-instruction-card.tsx• L8-27 app/…/InstructionCardView.tsx• L8-49 app/…/surface.tsx• L29-67 app/…/InstructionCard.tsx• L40-71 app/…/InstructionsSection.tsx• L120-184 packages/…/decode-instructions.ts• L175-184 app/…/AddressLookupTableDetailsCard.tsx• L63-83 app/…/AssociatedTokenDetailsCard.tsx• L51-68 app/…/types.ts• L631-817
Built-in decoders
Built-in decoders explain programs whose instruction formats are known by the application. They turn instruction bytes and account positions into names and structured values without a published program interface. The shared parser package defines the parser contract. Feature slices provide program-specific cards and parser descriptors (app/…/system-client.ts• L1-2, app/…/token-client.ts• L1-12, app/…/token-2022-client.ts• L1-16).
The built-in set covers common system and token actions plus focused views for lookup tables, associated-token accounts, compute budgets, memo data, Ed25519 checks, zero-knowledge proofs, and Lighthouse. Token-2022 also exposes extension and metadata operations through named instruction types and validated RPC fields. Token cards can enrich amount rows with mint precision and a token symbol from account state and the token-info service. A recognized operation gets named accounts or values. An unsupported or malformed operation stays inspectable through its raw data (app/…/AddressLookupTableDetailsCard.tsx• L28-60, app/…/AssociatedTokenDetailsCard.tsx• L17-40, app/…/ComputeBudgetDetailsCard.tsx• L19-47, app/…/Ed25519DetailsCard.tsx• L26-53, app/…/ZkElGamalProofDetailsCard.tsx• L15-58, app/…/LighthouseDetailsCard.tsx• L12-37, app/…/TokenDetailsCard.tsx• L62-113, app/…/fetch-token-infos-from-api.ts• L9-21, app/…/types.ts• L631-817).
Some built-in decoders add context that is important to read the operation. System with-seed cards keep the derived account, base account, seed, and operation together. The Ed25519 card can use data from sibling instructions because its references point outside the current instruction (app/…/SystemDetailsCard.tsx• L53-109, app/…/CreateWithSeedDetailsCard.tsx• L5-16, app/…/Ed25519DetailsCard.tsx• L26-53).
Program Metadata is a content-oriented built-in path. Its initialize, setData, and write instructions can carry content inline or point to metadata and source-buffer accounts. The card shows the operation and content settings, then gives raw bytes and decoded content when the payload is available. URL and external sources remain visible as pointer values. The view does not fetch the pointed-to document. It also bounds large decoded content and keeps a raw view when decoding fails (app/…/decode-pmp-instruction.spec.ts• L48-245, app/…/DataPayloadSection.tsx• L31-77, app/…/DataPayloadSection.tsx• L100-213, app/…/use-pmp-account-payload.ts• L7-57). Housekeeping or unsupported Program Metadata instructions fall through to the IDL or unknown path instead of receiving a false content card (app/…/decode-pmp-instruction.spec.ts• L213-245).
Program Metadata Buffer accounts can need a separate config lookup. The account view first uses evidence in the bytes, then can scan recent successful transactions for a direct declaration or a safe same-transaction copy into a metadata account. A direct declaration has priority. If the scan fails or reaches its limit, the byte-based result remains available (app/…/use-resolve-buffer-config.ts• L18-38, app/…/find-config-in-transactions.ts• L12-29, app/…/resolve-buffer-config-from-transaction.ts• L35-63).
References: app/…/instruction-parser-dispatcher.ts• L13-23 app/…/system-client.ts• L1-2 app/…/token-client.ts• L1-12 app/…/token-2022-client.ts• L1-16 app/…/TokenDetailsCard.tsx• L62-113 app/…/fetch-token-infos-from-api.ts• L9-21 app/…/types.ts• L631-817 app/…/types.spec.ts• L47-69 app/…/SystemDetailsCard.tsx• L53-109 app/…/CreateWithSeedDetailsCard.tsx• L5-16 app/…/AddressLookupTableDetailsCard.tsx• L28-60 app/…/AssociatedTokenDetailsCard.tsx• L17-40 app/…/ComputeBudgetDetailsCard.tsx• L19-47 app/…/Ed25519DetailsCard.tsx• L26-53 app/…/ZkElGamalProofDetailsCard.tsx• L15-58 app/…/LighthouseDetailsCard.tsx• L12-37 app/…/decode-pmp-instruction.spec.ts• L48-245 app/…/DataPayloadSection.tsx• L31-77 app/…/use-pmp-account-payload.ts• L7-57 app/…/use-resolve-buffer-config.ts• L18-55 app/…/use-resolve-buffer-config-onchain.ts• L20-54 app/…/find-config-in-transactions.ts• L33-76 app/…/resolve-buffer-config-from-transaction.ts• L41-63
Package-backed decoders
Package-backed decoders use a program client or shared decoder package to read wire data. They then adapt the result to the application's parser and card contract. This lets a program-specific package provide account names, typed values, or a stable operation name without changing the transaction card model (app/…/bpf-loader-parser.ts• L23-34, app/…/bpf-loader-parser.ts• L47-95, app/…/sas-client.ts• L10-15, app/…/serum-parser.ts• L22-31).
The transaction route gives a dedicated program card precedence over the generic IDL path. Pyth, Serum, and OpenBook can show package-decoded accounts and fields. Mango, Token Swap, and Wormhole provide readable names even when they have no field payload. Deprecated Serum deployments use name-only cards, while unknown tags or failed payload reads fall back to unknown or raw content (app/…/BpfLoaderDetailsCard.tsx• L43-57, app/…/LighthouseDetailsCard.tsx• L25-37, app/…/PythDetailsCard.tsx• L30-68, app/…/serum-parser.ts• L24-47, app/…/SerumDetailsCard.tsx• L30-52, app/…/mango-parser.ts• L7-16, app/…/token-swap-parser.ts• L9-23, app/…/wormhole-parser.ts• L9-23).
Each deployment registers its own program address with the shared dispatcher. This matters for programs that use different addresses across clusters or retain deprecated deployments. Lighthouse also has an instruction guard so the raw-byte route can select its decoded card consistently (app/…/mango-client.ts• L6-12, app/…/serum-client.ts• L6-13, app/…/token-swap-client.ts• L6-12, app/…/wormhole-client.ts• L6-11, app/…/is-lighthouse-instruction.ts• L6-12).
References: app/…/bpf-loader-client.ts• L11-16 app/…/bpf-loader-parser.ts• L23-34 app/…/bpf-loader-parser.ts• L47-95 app/…/BpfLoaderDetailsCard.tsx• L43-57 app/…/sas-client.ts• L10-15 app/…/sas-parser.ts• L23-36 app/…/is-lighthouse-instruction.ts• L6-12 app/…/LighthouseDetailsCard.tsx• L25-37 app/…/pyth-parser.ts• L9-21 app/…/PythDetailsCard.tsx• L30-68 app/…/mango-parser.ts• L4-16 app/…/serum-parser.ts• L24-47 app/…/SerumDetailsCard.tsx• L30-52 app/…/token-swap-parser.ts• L6-23 app/…/wormhole-parser.ts• L6-23
IDL decoders
An IDL is a program interface description that names instructions, accounts, and data fields. The dynamic IDL path uses a Program Metadata IDL when one exists. It otherwise uses the available Anchor IDL. This path applies to raw instructions and is shared by the transaction page and inspector (app/…/use-idl-instruction-decode.ts• L9-29).
IDL lookup is a fallback in the decode cascade. A dedicated program decoder stays ahead of it. The inspector resolves one client for each program used by outer or inner instructions, then tries IDL and other supplied decoders before returning raw data (packages/…/decode-instructions.ts• L19-24, packages/…/decode-instructions.ts• L114-141).
Native Codama IDLs use Codama directly. The Codama card shows the program and instruction names, IDL account names, account roles, and decoded arguments. It falls back to an unknown card when the decoded path is not a complete program instruction. Anchor IDLs use the richer Anchor card first so the view can keep program events and nested account groups; conversion to Codama is a last resort. The Anchor card shows a clear decode failure when the public interface cannot decode the account or data rows. Both paths use an error boundary and end in an unknown card when the renderer fails (app/…/decode-instruction-with-idl.ts• L54-84, app/…/IdlInstructionCard.tsx• L9-33, app/…/CodamaInstructionCard.tsx• L20-38, app/…/AnchorDetailsCard.tsx• L35-45, app/…/AnchorInstructionBody.tsx• L35-43). Program Metadata IDLs take precedence over legacy Anchor IDLs, so both surfaces use the same published interface when it is available (app/…/use-idl-instruction-decode.ts• L15-19, app/…/use-idl-instruction-decode.spec.ts• L38-55).
The program IDL card presents the selected current interface as one source. It shows the source, program version, and storage address when available. It also links to IDL history and external MCP/API tooling. If the interface names a different program, the card hides its content to prevent an unsafe decode or tool action. If no interface exists, it offers the program-metadata upload path (app/…/IdlCard.tsx• L38-51, app/…/IdlCard.tsx• L119-167, app/…/IdlCard.tsx• L170-207, app/…/IdlCard.tsx• L238-263).
The interactive IDL view uses the selected cluster for program work. Its selector opens the shared cluster chooser and marks Mainnet as a real-funds environment. Actions that can run a transaction on Mainnet require a disclaimer before they execute. The acceptance is kept in a cookie for later visits. Other clusters run the action without that prompt, while canceling or replacing a pending action does not run the old action (app/…/ClusterSelector.tsx• L9-25, app/…/BaseClusterSelector.tsx• L22-51, app/…/use-mainnet-confirmation.ts• L7-61).
The interactive instruction form turns IDL account and argument definitions into values for either a transaction call or a simulation. It supports nested account groups, fills argument fields with type-based defaults, and flattens submitted values into instruction-qualified names. It treats instruction names as untrusted input when it creates defaults, so an on-chain name cannot write fields onto shared object prototypes (app/…/use-instruction-form.ts• L28-81, app/…/use-instruction-form.ts• L92-145, app/…/use-instruction-form.spec.ts• L9-33).
Anchor IDLs can expose events from transaction logs. The event scope follows the instruction node, so top-level events stay on the top-level card and CPI child events stay on the matching child card. Decodable events show named fields. An undecodable Program data: payload remains visible as an unknown event with raw bytes. An undecodable base64 guess from Program log: is omitted because it may not belong to the program (app/…/use-anchor-events.ts• L9-30, app/…/AnchorDetailsCard.tsx• L21-33, app/…/decode-program-events.ts• L10-20, app/…/ProgramEventsCard.tsx• L60-115).
References: app/…/use-idl-instruction-decode.ts• L9-29 app/…/use-idl-instruction-decode.spec.ts• L38-87 app/…/IdlInstructionCard.tsx• L9-33 app/…/CodamaInstructionCard.tsx• L20-38 app/…/AnchorDetailsCard.tsx• L21-45 app/…/AnchorInstructionBody.tsx• L15-89 app/…/decode-instruction-with-idl.ts• L28-99 app/…/decode-instruction-with-idl.spec.ts• L57-125 app/…/use-anchor-events.ts• L9-30 app/…/decode-program-events.ts• L10-20 app/…/ProgramEventsCard.tsx• L17-115 app/…/IdlCard.tsx• L38-263 app/…/use-mainnet-confirmation.ts• L7-61 app/…/use-mainnet-confirmation.spec.ts• L22-203 app/…/ClusterSelector.tsx• L9-25 app/…/use-instruction-form.ts• L28-145 app/…/use-instruction-form.spec.ts• L9-71 packages/…/decode-instructions.ts• L19-24 packages/…/decode-instructions.ts• L114-141
Simulation
Simulation runs a versioned transaction message against the selected cluster's latest confirmed ledger state. It does not persist state or perform signature checks. It gives a low-risk view of logs, errors, balance changes, and compute use before a send (app/…/SimulationCard.tsx• L64-75).
Simulation lifecycle
The simulation flow starts idle, runs on demand, and ends with a result or a retryable error. The request is tied to the cluster endpoint and a fingerprint of the message. This prevents a result for one transaction from appearing for another (app/…/use-simulation.ts• L14-18, app/…/use-simulation.ts• L28-57).
The simulation service resolves address lookup tables and account keys. It reads pre-simulation account state and epoch data, then sends the message to RPC with account data requested. It converts the response into display-ready logs, balances, token state, and compute values (app/…/simulate-transaction.ts• L39-77, app/…/simulate-transaction.ts• L132-177). Resolved lookup addresses are part of the account-key view used to name programs in the result. This matters because a lookup-table address is not in the static key list (app/…/simulate-transaction.spec.ts• L198-252).
Version 1 messages use their required wire form. If the cluster does not support that message version, the result explains the cluster limit instead of presenting it as an ordinary transaction error. The service can also explain a version 1 loaded-account data limit when it can measure the named accounts and related program data. If that estimate is not reliable, it preserves the original RPC failure (app/…/simulate-transaction.ts• L75-79, app/…/simulate-transaction.ts• L84-121, app/…/simulate-transaction.ts• L294-361).
This diagram shows how a message becomes the simulation views shown to an engineer.
flowchart LR
A[Versioned message] --> B[Resolve lookup tables and account state]
B --> C[RPC simulation]
C --> D[Program logs]
C --> E[SOL and token state]
C --> F[Consumed compute units]
D --> G[Logs card and CU profile]
E --> H[Balance change cards]
F --> G
References: app/…/use-simulation.ts• L14-18 app/…/use-simulation.ts• L28-77 app/…/simulate-transaction.ts• L39-80 app/…/simulate-transaction.ts• L132-181 app/…/simulate-transaction.spec.ts• L198-252 app/…/simulate-transaction.spec.ts• L387-624
Simulation results
The result keeps logs and error state separate from balance changes. When execution fails with logs, the UI keeps the logs for diagnosis but does not show balance cards as if the state change were reliable. When RPC returns an error without logs, the raw error is shown as the simulation failure (app/…/simulate-transaction.ts• L180-219, app/…/SimulationCard.tsx• L79-109).
SOL changes compare pre- and post-simulation lamport balances. For a confirmed transaction, known on-chain pre- and post-balances take priority over simulated values. Token changes use simulated account state and mint precision to build token balance rows (app/…/compute-sol-balance-changes.ts• L6-34, app/…/simulate-transaction.spec.ts• L48-102, app/…/simulate-transaction.spec.ts• L264-383).
References: app/…/simulate-transaction.ts• L180-219 app/…/SimulationCard.tsx• L79-109 app/…/compute-sol-balance-changes.ts• L6-34 app/…/simulate-transaction.spec.ts• L264-383
Compute-unit profiling
Compute-unit profiling shows how execution cost is distributed across a transaction's top-level instructions. It combines parsed program logs with the transaction's total consumed units. When an instruction has no measured value, it uses a reserved or default value for display.
Historical transaction profiling
For a confirmed transaction, the profiling section parses recorded program logs and pairs each top-level instruction with its observed compute-unit value. It keeps transaction order and removes log entries that do not represent top-level instructions. This prevents later cost values from moving onto the wrong row (app/…/CUProfilingSection.tsx• L32-53, app/…/format-instruction-logs.ts• L31-71).
The epoch and cluster matter because built-in reserve rules can change over time. If the epoch schedule cannot be loaded, the page says that profiling is unavailable instead of drawing a chart with the wrong historical rule. Known built-in defaults are preferred for missing values. The epoch-aware reserved value supplies the remaining estimate. These values are visual aids, not measured runtime data (app/…/CUProfilingSection.tsx• L55-77, app/…/format-instruction-logs.ts• L31-49, app/…/BaseCUProfilingCard.tsx• L235-286).
References: app/…/CUProfilingSection.tsx• L17-83 app/…/format-instruction-logs.ts• L11-71 app/…/BaseCUProfilingCard.tsx• L235-286
Simulation profiling
Simulation resolves each compiled instruction's program from the simulation's complete account-key list, including addresses loaded from lookup tables. Built-in names appear first and IDL names can fill in later without changing row order. If a program index cannot be resolved, the whole row list is rejected so log values cannot shift onto the wrong instruction (app/…/use-simulation-instruction-names.ts• L21-29, app/…/use-simulation-instruction-names.ts• L32-75).
Simulation uses the same profiling card as a confirmed transaction. The shared chart receives the simulated total and appears when parsed logs contain entries, including after a simulated failure because logs can show where execution stopped. If logs exist but instruction names cannot be resolved, the page explains that profiling is unavailable. If no logs exist, it shows neither a chart nor an availability warning (app/…/SimulatorCUProfilingCard.tsx• L15-35, app/…/SimulationCard.tsx• L79-105, app/…/SimulationCard.spec.tsx• L48-103). Missing names can fall back to instruction position in the chart, and missing log measurements can fall back to the scheduled reserve estimate (app/…/BaseSimulatorCUProfilingCard.stories.tsx• L23-77).
Requested compute units are separate from units consumed. The estimate reads an explicit compute-budget limit when present. Otherwise it sums program reserve values and caps the result at the runtime maximum. Version 1 messages carry the limit in message configuration. Older forms can carry it in compute-budget instructions (app/…/compute-units-schedule.ts• L101-137, app/…/compute-units-schedule.ts• L170-221). The compute-budget card makes the requested limit, price, heap frame, and loaded-account data limit readable as instruction details (app/…/ComputeBudgetDetailsCard.tsx• L19-47).
References: app/…/use-simulation-instruction-names.ts• L21-75 app/…/SimulatorCUProfilingCard.tsx• L7-35 app/…/SimulationCard.tsx• L79-105 app/…/SimulationCard.spec.tsx• L48-103 app/…/BaseSimulatorCUProfilingCard.stories.tsx• L23-77 app/…/compute-units-schedule.ts• L170-221 app/…/ComputeBudgetDetailsCard.tsx• L19-47
Change checklist
When these files or sections are changed, remember to consider these:
- A new built-in or package-backed decoder needs a program address, a stable parser label, and a card route. Keep the dispatcher result, card variant map, and raw fallback aligned.
- A decoder that supports several deployments must register every address. Preserve the distinction between full decoding, name-only output, and unknown output for deprecated or unsupported layouts.
- Cards that receive RPC-parsed values must distinguish canonical decoded fields from RPC fallback values. Matching type names alone are not enough for lookup-table, associated-token, and Token-2022 extension cards.
- Token amount enrichment must keep the token card's mint and token-account lookup aligned with the shared token-info entity. Preserve raw amount display when mint precision or symbol data is unavailable.
- System with-seed cards must keep displayed field names and values aligned with parsed variants. A missing seed or base account can make a valid operation hard to identify.
- Program Metadata content cards must keep instruction names, account roles, and payload source rules aligned with the wire decoder. Housekeeping instructions must still reach the IDL or unknown path.
- Buffer config lookup must keep direct declarations ahead of same-transaction metadata-copy inference. Preserve the account fingerprint so a later buffer version cannot reuse an old result.
- Program Metadata payload changes must preserve both inline and account-backed paths. Account reads need raw bytes. The raw tab must remain available when decoded content fails.
- Changes to IDL lookup or precedence affect both the transaction page and inspector. Preserve the Program Metadata-first, Anchor-first renderer, Codama fallback, and unknown-result behavior.
- IDL card changes must preserve the difference between a complete Codama instruction, an Anchor account/data decode failure, and a renderer failure. Keep account roles, nested groups, arguments, and instruction-scoped event placement aligned with the interface.
- IDL program-card changes must keep the selected source, program identity, program version, history link, and external tooling link aligned. A mismatched program address must remain blocked from display.
- Interactive IDL actions must keep cluster selection and Mainnet disclaimer behavior aligned. Preserve pending-action replacement, cancellation, cookie persistence, and immediate execution on non-Mainnet clusters.
- Interactive IDL instruction forms must keep nested account paths, type-based argument defaults, flattened call parameters, and prototype-safe handling of untrusted instruction names aligned.
- Changes to event extraction must keep top-level events on their own card and child events on the child card. Keep undecodable
Program data:payloads visible while filtering uncertainProgram log:payloads. - Changes to transaction instruction node assembly must preserve outer indexes, child order, unresolved placeholders, and the link between each node's program address and instruction value.
- Changes to inner-instruction trust rules must keep the cluster and slot check aligned with the point when the RPC began recording inner instructions.
- Changes to compiled-instruction or inner-instruction mapping must preserve the link between an outer instruction and its child instructions. Lookup-table addresses must be resolved before program names are assigned.
- Changes to raw instruction loading must preserve the difference between transaction and inspector surfaces. Do not retry after a completed fetch proves that top-level raw data is unavailable, and do not fetch raw data for inner instructions.
- Changes to simulation errors must keep logs useful for diagnosis while hiding balance changes that do not describe a reliable state.
- Changes to version 1 simulation handling must keep the wire form, cluster feature check, and loaded-account limit explanation aligned with the message version.
- Changes to simulation instruction naming must resolve lookup-table account keys before naming programs. Preserve compiled-instruction order and reject the full list when one program index is invalid.
- Changes to simulation profiling visibility must distinguish no logs from logs whose instruction rows are unavailable. Do not show an empty chart or an unnecessary warning.
- Changes to compute-unit row mapping must preserve one row per top-level instruction and ignore non-instruction log entries. A filtered instruction list can shift every later cost value.
- Changes to compute-unit reserve rules or epoch loading must account for cluster and epoch. Profiling must not use a schedule that does not apply to the recorded transaction.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Two parsers register the same program address | Dispatcher creation fails instead of choosing an unpredictable card | Duplicate registration check in the dispatcher |
| A known parser cannot match the instruction discriminator | The view shows a program-aware unknown result instead of a false decode | Unknown parser outcome and program-specific fallback card |
| A partially decoded instruction names an account that is not in the message | The instruction node cannot be built and the page shows an unknown placeholder at its original position | Account-key resolution and undefined-node rendering |
| Inner instructions are supplied for a mainnet slot before recording began | The page could show child calls as if the chain had recorded them | Cluster and slot trust check |
| A package decoder receives a deprecated deployment or unsupported layout | The card shows a name when possible or raw data instead of false fields | Deployment checks, name-only results, and raw fallback |
| RPC data has a supported type label but lacks canonical decoder fields | A card could show structured data that the application did not decode | Feature-card field validation |
| Raw data is requested from an inspector or inner-instruction card | The view can issue a request that cannot produce transaction wire data | Surface-aware raw loading and inner-instruction guard |
| Token mint or account data is not available during card rendering | The amount stays in raw units or has no symbol instead of showing a false formatted value | Token card fallback to raw amount and optional token-info lookup |
| A Program Metadata instruction has no inline payload | The card cannot show content until it reads the metadata or source-buffer account | Account-backed raw-byte path with loading and failure states |
| A buffer config scan reaches its signature limit or fails | Labels may be missing, but byte-based decoding can still continue | Bounded newest-first scan and union result with a fallback path |
| A payload fails to decode or expands past the safe render limit | The decoded panel cannot show the document | Keep raw bytes available and bound decoded content |
| An IDL names a different program address | The IDL path shows an unknown result instead of applying the wrong interface | Program address match check and safe decode wrapper |
| The selected program IDL does not match the viewed program | The program IDL card hides the interface instead of offering unsafe content or tooling | Program identity check before rendering the selected IDL |
| An interactive IDL transaction action runs on Mainnet without prior acceptance | A user can start a real-funds action without seeing the required disclaimer | Mainnet confirmation gate with persisted acceptance |
| An instruction name from an IDL is used as an unsafe object key | Form defaults can write onto shared object prototypes and corrupt later form or application state | Own-property guard when creating argument defaults |
| A simulated program index is outside the resolved account-key list | Profiling rows cannot be trusted because later log values would attach to the wrong instruction | Reject the full name list and show profiling as unavailable |
| A simulation has no parsed log entries | The page can show an empty profiling chart or an explanation for a feature that has no input | Render neither the chart nor the unavailable message |
An Anchor event cannot decode from Program data: | The event stays visible without named fields | Preserve the raw event payload |
| Simulation returns an error with logs | Logs remain useful but balance changes may not describe a committed state | Keep logs and hide SOL and token cards on error |
| A cluster lacks version 1 support | RPC reports an unsupported-version failure that can look like a transaction fault | Check the cluster feature gate for failed version 1 simulations |
| A version 1 message exceeds the loaded-account data limit | RPC reports a size failure without the full cause | Explain measured account data when possible and preserve the raw failure when not |
| Compute-unit logs have no measured value for an instruction | The chart has no direct runtime cost for that segment | Show a bounded default or reserved estimate as approximate |
| The epoch schedule is unavailable for a confirmed transaction | The chart cannot select the correct historical reserve values | Show profiling as unavailable |
Key files
| File | Why to read it |
|---|---|
| app/…/instruction-parser-dispatcher.ts | Shows the application-wide set of built-in and package-backed instruction parsers. |
| packages/…/dispatcher.ts | Defines parser routing and unknown results. |
| app/…/provider.tsx | Shows how transaction views receive the shared dispatcher. |
| app/…/instruction-nodes.ts | Shows how parsed, partially decoded, outer, and inner instructions become a shared node tree. |
| app/…/InstructionsSection.tsx | Shows how trusted transaction data enters the instruction surface. |
| app/…/InstructionNodeCards.tsx | Shows how node order and unresolved instruction placeholders reach cards. |
| app/…/InstructionCard.tsx | Shows how transaction and inspector cards obtain raw instruction data. |
| app/…/define-instruction-card.tsx | Shows the shared shape for ordinary instruction cards. |
| app/…/InstructionsSection.tsx | Shows the inspector's card precedence and IDL fallback. |
| packages/…/decode-instructions.ts | Shows the decode cascade for outer and inner instructions. |
| app/…/TokenDetailsCard.tsx | Shows how token cards format amounts and optionally add mint precision and symbols. |
| app/…/fetch-token-infos-from-api.ts | Shows the shared browser lookup used to enrich token instruction amounts. |
| app/…/types.ts | Shows the validated operation set for Token and Token-2022 parsed instructions. |
| app/…/decode-pmp-instruction.ts | Shows how Program Metadata instructions identify inline, account-backed, and unsupported content paths. |
| app/…/use-resolve-buffer-config.ts | Shows how Buffer account bytes and on-chain transaction history provide decode configuration. |
| app/…/use-idl-instruction-decode.ts | Shows shared IDL selection for transaction and inspector views. |
| app/…/decode-instruction-with-idl.ts | Shows the Codama and Anchor decode choices and safe unknown fallback. |
| app/…/IdlInstructionCard.tsx | Shows how IDL results select Codama or Anchor cards and recover to an unknown card. |
| app/…/CodamaInstructionCard.tsx | Shows the user-facing fields and safety checks for Codama instruction results. |
| app/…/AnchorDetailsCard.tsx | Shows how Anchor instruction cards attach events from the matching log scope. |
| app/…/AnchorInstructionBody.tsx | Shows how Anchor account groups and instruction arguments become readable rows. |
| app/…/ProgramEventsCard.tsx | Shows structured and raw event presentation. |
| app/…/IdlCard.tsx | Shows the selected program IDL, source identity, mismatch guard, and links to related IDL tools. |
| app/…/use-mainnet-confirmation.ts | Shows the cluster-aware safety gate for interactive Mainnet actions. |
| app/…/ClusterSelector.tsx | Shows how the interactive IDL view exposes the selected cluster and Mainnet warning. |
| app/…/use-instruction-form.ts | Shows how IDL account and argument fields become safe values for calls and simulations. |
| app/…/use-instruction-form.spec.ts | Shows the safety guarantee for untrusted instruction names and the flattening contract for nested form values. |
| app/…/serum-parser.ts | Shows full, name-only, and unknown package-backed DEX results. |
| app/…/mango-parser.ts | Shows name-only decoding for Mango instructions. |
| app/…/token-swap-parser.ts | Shows name-only Token Swap decoding and stale-table reporting. |
| app/…/wormhole-parser.ts | Shows name-only Wormhole decoding and raw fallback. |
| app/…/use-simulation.ts | Shows simulation state and request identity. |
| app/…/use-simulation-instruction-names.ts | Shows how simulation rows resolve program names and preserve profiling order. |
| app/…/simulate-transaction.ts | Shows simulation inputs, version checks, account-limit explanation, and result groups. |
| app/…/SimulationCard.tsx | Shows how logs, errors, balances, and profiling are presented together. |
| app/…/BaseSimulatorCUProfilingCard.tsx | Shows how simulation rows and logs enter the shared compute-unit chart. |
| app/…/compute-units-schedule.ts | Shows how compute estimates depend on message form, cluster, and epoch. |
| app/…/format-instruction-logs.ts | Shows how logs become per-instruction profiling data. |
| app/…/BaseCUProfilingCard.tsx | Shows the shared visual model for measured and estimated compute use. |