diff --git a/programs/vote_api/src/vote_state.rs b/programs/vote_api/src/vote_state.rs index 549eccef90..64855afb24 100644 --- a/programs/vote_api/src/vote_state.rs +++ b/programs/vote_api/src/vote_state.rs @@ -145,10 +145,22 @@ impl VoteState { .iter() .any(|(slot, hash)| vote.slot == *slot && vote.hash == *hash) { - warn!( - "dropping vote {:?}, no matching slot/hash combination", - vote - ); + if log_enabled!(log::Level::Warn) { + for (slot, hash) in slot_hashes { + if vote.slot == *slot { + warn!( + "dropped vote {:?} matched slot {}, but not hash {:?}", + vote, *slot, *hash + ); + } + if vote.hash == *hash { + warn!( + "dropped vote {:?} matched hash {:?}, but not slot {}", + vote, *hash, *slot, + ); + } + } + } return; } diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 0f1a963f5d..9021555063 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -215,18 +215,22 @@ impl Bank { self.store(&slot_hashes::id(), &account); } - fn set_hash(&self) { + fn set_hash(&self) -> bool { let mut hash = self.hash.write().unwrap(); if *hash == Hash::default() { // freeze is a one-way trip, idempotent *hash = self.hash_internal_state(); + true + } else { + false } } pub fn freeze(&self) { - self.set_hash(); - self.update_slot_hashes(); + if self.set_hash() { + self.update_slot_hashes(); + } } pub fn epoch_schedule(&self) -> &EpochSchedule {