Skip to content

feat(torrent): retain v2 and hybrid magnet identities - #171

Closed
linroid wants to merge 1 commit into
torrent-v2-05-sha256from
torrent-v2-04-identity
Closed

linroid wants to merge 1 commit into
torrent-v2-05-sha256from
torrent-v2-04-identity

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

The v1-only magnet model cannot retain a full v2 identity or require both exact topics in a hybrid magnet. Introduce distinct full SHA-256 identities and a paired torrent identity, then parse and reconstruct btmh and hybrid magnets without truncating their hashes.

Part of #162; stacked on #170 (torrent-v2-05-sha256). Multihash decoding validates canonical algorithm/length varints and the complete digest length, reports unsupported algorithms through a dedicated error type, accepts repeated equal topics, and rejects conflicting topics. Identity authentication requires every supplied topic to match the original info bytes. V2 identities sharing a 20-byte wire prefix remain distinct.

The existing v1 runtime explicitly rejects access to a magnet carrying a v2 topic, preventing silent fallback while v2 metainfo and wire integration remain incomplete. This PR adds identity handling; it does not advertise working v2 downloads.

Validation: all 324 local torrent tests passed with no skipped tests, both pinned independent-client conformance scenarios executed, and the native-runtime dependency guard passed. New cases cover full/prefix identity separation, hybrid authentication, malformed and unsupported multihashes, duplicate/conflicting topics, and v2/hybrid URI reconstruction.

@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-12T13:36:26.063622Z c727d19 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

  510 files  +10    510 suites  +10   4m 1s ⏱️ -1s
2 367 tests +15  2 367 ✅ +15  0 💤 ±0  0 ❌ ±0 
3 013 runs  +25  3 013 ✅ +25  0 💤 ±0  0 ❌ ±0 

Results for commit c727d19. ± Comparison against base commit d8ec4be.

@linroid

linroid commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

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)

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