Skip to content

Commit f6c5c61

Browse files
committed
comments
1 parent d687a2c commit f6c5c61

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

accounts-db/src/accounts_hash.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,12 @@ impl<'a> AccountsHasher<'a> {
540540
(num_hashes_per_chunk, levels_hashed, three_level)
541541
}
542542

543-
// This function is designed to allow hashes to be located in multiple, perhaps multiply deep vecs.
544-
// The caller provides a function to return a vec of hash from the source data.
543+
// This function is called at the top lover level to compute the merkle. It
544+
// takes a closure that returns an owned vec of hash data at the leaf level
545+
// of the merkle tree. The input data for this bottom level are read from a
546+
// file. For non-leaves nodes, where the input data is already in memory, we
547+
// will use `compute_merkle_root_from_slices`, which is a version that takes
548+
// a borrowed slice of hash data instead.
545549
fn compute_merkle_root_from_start<F, T>(
546550
total_hashes: usize,
547551
fanout: usize,
@@ -572,7 +576,6 @@ impl<'a> AccountsHasher<'a> {
572576
// initial fetch - could return entire slice
573577
let data_bytes = get_hash_slice_starting_at_index(0);
574578
let data: &[T] = bytemuck::cast_slice(&data_bytes);
575-
576579
let data_len = data.len();
577580

578581
let result: Vec<_> = (0..chunks)

0 commit comments

Comments
 (0)