Skip to content

Commit

Permalink
v2.1: test-validator: Fix upgradeable programs at genesis (backport of
Browse files Browse the repository at this point in the history
…#3692) (#3694)

test-validator: Fix upgradeable programs at genesis (#3692)

#### Problem

As noted in
https://solana.stackexchange.com/questions/17478/solana-localnet-error-while-upgrading-a-program-loaded-at-genesis-using-solan,
an upgradeable program loaded at genesis is not actually upgradeable,
failing with `instruction changed executable accounts data`. This is
because the program-data account is incorrectly set as "executable",
which it isn't really.

#### Summary of changes

Don't set the program-data account as executable. This is the only place
in the repo where we were doing this incorrectly.

(cherry picked from commit 73f54a0)

Co-authored-by: Jon C <[email protected]>
  • Loading branch information
mergify[bot] and joncinque authored Nov 18, 2024
1 parent 3bbabb3 commit 0e50e66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ impl TestValidator {
lamports: Rent::default().minimum_balance(program_data.len()).max(1),
data: program_data,
owner: upgradeable_program.loader,
executable: true,
executable: false,
rent_epoch: 0,
}),
);
Expand Down

0 comments on commit 0e50e66

Please sign in to comment.