From 3ac0192d4021a81f60ecdeddb01c8a8b8ce15182 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 5 Feb 2020 10:21:19 -0700 Subject: [PATCH] Better surface bank hash verification failures --- runtime/src/accounts.rs | 7 ++++++- runtime/src/accounts_db.rs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index c55e9b18b8..a09d7429d9 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -375,7 +375,12 @@ impl Accounts { } pub fn verify_bank_hash(&self, slot: Slot, ancestors: &HashMap) -> bool { - self.accounts_db.verify_bank_hash(slot, ancestors).is_ok() + if let Err(err) = self.accounts_db.verify_bank_hash(slot, ancestors) { + warn!("verify_bank_hash failed: {:?}", err); + false + } else { + true + } } pub fn load_by_program( diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 311983e67d..9f40734aa2 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -1071,6 +1071,10 @@ impl AccountsDB { if calculated_hash == found_hash_info.hash { Ok(()) } else { + warn!( + "mismatched bank hash for slot {}: {} (calculated) != {} (expected)", + slot, calculated_hash, found_hash_info.hash + ); Err(MismatchedBankHash) } } else {