From 77daab497df191ef485a7ad36ed291c1874596e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Sat, 18 May 2024 02:50:35 +0200 Subject: [PATCH] v1.17 - Adds error log for replacements in ProgramCache::assign_program(). (#1400) Adds error log for replacements in ProgramCache::assign_program(). --- program-runtime/src/loaded_programs.rs | 9 +++++++-- runtime/src/bank.rs | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/program-runtime/src/loaded_programs.rs b/program-runtime/src/loaded_programs.rs index 0e49663843ca0d..2e3b31044a413b 100644 --- a/program-runtime/src/loaded_programs.rs +++ b/program-runtime/src/loaded_programs.rs @@ -677,8 +677,13 @@ impl LoadedPrograms { (false, entry) } else { // Something is wrong, I can feel it ... + let existing = existing.clone(); + error!( + "ProgramCache::assign_program() failed key={:?} existing={:?} entry={:?}", + key, slot_versions, entry + ); self.stats.replacements.fetch_add(1, Ordering::Relaxed); - (true, existing.clone()) + (true, existing) } } Err(index) => { @@ -699,7 +704,7 @@ impl LoadedPrograms { entry: Arc, ) -> (bool, Arc) { let (was_occupied, entry) = self.replenish(key, entry); - debug_assert!(!was_occupied); + debug_assert!(!was_occupied, "Unexpected replacement of an entry"); (was_occupied, entry) } diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 9a3c25b4b8ee85..968c4884d474b6 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -5223,6 +5223,7 @@ impl Bank { )); if programs_loaded_for_tx_batch.borrow().hit_max_limit { + error!("Discarding TX batch {:#?}", batch.sanitized_transactions()); return LoadAndExecuteTransactionsOutput { loaded_transactions: vec![], execution_results: vec![],