Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Nov 15, 2024
1 parent d687a2c commit f6c5c61
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions accounts-db/src/accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,12 @@ impl<'a> AccountsHasher<'a> {
(num_hashes_per_chunk, levels_hashed, three_level)
}

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

let data_len = data.len();

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

0 comments on commit f6c5c61

Please sign in to comment.