From 7a8d3a9ffc9171ae0e376fb677b6b56e5ae9f176 Mon Sep 17 00:00:00 2001 From: Joe Caulfield Date: Tue, 18 Jun 2024 14:56:42 -0500 Subject: [PATCH] SVM: drop `get_program_match_critera` from callbacks --- runtime/src/bank.rs | 16 +--------------- svm/src/program_loader.rs | 2 +- svm/src/transaction_processing_callback.rs | 9 +-------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 787c5cca511366..9699bf41420e75 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -98,10 +98,7 @@ use { solana_perf::perf_libs, solana_program_runtime::{ invoke_context::BuiltinFunctionWithContext, - loaded_programs::{ - ProgramCacheEntry, ProgramCacheEntryOwner, ProgramCacheEntryType, - ProgramCacheMatchCriteria, - }, + loaded_programs::{ProgramCacheEntry, ProgramCacheEntryOwner, ProgramCacheEntryType}, timings::{ExecuteTimingType, ExecuteTimings}, }, solana_sdk::{ @@ -6794,17 +6791,6 @@ impl TransactionProcessingCallback for Bank { .map(|(acc, _)| acc) } - fn get_program_match_criteria(&self, program: &Pubkey) -> ProgramCacheMatchCriteria { - if self.check_program_modification_slot { - solana_svm::program_loader::get_program_modification_slot(self, program) - .map_or(ProgramCacheMatchCriteria::Tombstone, |slot| { - ProgramCacheMatchCriteria::DeployedOnOrAfterSlot(slot) - }) - } else { - ProgramCacheMatchCriteria::NoCriteria - } - } - // NOTE: must hold idempotent for the same set of arguments /// Add a builtin program account fn add_builtin_account(&self, name: &str, program_id: &Pubkey) { diff --git a/svm/src/program_loader.rs b/svm/src/program_loader.rs index 5cf3815a09fd30..f77780fc9fecfa 100644 --- a/svm/src/program_loader.rs +++ b/svm/src/program_loader.rs @@ -222,7 +222,7 @@ pub fn load_program_with_pubkey( /// Returns slot 0 for programs deployed with v1/v2 loaders, since programs deployed /// with those loaders do not retain deployment slot information. /// Returns an error if the program's account state can not be found or parsed. -pub fn get_program_modification_slot( +pub(crate) fn get_program_modification_slot( callbacks: &CB, pubkey: &Pubkey, ) -> transaction::Result { diff --git a/svm/src/transaction_processing_callback.rs b/svm/src/transaction_processing_callback.rs index bca549b12013cc..760a6606568798 100644 --- a/svm/src/transaction_processing_callback.rs +++ b/svm/src/transaction_processing_callback.rs @@ -1,7 +1,4 @@ -use { - solana_program_runtime::loaded_programs::ProgramCacheMatchCriteria, - solana_sdk::{account::AccountSharedData, pubkey::Pubkey}, -}; +use solana_sdk::{account::AccountSharedData, pubkey::Pubkey}; /// Runtime callbacks for transaction processing. pub trait TransactionProcessingCallback { @@ -9,9 +6,5 @@ pub trait TransactionProcessingCallback { fn get_account_shared_data(&self, pubkey: &Pubkey) -> Option; - fn get_program_match_criteria(&self, _program: &Pubkey) -> ProgramCacheMatchCriteria { - ProgramCacheMatchCriteria::NoCriteria - } - fn add_builtin_account(&self, _name: &str, _program_id: &Pubkey) {} }