Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Superseded by #232 (V2 identity, metainfo and Merkle integrity) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Add the pure Kotlin integrity primitives required to verify BitTorrent v2 content: incremental SHA-256, a streaming per-file Merkle root builder, and bounded single-block proof verification against a trusted file root.
Part of #162, stacked on
torrent-v2-01-storage-admission(#169). The file root builder retains a logarithmic frontier, hashes short final blocks at their actual length, and folds missing leaves as zero hashes. The verifier checks exact block/proof lengths, sibling hashes, block indices, and out-of-file padding before accepting a root match. Empty files have no pieces root.Validation: all 11 focused JVM tests passed and the native-runtime dependency guard passed. Tests include known SHA-256 vectors, every split of short vectors, a streamed million-byte vector, independent JDK comparisons at padding/block boundaries, independent full-tree comparisons across uneven shapes, and proof tampering—including a forged root matching malformed nonzero padding.
These primitives are internal and do not yet advertise v2 downloads. Format identity, bounded wire decoding and proof acquisition, piece-layer storage, hybrid verification, and durable verified commits remain separate roadmap slices. The integrity design note documents that boundary.