diff --git a/program-runtime/src/invoke_context.rs b/program-runtime/src/invoke_context.rs index b7cc077c286de9..a60d08b18cbfe2 100644 --- a/program-runtime/src/invoke_context.rs +++ b/program-runtime/src/invoke_context.rs @@ -232,10 +232,6 @@ impl<'a> InvokeContext<'a> { } } - pub fn find_program_in_cache(&self, pubkey: &Pubkey) -> Option> { - self.program_cache_for_tx_batch.find(pubkey) - } - pub fn get_environments_for_slot( &self, effective_slot: Slot, diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index ad99147b896a4a..dd8aa542213621 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -152,7 +152,7 @@ macro_rules! deploy_program { environments.program_runtime_v1.clone(), true, )?; - if let Some(old_entry) = $invoke_context.find_program_in_cache(&$program_id) { + if let Some(old_entry) = $invoke_context.program_cache_for_tx_batch.find(&$program_id) { executor.tx_usage_counter.store( old_entry.tx_usage_counter.load(Ordering::Relaxed), Ordering::Relaxed @@ -437,7 +437,8 @@ pub fn process_instruction_inner( let mut get_or_create_executor_time = Measure::start("get_or_create_executor_time"); let executor = invoke_context - .find_program_in_cache(program_account.get_key()) + .program_cache_for_tx_batch + .find(program_account.get_key()) .ok_or_else(|| { ic_logger_msg!(log_collector, "Program is not cached"); InstructionError::InvalidAccountData diff --git a/programs/loader-v4/src/lib.rs b/programs/loader-v4/src/lib.rs index 1ad66284a42e39..acf0255579d74e 100644 --- a/programs/loader-v4/src/lib.rs +++ b/programs/loader-v4/src/lib.rs @@ -449,7 +449,10 @@ pub fn process_instruction_deploy( state.slot = current_slot; state.status = LoaderV4Status::Deployed; - if let Some(old_entry) = invoke_context.find_program_in_cache(program.get_key()) { + if let Some(old_entry) = invoke_context + .program_cache_for_tx_batch + .find(program.get_key()) + { executor.tx_usage_counter.store( old_entry.tx_usage_counter.load(Ordering::Relaxed), Ordering::Relaxed, @@ -592,7 +595,8 @@ pub fn process_instruction_inner( } let mut get_or_create_executor_time = Measure::start("get_or_create_executor_time"); let loaded_program = invoke_context - .find_program_in_cache(program.get_key()) + .program_cache_for_tx_batch + .find(program.get_key()) .ok_or_else(|| { ic_logger_msg!(log_collector, "Program is not cached"); InstructionError::InvalidAccountData