Print bank hash and hash inputs. (#7733)

This commit is contained in:
sakridge 2020-01-09 16:33:10 -08:00 committed by GitHub
parent cf32fdf672
commit 73c93cc345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

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

View File

@ -1627,12 +1627,21 @@ impl Bank {
let accounts_delta_hash = self.rc.accounts.bank_hash_at(self.slot());
let mut signature_count_buf = [0u8; 8];
LittleEndian::write_u64(&mut signature_count_buf[..], self.signature_count() as u64);
hashv(&[
let hash = hashv(&[
self.parent_hash.as_ref(),
accounts_delta_hash.as_ref(),
&signature_count_buf,
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