Skip to content

[VIndex] calculate and confirm input log hash#16

Merged
mhutchinson merged 3 commits into
transparency-dev:mainfrom
mhutchinson:storeState
Jul 31, 2025
Merged

[VIndex] calculate and confirm input log hash#16
mhutchinson merged 3 commits into
transparency-dev:mainfrom
mhutchinson:storeState

Conversation

@mhutchinson
Copy link
Copy Markdown
Contributor

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

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
Comment thread vindex/map.go Outdated
Comment thread vindex/map.go Outdated
@mhutchinson mhutchinson merged commit 2d17266 into transparency-dev:main Jul 31, 2025
6 checks passed
@mhutchinson mhutchinson deleted the storeState branch July 31, 2025 16:03
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.

2 participants