From 1cae9fd893f68409c4dc3240fb69610b7a8d086b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2020 12:04:34 -0800 Subject: [PATCH] Better surface bank hash verification failures (#8134) automerge --- 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 cc7db33b13..33f08b2888 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -370,7 +370,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 abf56ef8a9..9759b1032d 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -1065,6 +1065,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 {