Skip to content

Add explicit tracker-only engine discovery - #224

Open
linroid wants to merge 2 commits into
torrent-v2-11-tracker-checkpoint-recoveryfrom
torrent-v2-11-tracker-only-magnets
Open

linroid wants to merge 2 commits into
torrent-v2-11-tracker-checkpoint-recoveryfrom
torrent-v2-11-tracker-only-magnets

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

The internal engine now accepts an explicit tracker-only privacy choice before magnet resolution. It requires validated supplied trackers, ignores explicit peers, avoids DHT, and tries tracker-returned metadata peers sequentially so old connections close before tracker failover. Public remains the existing default.

Hash-verified private metadata is accepted only on the tracker-only path. Public callers still reject it even on a cache hit. A task privacy field keeps public discovery disabled after public metadata is known: PEX is neither advertised nor accepted, and incoming peers require tracker-authorized hosts. Source/SDK selection and persisted privacy remain follow-up wiring; this does not expose a partially implemented public capability.

Stacked on #223; advances #162. Tests use real TCP metadata and peer-wire exchanges to cover authorized private resolution, unavailable tracker failover, ignored explicit peers, no DHT attempts, private-cache policy checks, missing/invalid trackers, cancellation without public fallback, PEX rejection, and incoming admission. Protocol references and remaining scope are documented in docs/design/torrent-v2-integrity.md.

Validation: 590 JVM and 569 executed iOS tests passed with zero failures/errors/skips, along with the native-runtime guard and two pinned v1 conformance scenarios. The stack includes #223's reviewed first-edit revision fix and CI test synchronization corrections.

@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-12T23:44:13.682220Z 797af48 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 797af48f0b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}
}
delay((result?.intervalSeconds ?: 30) * 1000)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fall back after exhausting a tracker's metadata peers

When the first tracker successfully announces but returns no peers or only peers that fail metadata exchange, TrackerTiers records it as the current tracker and preferCurrentTracker() retries it first on every iteration. Since that tracker continues responding successfully, later supplied trackers are never queried; this delay therefore repeats until the overall metadata timeout, even if a fallback tracker has a usable peer. Rotate to the next tracker after exhausting the current response's peers.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e2ca4ca. Tracker-only resolution now advances after exhausting each supplied tracker response, including empty responses and failed metadata peers. Metadata connections close and a bounded stopped announce finishes before the next tracker starts. The empty-response regression timed out before the fix; all tracker-only tests and the full JVM/iOS suites now pass. This commit also limits the inherited disk-failure test injection to one edit write so restarted checkpointing can succeed.

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Test Results

  752 files  + 5    752 suites  +5   4m 18s ⏱️ +4s
3 155 tests +21  3 155 ✅ +21  0 💤 ±0  0 ❌ ±0 
4 337 runs  +35  4 337 ✅ +35  0 💤 ±0  0 ❌ ±0 

Results for commit e2ca4ca. ± Comparison against base commit 34fce20.

♻️ This comment has been updated with latest results.

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