Add tiled tree recovery API - #77
Draft
Amaury Chamayou (achamayou) wants to merge 6 commits into
Draft
Conversation
Restore TiledTree from serialized tree state and a caller-validated tile boundary. Harden tree deserialization and replace untrusted suffix tiles during resumed growth. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 455a0fc3-10c9-4831-bf66-f06ff952f607
Restore logical tree state before tiles are ready, populate or repair the namespace with a detached writer, and adopt a quiesced durable prefix without trusting stale suffix files. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 455a0fc3-10c9-4831-bf66-f06ff952f607
Make the traversal child invariant explicit and satisfy the public-header lint rules for deserialization and writer rebinding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 455a0fc3-10c9-4831-bf66-f06ff952f607
Validate every required tile and roll-up against the serialized frontier, and restore distinct flushed and immutable boundaries after interrupted flushes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve deserialization conflicts by retaining the newer exception-safe bounds checks and fuzz coverage from main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow consensus-driven callers to write and seal only complete tiles within a committed leaf-count prefix while retaining a rollbackable logical suffix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
TiledTreeT::resumefor an existing namespace, serialized tree state, and a caller-validated full-tile boundaryTiledTreeT::from_frontierso logical recovery can complete before any tile namespace is readyTileWriterT::repairfor detached/background namespace population or repair after an explicit trusted prefixadopt_tile_prefixafter the detached writer is quiescedTileWriterscan/repair behaviorTreeTdeserialization for bounds, exception safety, large compacted frontiers, allocation limits, and maximum capacityAPIs
auto resumed = TiledTree::resume( config, hash_algorithm_short_name, serialised_tree, full_tile_boundary);The caller establishes namespace ownership and validates every tile below the boundary as belonging to the serialized tree. Proof reads are capped at that boundary until later flushes publish more tiles.
from_frontierperforms no namespace I/O and trusts no tile files. Root computation and appends are available immediately. If old leaves are non-resident, tile-dependent proofs and live flushing fail until a complete repaired prefix overlaps the resident frontier.The detached writer may run on a background thread; merklecpp does not create or manage threads. The application must serialize writers sharing the namespace and quiesce repair before adoption. Adoption verifies the boundary seam, updates flushed and immutable boundaries together, and continues to distrust the suffix.
Validation
tiles_resume,tiles_writer, andtiles_treetiles_resumeandtiles_writer