Skip to content

Commit

Permalink
comment on serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Feb 29, 2024
1 parent 4b05a69 commit 2edc9e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 9 additions & 0 deletions accounts-db/src/accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,15 @@ const _: () = assert!(std::mem::size_of::<AccountHash>() == std::mem::size_of::<
/// with zero lamport are treated to have the "identity" hash. add/sub such
/// element don't impact the accumulated hash.
///
/// ## Are we going to serialize/deserialize Lattice hash into DB storage?
/// This is an open question. Unlike 32 byte Hash, Lattice hash is 2K. Too
/// expensive to store on disk? Therefore, in current implementation, we don't
/// Serialize Lattice hash into disk. Lattice hash is just computed from the
/// account.
/// In future, when we decide to serialize Lattice hash, we can add
/// [Serialize, Deserialize, BorshSerialize, BorshDeserialize, BorshSchema]
/// to the struct.
///
/// Lattice hash
pub const LT_HASH_BYTES: usize = 2048;
pub const LT_HASH_ELEMENT: usize = 1024;
Expand Down
7 changes: 2 additions & 5 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6399,7 +6399,7 @@ impl Bank {
.get_bank_hash_stats(slot)
.expect("No bank hash stats were found for this bank, that should not be possible");
info!(
"bank frozen: {slot} hash: {hash} accounts_delta: {} signature_count: {} last_blockhash: {} capitalization: {}{}, stats: {bank_hash_stats:?}",
"bank frozen: {slot} hash: {hash} accounts_delta: {} signature_count: {} last_blockhash: {} capitalization: {}{}, lt_hash: {:?}, stats: {bank_hash_stats:?}",
accounts_delta_hash.0,
self.signature_count(),
self.last_blockhash(),
Expand All @@ -6408,10 +6408,7 @@ impl Bank {
format!(", epoch_accounts_hash: {:?}", epoch_accounts_hash.as_ref())
} else {
"".to_string()
}
);
info!(
"lt_hash: {}",
},
self.accumulated_accounts_hash.read().unwrap()
);
hash
Expand Down

0 comments on commit 2edc9e2

Please sign in to comment.