Skip to content

fix(idl): name the instructions of a legacy Anchor IDL - #1522

Merged
Woody4618 merged 2 commits into
solana-foundation:masterfrom
hoodieshq:fix/legacy-anchor-instruction-names
Nov 27, 2026
Merged

Woody4618 merged 2 commits into
solana-foundation:masterfrom
hoodieshq:fix/legacy-anchor-instruction-names

Conversation

@askov

@askov askov commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Names the instructions of a program with a legacy Anchor IDL in transaction history. A legacy Anchor IDL lists no instruction discriminators, so history showed Unknown Instruction for every instruction of such a program.

Changes

  • Converts a legacy Anchor IDL that lists no discriminators with formatSerdeIdl inside buildProgramIdlNames, so history names match the transaction page.
  • Passes the program address to buildProgramIdlNames, so a legacy IDL without metadata.address converts.
  • Keeps a legacy IDL that the converter rejects in its legacy form, so the history row stays unnamed and does not fail.

Behavior Changes

  • Transaction history names the instructions and the program of a legacy Anchor IDL, for example Player Profile: Add Keys, where it showed Unknown Program: Unknown Instruction.
  • The inspector's simulation and the transaction share image name these instructions in the same way.
  • The CU profiling card on the transaction page names these instructions in the same way, where it showed Instruction #N.
  • Transaction history shows the IDL name of a program with a legacy IDL where it showed the PROGRAM_INFO_BY_ID name, for example Account Compression where it showed ZK Account Compression Program.

Program header

The program header, the Program IDL tab and the account share image read only metadata.name, so they still do not show the top-level name of a legacy IDL. This PR changes the names in transaction history, the inspector, the transaction share image and the CU profiling card.

Type of change

  • Bug fix

Screenshots

Testing

Bug fixes

  • History names a legacy Anchor instruction on mainnet. Open the History tab of pprofELXjL5Kck7Jn5hCpwAL82DpTkSYBENzahVtbc9 on mainnet (localhost · production) and read the instruction names in the rows. Expect names such as Player Profile: Add Keys and Player Profile: Remove Keys. Production shows Unknown Program: Unknown Instruction.
    Cause: production builds history names only from the discriminator field of each instruction, and a legacy Anchor IDL has no such field.
  • History names a legacy Anchor instruction on devnet. Open the History tab of 2o48ieM95rmHqMWC5B3tTX4DL7cLm4m1Kuwjay3keQSv on devnet (localhost · production) and read the instruction names in the rows. Expect Solana Twentyfourtyeight: Push In Direction. Production shows Unknown Program: Unknown Instruction.
    Cause: the same missing discriminator field.

Regression checks

  • History names a modern Anchor instruction. Open the History tab of LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo on mainnet (localhost · production) and read the instruction names in the rows. Expect the same names as production.

Related Issues

Closes HOO-2982

Checklist

  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • All checks pass locally (pnpm test, pnpm lint, pnpm typecheck)
  • I have run build:info script to update build information

Additional Notes

A legacy Anchor IDL lists no discriminators, so the name table named none of its instructions.
Convert it with `formatSerdeIdl` before the table reads it, as the instruction decoder does.
@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge, with no new actionable issues found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no new actionable issues found.

Summary

This PR names legacy Anchor instructions by converting their IDLs before building display names.

  • Transaction views can show names from legacy Anchor IDLs.

No new actionable issues were found in the changes since the previous review.

Reviews (2) · Last reviewed commit: "test(idl): assert the names of a legacy ..." · Reviewed by Greptile

…rted

The rejected-IDL test checked only that nothing throws, and the no-spec
fixture listed the discriminators that the converter computes. Both tests
passed when buildProgramIdlNames dropped or converted the IDL.
@Woody4618
Woody4618 added this pull request to the merge queue Nov 27, 2026
Merged via the queue into solana-foundation:master with commit 86fb3d0 Nov 27, 2026
12 of 13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants