Skip to content

Add tile-backed proof generation#54

Draft
achamayou wants to merge 2 commits into
mainfrom
achamayou/tiles-proofs
Draft

Add tile-backed proof generation#54
achamayou wants to merge 2 commits into
mainfrom
achamayou/tiles-proofs

Conversation

@achamayou

@achamayou achamayou commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Part 3 of the tiled-storage work, now rebased directly onto latest main after #52 and #53 merged.

  • add abstract HashSourceT plus tile-backed, memory-backed, and combined implementations;
  • add ProofEngineT roots, inclusion proofs byte-identical to TreeT::path() / past_path(), and RFC 6962 consistency proofs and verification;
  • add the logically read-only TreeT::subtree_root() accessor for complete resident subtrees without changing hashing semantics;
  • use the current default Tree::hash_function aliases and reject unsafe index conversions or arithmetic overflow;
  • cover mixed tile/memory ranges, tile boundaries, tampering, hostile indices, and completed level-2 tile resolution;
  • document format compatibility, source composition, proof algorithms, and the remaining lifecycle-wrapper phase.

Compatibility

Tile hashes and proof assembly use the tree's existing HASH_FUNCTION; leaf and node hashing behavior is unchanged. Inclusion proofs remain byte-for-byte compatible with existing merklecpp paths, and the default SHA-256 implementation remains OpenSSL-independent.

CI

tiles_level2 remains behind LONG_TESTS. CI runs its roughly 65,000-file workload once on Linux (g++, Release, OpenSSL off) instead of on Windows, where it exceeded the 900-second timeout. CodeQL still builds the long-test target.

Validation

  • Release build with OpenSSL disabled
  • full non-long test suite (16/16)
  • tiles_level2 with LONG_TESTS=ON on Linux

@achamayou
achamayou force-pushed the achamayou/tiles-writers branch 2 times, most recently from eca982d to 6e2c46d Compare July 20, 2026 19:51
achamayou and others added 2 commits July 25, 2026 21:39
Add HashSourceT (abstract subtree-root resolver), TileHashSourceT
(resolves from full tiles, with an LRU tile cache), ProofEngineT
(inclusion/consistency proofs and their verifiers, built on mth_range),
MemoryHashSourceT (resolves from a resident in-memory tree), and
CombinedHashSourceT (memory first, falling back to tiles).

Add the sole essential core change: TreeT::subtree_root(), a read-only,
non-hashing accessor that lets proofs be served from the resident tree,
plus the <limits> include it needs. No other merklecpp.h changes.

Add tiles_proofs tests, cross-checking tile-derived inclusion and
consistency proofs against merkle::TreeT as the oracle across a range
of sizes, including tile-boundary crossings. Move the memory-only
subtree_root proof coverage and the ProofEngineProbe hostile-arithmetic
edge cases here from tree coverage, since they exercise the proof
engine and core accessor rather than TiledTree lifecycle. Add
tiles_level2 for end-to-end coverage of the level-2 tile path.

Introduce the LONG_TESTS CMake option, gate tiles_level2 behind it, and
enable it in CI (and CodeQL) so long-running tile coverage runs on pull
requests.

Document the compatibility statement, the optional core accessor, and
the HashSource/ProofEngineT API and algorithms in the design doc.

Co-authored-by: Copilot <[email protected]>
Use the current default tree hash function for public proof aliases, reject index conversions that cannot be represented safely, and align the design and level-2 coverage notes with the rebased implementation.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: c504572c-322f-4950-8682-edf4a7fd2c5b
@achamayou
achamayou force-pushed the achamayou/tiles-proofs branch from 1d868c1 to 77c129a Compare July 25, 2026 21:13
@achamayou
achamayou changed the base branch from achamayou/tiles-writers to main July 25, 2026 21:13
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.

1 participant