Skip to content

Support legacy BPF loaders (v1/v2) in get-program-hash#230

Open
meumar-osec wants to merge 1 commit intoEllipsis-Labs:masterfrom
otter-sec:fix/get-program-hash-legacy-loader
Open

Support legacy BPF loaders (v1/v2) in get-program-hash#230
meumar-osec wants to merge 1 commit intoEllipsis-Labs:masterfrom
otter-sec:fix/get-program-hash-legacy-loader

Conversation

@meumar-osec
Copy link

Fixes #216

Programs deployed with BPF loader v1/v2 (e.g, SPL Token TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA) store executable in the program account's data. Whereas an upgradeable loader (loader-v3) stores the executable in a separate program data account.

Previously, get-program-hash only supported the upgradeable loader (loader-v3) and would fail when called on programs deployed with legacy loaders (v1/v2). Now handling both cases:

  • Detects the program’s loader via the account owner
  • Handling upgradeable (loader-v3) programs by reading the ProgramData account
  • Handling legacy (v1/v2) programs by hashing the program account’s data directly

@meumar-osec meumar-osec changed the title fix: get-program-hash for programs on legacy BPF loaders Support legacy BPF loaders (v1/v2) in get-program-hash Feb 18, 2026
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.

Handle programs owned by loaders older than loader-v3

1 participant