Gate CPI authorized programs (#14361)
This commit is contained in:
		@@ -17,8 +17,9 @@ use solana_sdk::{
 | 
			
		||||
    bpf_loader_upgradeable::{self, UpgradeableLoaderState},
 | 
			
		||||
    entrypoint::{MAX_PERMITTED_DATA_INCREASE, SUCCESS},
 | 
			
		||||
    feature_set::{
 | 
			
		||||
        pubkey_log_syscall_enabled, ristretto_mul_syscall_enabled, sha256_syscall_enabled,
 | 
			
		||||
        sol_log_compute_units_syscall, try_find_program_address_syscall_enabled,
 | 
			
		||||
        limit_cpi_loader_invoke, pubkey_log_syscall_enabled, ristretto_mul_syscall_enabled,
 | 
			
		||||
        sha256_syscall_enabled, sol_log_compute_units_syscall,
 | 
			
		||||
        try_find_program_address_syscall_enabled,
 | 
			
		||||
    },
 | 
			
		||||
    hash::{Hasher, HASH_BYTES},
 | 
			
		||||
    instruction::{AccountMeta, Instruction, InstructionError},
 | 
			
		||||
@@ -1424,7 +1425,9 @@ fn call<'a>(
 | 
			
		||||
    let (message, callee_program_id, program_id_index) =
 | 
			
		||||
        MessageProcessor::create_message(&instruction, &keyed_account_refs, &signers)
 | 
			
		||||
            .map_err(SyscallError::InstructionError)?;
 | 
			
		||||
    check_authorized_program(&callee_program_id)?;
 | 
			
		||||
    if invoke_context.is_feature_active(&limit_cpi_loader_invoke::id()) {
 | 
			
		||||
        check_authorized_program(&callee_program_id)?;
 | 
			
		||||
    }
 | 
			
		||||
    let (mut accounts, mut account_refs) = syscall.translate_accounts(
 | 
			
		||||
        &message.account_keys,
 | 
			
		||||
        program_id_index,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user