chore: rework IDL card and simplify IDL resolution#1115
Merged
Conversation
|
@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryThis PR reworks the program IDL view and simplifies shared IDL resolution. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (5): Last reviewed commit: "chore: reconcile IDL rework with master ..." | Re-trigger Greptile |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rogaldh
reviewed
Jun 26, 2026
rogaldh
reviewed
Jun 26, 2026
rogaldh
reviewed
Jun 26, 2026
rogaldh
reviewed
Jun 26, 2026
rogaldh
reviewed
Jun 26, 2026
mikhd
reviewed
Jun 29, 2026
mikhd
approved these changes
Jun 29, 2026
- Replace per-source IDL tabs with a single view: the latest PMP IDL, falling back to the on-chain Anchor IDL (flagged via a tooltip) only when no PMP IDL exists. - Remove the NEXT_PUBLIC_PMP_IDL_ENABLED and NEXT_PUBLIC_PMP_SECURITY_TXT_ENABLED feature flags (PMP resolution is always on). - Add an "IDL history" link to idl.solana.com in the card header. - Simplify resolution: drop the includeAnchor/includePmp args and the preferredVariant field, and merge the duplicate result types into ProgramIdlPair. - Move useProgramIdls into the idl entity and share it across the card, the Anchor tx decoder (useAnchorProgram), and the program-name label; delete the now-redundant useIdlFromAnchorProgramSeed hook. - Trim dead barrel/server exports and the unused cluster @x/program-metadata slice.
- Add a metadata block under the badge: the IDL storage account (linked + copyable via the shared AddressLink), the source (PMP / Anchor), and the program's own version. - Surface the IDL storage-account address — already returned by @solana/idl but previously discarded — through the resolver, the /api/idl-latest route, the fetch/client resolvers, and useProgramIdls. - Rework the badge to show the IDL standard + format (encoding) version: "Codama (version 1.5.1)", "Anchor 0.30.1 (version 0.1.0)", or "Anchor (legacy)". Add getIdlBadgeLabel + getIdlProgramVersion (the program semver, distinct from the spec/era label getIdlVersion returns). - Add an `info` slot to IdlSection for the metadata block.
- Unify ResolvedProgramIdls/ProgramIdlPair via a ProgramIdlSources<IdlContent> generic; relocate resolution shapes to api/types.ts and the foundational IDL aliases to lib/types.ts, giving a clean model -> api -> lib dependency flow. - Group the entity's Anchor-standard modules under model/anchor/. - Add a useProgramIdls test for the MainnetBeta + localhost direct-RPC path. - Add a gen.vanityAddress() fixture helper and use it in IdlCard.spec. - Drop a stale unicorn/no-null exclude for the deleted seed hook.
Rebasing the IDL cleanup onto master surfaced two reconciliation points with solana-foundation#1119 (program-metadata instruction parsing + idl-latest retry): - Re-export getProvider from the @entities/idl barrel. The rework moved it into model/anchor/anchor-provider.ts and dropped it from the barrel as dead, but solana-foundation#1119 added a cross-feature consumer (features/decode-instruction-with-idl), so it is public API again. - Adapt solana-foundation#1119's two idl-latest retry tests (premature-close, nested cause) to the simplified resolver shape — drop the removed preferredVariant / IdlVariant from their mock payloads. The retry wrapper itself is kept.
rogaldh
approved these changes
Jun 30, 2026
Woody4618
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reworks the program IDL card to a single, source-agnostic view, adds an at-a-glance metadata block under the badge, and removes the PMP feature flags.
metadata.spec:Codama (version 1.5.1),Anchor 0.30.1 (version 0.1.0), orAnchor (legacy).AddressLink.PMPorAnchor.program.versionfor Codama,metadata.version/ legacy top-levelversionfor Anchor), kept distinct from the format version shown in the badge.idl.solana.com) for the full history across all sources.NEXT_PUBLIC_PMP_IDL_ENABLEDandNEXT_PUBLIC_PMP_SECURITY_TXT_ENABLEDfeature flags — PMP IDL and security.txt resolution are now always on (the security.txt path keeps its Neodyme ELF fallback).includeAnchor/includePmpoptions and thepreferredVariantfield, merges the duplicate result types into oneProgramIdlPair(now also carrying each source's storage-account address, threaded from@solana/idl— which already returns it — through the resolver, the/api/idl-latestroute, anduseProgramIdls), movesuseProgramIdlsinto theidlentity so the card, the Anchor tx-decoder, and the program-name label share one cached resolution, and removes the now-redundantuseIdlFromAnchorProgramSeedhook plus dead exports.Net ~250 fewer lines; the tx-inspector routes drop ~10 kB First Load JS (one fewer IDL hook on the decoder path — see
bench/BUILD.md).Type of change
Screenshots
Testing
Automated:
pnpm lint,pnpm typecheck,pnpm build, andpnpm testpass locally; IDL card / resolver / hook specs added or updated — including the badge label, the program-version accessor, and the storage-address threading through the resolver and the/api/idl-latestroute.Manual (Vercel preview):
Related Issues
Closes HOO-711
Checklist
pnpm test,pnpm lint,pnpm typecheck)build:infoscript to update build information