From 1467b7a4a77b49189cd49dbf51180f08bf50dbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Tue, 27 Aug 2024 16:54:44 +0200 Subject: [PATCH] Disables new deployments on loader-v3 when the feature enable_loader_v4 is enabled. --- programs/bpf_loader/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index 395b0581dc375c..500bbbf35fa1dd 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -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}, @@ -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)?,