Print bank hash and hash inputs. (#7733) (#7734)

automerge
This commit is contained in:
mergify[bot]
2020-01-09 17:13:31 -08:00
committed by Grimes
parent 9c9a690d0d
commit 2509002fe4
2 changed files with 11 additions and 3 deletions

View File

@ -1102,7 +1102,6 @@ impl ReplayStage {
slot_full_senders: &[Sender<(u64, Pubkey)>], slot_full_senders: &[Sender<(u64, Pubkey)>],
) { ) {
bank.freeze(); bank.freeze();
info!("bank frozen {}", bank.slot());
slot_full_senders.iter().for_each(|sender| { slot_full_senders.iter().for_each(|sender| {
if let Err(e) = sender.send((bank.slot(), *bank.collector_id())) { if let Err(e) = sender.send((bank.slot(), *bank.collector_id())) {
trace!("{} slot_full alert failed: {:?}", my_pubkey, e); trace!("{} slot_full alert failed: {:?}", my_pubkey, e);

View File

@ -1615,12 +1615,21 @@ impl Bank {
let accounts_delta_hash = self.rc.accounts.bank_hash_at(self.slot()); let accounts_delta_hash = self.rc.accounts.bank_hash_at(self.slot());
let mut signature_count_buf = [0u8; 8]; let mut signature_count_buf = [0u8; 8];
LittleEndian::write_u64(&mut signature_count_buf[..], self.signature_count() as u64); LittleEndian::write_u64(&mut signature_count_buf[..], self.signature_count() as u64);
hashv(&[ let hash = hashv(&[
self.parent_hash.as_ref(), self.parent_hash.as_ref(),
accounts_delta_hash.as_ref(), accounts_delta_hash.as_ref(),
&signature_count_buf, &signature_count_buf,
self.last_blockhash().as_ref(), self.last_blockhash().as_ref(),
]) ]);
info!(
"bank frozen: {} hash: {} accounts_delta: {} signature_count: {} last_blockhash: {}",
self.slot(),
hash,
accounts_delta_hash,
self.signature_count(),
self.last_blockhash()
);
hash
} }
/// Recalculate the hash_internal_state from the account stores. Would be used to verify a /// Recalculate the hash_internal_state from the account stores. Would be used to verify a