Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solana-test-validator --upgradeable-program #30412

Merged
merged 2 commits into from
Feb 23, 2023

Conversation

CriesofCarrots
Copy link
Contributor

@CriesofCarrots CriesofCarrots commented Feb 20, 2023

Problem

#29051 attempted to default solana-test-validator --bpf-program to use the upgradeable loader, but had to be reverted. But the issue remains that most people want to use the upgradeable loader, and the only way to do that with solana-test-validator is clone from another cluster.

Summary of Changes

Add --upgradeable-program flag to automatically initialize solana-test-validator with an upgradeable program. Parallels #29994
I added this as a separate path from the existing param because I thought it would be cool to support an optional upgrade authority, which would break the existing --bpf-program interface. However, we could make --bpf-program an alias for --upgradeable-program <PROGRAM_ID> <PROGRAM.SO> none. What do you think?
If you like that idea, I can remove a bunch of the duplication here, and switch from ProgramInfo to UpgradeableProgramInfo everywhere.

joncinque
joncinque previously approved these changes Feb 21, 2023
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! Since the SPL programs that use the old loader are already included with the correct loader, it seems right to have --bpf-loader alias to --upgradeable-loader. I'm going to take a quick look through the Anchor repo to make sure that this won't break something in their testing framework using anchor test.

validator/src/cli.rs Outdated Show resolved Hide resolved
@joncinque
Copy link
Contributor

I can't find any references to the exact loader address anywhere in the Anchor repo, so I think it'll be safe to make the aliasing change. Just in case though, can you do it in a separate PR so we can easily revert it if needed?

@CriesofCarrots
Copy link
Contributor Author

I can't find any references to the exact loader address anywhere in the Anchor repo, so I think it'll be safe to make the aliasing change. Just in case though, can you do it in a separate PR so we can easily revert it if needed?

Yep, that sounds like a plan. Thanks for checking on that!

joncinque
joncinque previously approved these changes Feb 21, 2023
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, thanks!

@CriesofCarrots
Copy link
Contributor Author

Sorry @joncinque , can I get one last ✅ ? I force pushed to pick up the test fix.

joncinque
joncinque previously approved these changes Feb 23, 2023
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.

Sorry for the lateness, looks good again!

@CriesofCarrots
Copy link
Contributor Author

Sorry for the lateness, looks good again!

Lol, sorry!! I was just rebasing on #29893... I'm going to need one more 🙏

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label Feb 23, 2023
@mergify mergify bot merged commit fbd8ef5 into solana-labs:master Feb 23, 2023
nickfrosty pushed a commit to nickfrosty/solana that referenced this pull request Mar 12, 2023
* Add TestValidator handling for upgradeable programs

* Plumb --upgradeable-program for solana-test-validator
vadorovsky pushed a commit to Lightprotocol/solana that referenced this pull request May 14, 2023
* Add TestValidator handling for upgradeable programs

* Plumb --upgradeable-program for solana-test-validator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants