Skip to content

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Sep 19, 2025

Describe your changes

Continuation of 0xMiden/miden-node#1229 without the operational issues of being out-of-crate.

First piece of part 3 of 0xMiden/miden-node#1185

Approach

The current approach is to track inverted MutationSets in addition to the latest version of the Smt, underpinning an AccountTree (not part of this implementation.

Now we do not store inner nodes, but recalculate them (and cache them) on a per block (= set of overlays) basis. We do this by creating a HistoricalView and use dynamic programming (~ish) to use the cache as the walk down the children of a desired node index, part of the merkle path, is done.
An additional optimization is performed only checking overlays that actually modify any of the leaves that are able to modify a node index, which is relatively cheap, it's called "poisoning" for now.

Left TODOs

  • use Arc<ReadWriteLock<Cache>> for sharing the same cache for multiple views
  • Overlay::new is missing an impl
  • tests!
  • integration with AccountTree out of scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant