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 b9cda0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6411,7 +6411,7 @@ impl Bank {
}
);
info!(
"lt_hash: {}",
"lt_hash: {:?}",
self.accumulated_accounts_hash.read().unwrap()
);
hash
Expand Down

0 comments on commit b9cda0a

Please sign in to comment.