diff --git a/svm/src/transaction_processor.rs b/svm/src/transaction_processor.rs index 8c3190fcd2ad3d..0013dbc485b2ee 100644 --- a/svm/src/transaction_processor.rs +++ b/svm/src/transaction_processor.rs @@ -543,7 +543,7 @@ impl TransactionBatchProcessor { }) .collect(); - let mut loaded_programs_for_txs = None; + let mut loaded_programs_for_txs: Option = None; loop { let (program_to_store, task_cookie, task_waiter) = { // Lock the global cache. @@ -584,6 +584,7 @@ impl TransactionBatchProcessor { }; if let Some((key, program)) = program_to_store { + loaded_programs_for_txs.as_mut().unwrap().loaded_missing = true; let mut program_cache = self.program_cache.write().unwrap(); // Submit our last completed loading task. if program_cache.finish_cooperative_loading_task(self.slot, key, program) @@ -1334,6 +1335,7 @@ mod tests { let mut account_maps: HashMap = HashMap::new(); account_maps.insert(key, 4); + let mut loaded_missing = 0; for limit_to_load_programs in [false, true] { let result = batch_processor.replenish_program_cache( @@ -1343,12 +1345,17 @@ mod tests { limit_to_load_programs, ); assert!(!result.hit_max_limit); + if result.loaded_missing { + loaded_missing += 1; + } + let program = result.find(&key).unwrap(); assert!(matches!( program.program, ProgramCacheEntryType::FailedVerification(_) )); } + assert!(loaded_missing > 0); } #[test]