chore: Mmr Checkpoint - #2468
Conversation
0baedff to
d0e19ee
Compare
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
I can't recall if we thought this was worth adding now or not. I suspect the impact would remain small, but if you like it you can get it in.
Thinking of waiting for the next miden-vm release / integration for this rather than back porting the upstream diffs to the relevant release |
Ah I had thought that we already had this in for some reason. |
Warning
Blocked until incremental serialization of Mmr enabled by miden-vm (0xMiden/miden-vm#3585). Current impl performs full mmr file write every time.
Summary
Relates to #1697.
Why:
SQLite on every startup, the only remaining load-time cost that grows with chain height.
change.
How:
ChainMmrCheckpoint: an on-disk cache of the derived MMR (<data-dir>/chainmmr.bin,version-prefixed serialized
Blockchain).load_mmrrestores the checkpoint and tops it up with only the block commitments committedsince it was taken (new
select_block_header_commitments_fromquery), then verifies theresult against the latest header's chain commitment — the same check the rebuild path uses.
A missing, corrupt, or divergent checkpoint transparently falls back to a full rebuild.
tops up blocks committed after that point.
Changelog