Skip to content

Commit

Permalink
[wip]: Bring back executable check on program data account
Browse files Browse the repository at this point in the history
This was fixed on the latest patch versions of `2.1`.
  • Loading branch information
lorisleiva committed Jan 22, 2025
1 parent 5cc08d4 commit 809817c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["program"]

[workspace.metadata.cli]
solana = "2.1.0"
solana = "2.1.9"

# Specify Rust toolchains for rustfmt, clippy, and build.
# Any unprovided toolchains default to stable.
Expand Down
7 changes: 7 additions & 0 deletions clients/js/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ async function getProgramAuthorityForLoaderV3(
const programDataAccount = await fetchEncodedAccount(rpc, programData);
assertAccountExists(programDataAccount);

// Ensure the program data account is not executable.
if (programDataAccount.executable) {
throw Error(
'The data account associated with the program account must not be executable'
);
}

// Decode the program and program data accounts.
const [programDecoder, programDataDecoder] = getLoaderV3Decoders();
const programAccountData = programDecoder.decode(programAccount.data);
Expand Down

0 comments on commit 809817c

Please sign in to comment.