v1.18: Test Validator: Set deployment slot to 0
for cloned upgradeable programs (backport of #501)
#518
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.
Problem
When an upgradeable program is cloned from another cluster into the test
validator's genesis config, its existing deployment slot is never modified. This
causes the program cache to fail when attempting to load this program.
On version 1.18, this is an error handled gracefully by the runtime:
The change at solana-labs#34407 seems to have been where the bug was introduced to 1.18. The error is caused by the snippets I mentioned here: #436 (comment)
However, on the current tip, this is actually a panic.
agave/program-runtime/src/loaded_programs.rs
Lines 789 to 791 in b1e1799
Summary of Changes
As we currently do with the SPL programs, when adding the programdata account
for a cloned upgradeable program, set the deployment slot to
0
.Closes #436
This is an automatic backport of pull request #501 done by Mergify.