Skip to content

Commit

Permalink
fix: Update canopy after Merkle tree updates (#934)
Browse files Browse the repository at this point in the history
Before this change, we were updating canopy only after appends. Now
we do it also for updates.

Add unit tests which assert the whole canopy.
  • Loading branch information
vadorovsky authored and ananas-block committed Jul 3, 2024
1 parent 9c52b46 commit 97d3b75
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 9 deletions.
4 changes: 4 additions & 0 deletions merkle-tree/concurrent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ where
}
self.changelog.push(changelog_entry);

if self.canopy_depth > 0 {
self.update_canopy(self.changelog.last_index(), 1);
}

Ok((self.changelog.last_index(), self.sequence_number()))
}

Expand Down
Loading

0 comments on commit 97d3b75

Please sign in to comment.