From c8ff51176fe5ec3c35a3351b5ec32b63826ed88b Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Wed, 28 Feb 2024 22:03:30 +0000 Subject: [PATCH] comment on serialization --- accounts-db/src/accounts_hash.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/accounts-db/src/accounts_hash.rs b/accounts-db/src/accounts_hash.rs index f39e9deff4b047..77b0504e1f457d 100644 --- a/accounts-db/src/accounts_hash.rs +++ b/accounts-db/src/accounts_hash.rs @@ -1272,6 +1272,15 @@ const _: () = assert!(std::mem::size_of::() == 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;