Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

solana-genesis: add support for initializing upgradeable programs #29994

Merged
merged 5 commits into from
Jan 31, 2023

Conversation

CriesofCarrots
Copy link
Contributor

Problem

spl-token-2022 was recently added to the set of spl programs that are by default loaded into ProgramTest, test validators, and test clusters (#29878). However, the test-cluster deployment does not completely mimic that on live clusters, because it uses the non-upgradeable BPFLoader2. It is not currently possible to include upgradeable programs in genesis.

Summary of Changes

  • Add an --upgradeable-program parameter to solana-genesis, which automatically creates and populates a program-data account along with the executable program account, both owned by BPFLoaderUpgradeable.
  • Use upgradeable loader for spl-token-2022 in fetch-spl.sh
  • Support setting a custom upgrade authority - I'm a bit ambivalent on this bit. I haven't seen anyone express this need, but it seemed like it might be useful to be able to load an upgradeable program in genesis, but subsequently upgrade it to test out changes.

Copy link
Contributor

@mvines mvines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable to me!

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants