Skip to content

Commit

Permalink
perf: optimize get_peaks_and_heights for archival MMR.
Browse files Browse the repository at this point in the history
  • Loading branch information
zkclay committed Apr 23, 2024
1 parent e84c3b9 commit adf778f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util_types/mutator_set/archival_mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ impl<H: AlgebraicHasher, Storage: StorageVec<Digest>> ArchivalMmr<H, Storage> {
let (peak_heights, peak_node_indices) = get_peak_heights_and_peak_node_indices(leaf_count);
let peaks = self.digests.get_many(&peak_node_indices).await;

let peak_heights_and_values: Vec<_> = peaks
let peaks_and_heights: Vec<_> = peaks
.iter()
.zip(peak_heights.iter())
.map(|(&x, &y)| (x, y))
.collect();

peak_heights_and_values
peaks_and_heights
}

/// Remove the last leaf from the archival MMR
Expand Down

0 comments on commit adf778f

Please sign in to comment.