Skip to content

fix(announce): make cold-start tracker discovery fast and visible - #446

Merged
MudDev merged 1 commit into
mainfrom
fix/cold-start-announce
Aug 27, 2026
Merged

fix(announce): make cold-start tracker discovery fast and visible#446
MudDev merged 1 commit into
mainfrom
fix/cold-start-announce

Conversation

@MudDev

@MudDev MudDev commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the cold-start "Waiting for trackers" report: the dashboard sat on that label long after Tor was up, with an empty tracker card.

Cause 1: the boot announce pass was serial and slow

The announce loop walked xites strictly one at a time, and each xite's pass waits out its slowest tracker (75s ceiling). Dozens of xites times the usual dead trackers ground the first pass out for tens of minutes. While it ran, the loop could react to nothing. Measured before the fix: zero Announced lines three minutes after launch. Passes now announce xites four at a time through a semaphore; measured after, the first batch of verdicts (8 xites, real peer counts) landed within a couple of minutes of a cold launch.

Cause 2: nothing re-announced when a transport came up

Onion trackers gated during the pre-Tor boot pass stayed untried until the next periodic pass, up to 20 minutes away. set_tor_status and set_i2p_status now fire trackers_changed on a state move, so the announce loop runs again seconds after Tor or I2P comes up. The notify stores a permit, so a transition during an in-flight pass queues exactly one rerun.

Cause 3: the stats map was empty until announces resolved

A tracker only entered announcerStats after its announce resolved, and overlay-gated entries were filtered out entirely. During the whole cold-start window the map was empty, which is exactly the dashboard's "Waiting for trackers" state. Now:

  • A pass seeds every tracker it is about to try as "announcing" and pushes announcerChanged immediately, so rows appear within seconds. A tracker with a verdict keeps showing that verdict while a retry is in flight.
  • announcerStats {planned: true} also returns overlay-gated entries, so the health drawer can list every tracker the node plans to try once Tor/I2P is up. The default answer stays gated-free on purpose: shipped dashboards count every returned entry in their health ratio.

Dashboard counterpart

EpixDash-Xite PR (same branch name) polls with planned: true, merges pushed stats instead of replacing them, counts only verdict rows (announced/error) in the health ratio, and renders announcing/gated rows with a status note. Until it is deployed, the shipped dashboard may briefly show "0 of N answering" during the first announce pass instead of "Waiting for trackers"; verdicts land within a minute or two either way.

Testing

  • cargo test -p epix-ui --lib tracker: 10 passed.
  • Live cold start on Windows 11: tracker rows visible seconds after launch, first verdict batch within ~2 minutes, re-announce observed after Tor bootstrap.

On a cold start the dashboard sat on "Waiting for trackers" long after
Tor was up. Three causes, all in the announce path:

1. The boot announce pass walked xites strictly serially, and each
   xite's pass waits out its slowest tracker (75s ceiling). Dozens of
   xites with the usual dead trackers ground the first pass out for
   tens of minutes, and the loop could not react to anything while it
   ran. Passes now announce xites four at a time; measured on a live
   node, the first verdict batch lands within a couple of minutes of
   launch instead of zero announces after three.

2. Nothing re-announced when a transport came up. Onion trackers gated
   during the pre-Tor boot pass stayed untried until the next periodic
   pass, up to 20 minutes away. set_tor_status and set_i2p_status now
   fire trackers_changed on a state move, so the announce loop runs
   again seconds after Tor or I2P comes up.

3. A tracker only entered announcerStats after its announce resolved,
   and gated entries were filtered out entirely, so the stats map was
   empty for the whole cold-start window. A pass now seeds every
   tracker it is about to try as "announcing" (pushed immediately),
   and announcerStats {planned: true} also returns overlay-gated
   entries so the health drawer can list everything the node will try.
   The default answer stays gated-free for older dashboards, which
   count every returned entry in their health ratio.
@sonarqubecloud

Copy link
Copy Markdown

@MudDev
MudDev merged commit a6d3627 into main Aug 27, 2026
12 checks passed
@MudDev
MudDev deleted the fix/cold-start-announce branch August 27, 2026 18:18
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