Skip to content

Support any program loader in getProgramAuthority - #106

Merged
lorisleiva merged 1 commit into
mainfrom
fix/support-any-loader-in-get-program-authority
Aug 18, 2026
Merged

Support any program loader in getProgramAuthority#106
lorisleiva merged 1 commit into
mainfrom
fix/support-any-loader-in-get-program-authority

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

This PR fixes non-canonical metadata writes for programs owned by loaders other than v1, v2 or v3 — e.g. native programs such as ComputeBudget111... — which currently fail with Unsupported loader program: NativeLoader1111... before the --non-canonical option is even considered.

The JS client now mirrors the on-chain authority check: loader-v3 programs resolve their upgrade authority via the program data account, while programs with any other owner (loader v1, v2, v4, the native loader, etc.) resolve to the program's own address as authority, matching is_program_authority in the on-chain program. Note that canonical metadata for native programs remains impossible by design, since nobody can sign as a native program.

The unused LOADER_V1_PROGRAM_ADDRESS, LOADER_V2_PROGRAM_ADDRESS and LOADER_V4_PROGRAM_ADDRESS exports are removed, which is a breaking change for the next release. New tests cover authority resolution for loader-v3 programs, native programs and non-executable accounts.

This fixes non-canonical metadata writes for programs owned by loaders other than v1, v2 or v3 — e.g. native programs such as ComputeBudget — by mirroring the on-chain authority check instead of rejecting unknown loaders. Removes the unused LOADER_V1_PROGRAM_ADDRESS, LOADER_V2_PROGRAM_ADDRESS and LOADER_V4_PROGRAM_ADDRESS exports.
@lorisleiva
lorisleiva merged commit e12e8d9 into main Aug 18, 2026
21 checks passed
@lorisleiva
lorisleiva deleted the fix/support-any-loader-in-get-program-authority branch August 18, 2026 11:59
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.

1 participant