Skip to content

Commit

Permalink
Print bank hash and hash inputs. (solana-labs#7733) (solana-labs#7734)
Browse files Browse the repository at this point in the history
automerge
  • Loading branch information
mergify[bot] authored and sakridge committed Jan 14, 2020
1 parent 106c337 commit a05d1dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,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);
Expand Down
13 changes: 11 additions & 2 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,12 +1615,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
Expand Down

0 comments on commit a05d1dc

Please sign in to comment.