Add the TiledTree lifecycle wrapper - #55
Open
Amaury Chamayou (achamayou) wants to merge 2 commits into
Open
Conversation
Amaury Chamayou (achamayou)
force-pushed
the
achamayou/tiles-proofs
branch
from
July 25, 2026 21:13
1d868c1 to
77c129a
Compare
Amaury Chamayou (achamayou)
force-pushed
the
achamayou/tiled-tree
branch
from
August 4, 2026 22:14
c50e489 to
d8e3b9e
Compare
Add TiledTreeT: a fresh-only tiled tree (rejects an existing tile namespace rather than adopting it), append/flush/root, flushed/ immutable size tracking, interrupted-flush recovery (a failed flush seals the attempted full-tile boundary without advancing flushed size), optional compaction with configurable retention, a rollback boundary that only ever permits retracting the un-tiled frontier, noexcept move construction with no copy, mixed tile+memory proofs, and an explicit no-internal-synchronization / external-serialization contract for the store and tree it wraps. Add tiles_tree tests covering the empty tree, move construction, fresh-only rejection of an existing tile namespace, flush/compaction (including exact-multiple and retention-margin cases), and rollback (pre-flush, post-flush, exact-boundary, compacted, and interrupted- flush recovery). The memory-only subtree_root/ProofEngineProbe cases already moved to tiles_proofs are not duplicated here. Add tiles_hashes, exercising the tiled tree, writer and proof engine under SHA384/SHA512, and wire the OpenSSL 384/512 aliases for every tiled-storage component. Document the TiledTreeT API, the flush/compaction invariants and progressive-production algorithm, pruning, and the consolidated lifecycle/safety risks and edge cases in the design doc. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Amaury Chamayou (achamayou)
force-pushed
the
achamayou/tiled-tree
branch
from
August 6, 2026 15:29
d8e3b9e to
52c3711
Compare
Amaury Chamayou (achamayou)
changed the base branch from
achamayou/tiles-proofs
to
main
August 6, 2026 15:30
Amaury Chamayou (achamayou)
marked this pull request as ready for review
August 6, 2026 15:30
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 6, 2026 15:31
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new merkle::tiles::TiledTreeT lifecycle wrapper that composes an in-memory Merkle tree with tile-backed persistence and proof generation, plus accompanying tests and design documentation updates. This completes the “phase 4” tiled-storage layer by providing a higher-level API for append/flush/compact/rollback and mixed tile+memory proof serving.
Changes:
- Introduce
TiledTreeT(andTiledTree/SHA-384/SHA-512 aliases) with flush/compaction/rollback and proof APIs inmerklecpp_tiles.h. - Add new tests for lifecycle behavior (
tiles_tree) and OpenSSL hash variants (tiles_hashes), and wire them intotest/CMakeLists.txt. - Update
doc/design/tlog-tiles.mdto reflect the delivered wrapper and updated API surface.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/tiles_tree.cpp | New end-to-end lifecycle/rollback/proof tests for TiledTree. |
| test/tiles_hashes.cpp | New OpenSSL-gated tests covering SHA-384/SHA-512 tiled variants. |
| test/CMakeLists.txt | Registers tiles_tree always; registers tiles_hashes when OPENSSL is enabled. |
| merklecpp_tiles.h | Adds TiledTreeT, new type aliases, and minor formatting/path behavior tweaks. |
| doc/design/tlog-tiles.md | Updates design doc to include TiledTreeT wrapper and adjust references/plan. |
Suppressed comments (1)
merklecpp_tiles.h:1786
- This error path also uses string concatenation for a formatted message. Prefer std::format here for consistency with the rest of merklecpp_tiles.h error construction.
throw std::runtime_error(
"TiledTree: cannot claim tile namespace " + tile_root.string() +
": " + ec.message());
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 7, 2026 13:51
View session
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 7, 2026 13:57
View session
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.
Summary
Part 4 of the tiled-storage stack, now rebased onto
mainafter #54 merged.TiledTreeT, combining an in-memory tree, durable tile store, writer, and mixed proof sources;TiledTreeTfresh-only and reject adoption of an unrelated existing tile namespace;Stack
TiledTreelifecycleValidation
Revalidated after rebasing onto
main:tiles_treeandtiles_hashes;merklecpp.h,merklecpp_tiles.h, andmerklecpp_pal.h.