Skip to content

Authenticate peer hash proofs against trusted file roots - #187

Closed
linroid wants to merge 1 commit into
torrent-v2-08-hash-wirefrom
torrent-v2-08-hash-proof
Closed

linroid wants to merge 1 commit into
torrent-v2-08-hash-wirefrom
torrent-v2-08-hash-proof

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Authenticates correlated BEP 52 hash responses against a metadata-trusted file root before peer hashes can be treated as trusted metadata. The verifier checks file-tree bounds and exact response shape, reduces aligned base-hash groups, handles uncle ordering and omitted proof layers, and rejects noncanonical zero padding even when it matches the supplied root.

Stacked on #186; advances hash integrity and exchange work in #162. It accepts proofs reaching a trusted root; cached intermediate anchors, outstanding-request tracking, byte admission/caching, serving and live connection integration remain pending. Hash authentication does not replace payload verification or storage commit barriers.

Validation: four focused JVM tests pass with no failures/errors/skips, covering leaf/piece-layer ranges, both tree sides, whole layers, per-byte corruption, selector mismatches, truncated/out-of-tree/partial proofs, invalid zero padding, and signed 64-bit maximum file-length arithmetic. Torrent iOS test-source compilation also passes. No executed v2 wire interoperability is claimed by this primitive.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-12T16:29:19.429345Z 1403f58 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

  607 files  + 5    607 suites  +5   3m 58s ⏱️ +2s
2 588 tests +12  2 588 ✅ +12  0 💤 ±0  0 ❌ ±0 
3 392 runs  +20  3 392 ✅ +20  0 💤 ±0  0 ❌ ±0 

Results for commit 1403f58. ± Comparison against base commit c238102.

@linroid

linroid commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #235 (V2 handshake, hash exchange and bounded transport) 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)

@linroid linroid closed this Sep 20, 2026
@linroid
linroid deleted the torrent-v2-08-hash-proof branch September 20, 2026 11: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