Skip to content

Commit

Permalink
Disables new deployments on loader-v3 when the feature enable_loader_…
Browse files Browse the repository at this point in the history
…v4 is enabled.
  • Loading branch information
Lichtso committed Jan 15, 2025
1 parent 6dd8c7f commit 1467b7a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use {
solana_compute_budget::compute_budget::MAX_INSTRUCTION_STACK_DEPTH,
solana_feature_set::{
bpf_account_data_direct_mapping, enable_bpf_loader_set_authority_checked_ix,
remove_accounts_executable_flag_checks,
enable_loader_v4, remove_accounts_executable_flag_checks,
},
solana_instruction::{error::InstructionError, AccountMeta},
solana_log_collector::{ic_logger_msg, ic_msg, LogCollector},
Expand Down Expand Up @@ -564,6 +564,14 @@ fn process_loader_upgradeable_instruction(
)?;
}
UpgradeableLoaderInstruction::DeployWithMaxDataLen { max_data_len } => {
if invoke_context
.get_feature_set()
.is_active(&enable_loader_v4::id())
{
ic_logger_msg!(log_collector, "Unsupported instruction");
return Err(InstructionError::InvalidInstructionData);
}

instruction_context.check_number_of_instruction_accounts(4)?;
let payer_key = *transaction_context.get_key_of_account_at_index(
instruction_context.get_index_of_instruction_account_in_transaction(0)?,
Expand Down

0 comments on commit 1467b7a

Please sign in to comment.