[VIndex] calculate and confirm input log hash#16
Merged
Conversation
This removes a lot of in-memory state, and creates a clearer invariant. The compact range now tracks the size of the ingested log, and keeps a summary of the hash. The latest verified checkpoint is now stored into a Pebble database. In the same database, we periodically store the latest tree size and compact range state too. This allows us to recover from any terminated runs, and pick up at the last index where we persisted the compact range. This meant updating the WAL so that control was inverted when constructing it; instead of the WAL saying what the index to start mapping from is, the mapping code gets this size from the compact range stored in Pebble, and then instructs that WAL to start appending after that size, truncating any dangling entries. This required fixing a couple of places that were implemented wrongly, but only came to light when confirming the tree root: - one of the tests wasn't hashing leaves properly - the logandmap binary was fetching too many leaves
AlCutter
approved these changes
Jul 31, 2025
AlCutter
approved these changes
Jul 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes a lot of in-memory state, and creates a clearer invariant.
The compact range now tracks the size of the ingested log, and keeps a
summary of the hash.
The latest verified checkpoint is now stored into a Pebble database. In
the same database, we periodically store the latest tree size and
compact range state too. This allows us to recover from any terminated
runs, and pick up at the last index where we persisted the compact
range.
This meant updating the WAL so that control was inverted when
constructing it; instead of the WAL saying what the index to start
mapping from is, the mapping code gets this size from the compact range
stored in Pebble, and then instructs that WAL to start appending after
that size, truncating any dangling entries.
This required fixing a couple of places that were implemented wrongly,
but only came to light when confirming the tree root: