Repository navigation
Description
What's the problem
Follow-up to #4075 and its PR #4095, which escalates past a rejected NEWNYM to a host tor-recover state reset and then a Tor restart. Two Tor failures on 2026-11-19 show cases that ladder does not cover. Both hosts ran the appliance stack with Tor 0.4.9.17, one on the 2.0.3 cut and one on develop, and both needed a manual reset.
- Host A (2.0.3): Tor had been up 3 days 18 h at 61% CPU, logging about 20,000 "32 general-purpose client circuits pending" a minute.
- Clearnet requests through its SOCKS port timed out after 60 s.
docker restart torstopped the flood, but Tor then sat at "Bootstrapped 45% (requesting_descriptors)" for over 9 minutes.cached-microdesc-consensuswas 23 h old. A plain restart, the ladder's last rung, did not recover it.
- Host B (develop):
cached-microdesc-consensuswas about 17 h old.- Clearnet egress probes passed.
- Tari logged "Connectivity is OFFLINE" and stopped 95 blocks behind tip. A probe-driven ladder would not have fired.
- What cured both: stop Tor; move
statepluscached-microdesc-consensus,cached-microdescs*andcached-certsaside, keeping the onion-service keys; start Tor.- Tor reached 100% in about 15 s.
- On host B, Tari caught up within about 3 minutes.
What it impacts
Appliance users, who have no shell. A Tor that stops refreshing its directory, or that can still reach exits but not onion peers, leaves monerod or Tari peerless while the existing heal ladder sees nothing wrong, or finishes without curing it.
How I found it
Hands-on recovery of the two hosts on 2026-11-19, using Tor logs, data-directory file ages, SOCKS probes with 60 s timeouts, and Tari's network log.
How important is it
High and user-facing, but after 2.0.4. #4095 is the 2.0.4 fix and should not grow. One long-running test host needed about 20 manual Tor interventions since late September, almost all cured by clearing Tor state.
Acceptance criteria
-
Cheapest step, at Tor container start: if
cached-microdesc-consensusis older than a threshold (for example 12 h), move the cached directory files aside before Tor starts. This uses file ages only, with no control port. -
The host
tor-recoverreset also moves the cached directory files. It moves them from an explicit list, never by glob, and the onion keys are never touched. -
New triggers for Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095's ladder:
- bootstrap not advancing for N minutes;
- consensus age past the threshold;
- Tari or monerod peerless while Tor clearnet probes pass.
Each is logged with its evidence.
-
Verification: every recovery step checks that bootstrap reaches 100% and that the failing service reconnects. It then re-dials monerod and Tari.
-
Reuse Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095's caps, cooldowns and exhaustion alert. Add jitter so many appliances do not hit the directory authorities at once.
-
Testing: a test seeds a stale consensus and a stalled bootstrap, and asserts recovery within the caps.
Possible solutions
- Run the start-time cleanup in the Tor container entrypoint.
- Add the cached files to
tor-recover's move list. - Add consensus-age and onion-health reasons next to the ones Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095 adds.
- Unknown: whether the state reset (fresh guards) or the cache reset was the effective part. Both were applied together. Record which step cures each case, so the ladder can try state-only first.
Activity
pithead-developer commentedon Nov 20, 2026
Grouped with #4193, but PR #4274 does not close it: Tor tier4-e2e work that builds on PR #4095; not part of this KVM phase.. Released for its own pick.
pithead-developer commentedon Nov 20, 2026
Blocked on #4075. #4261 builds on the Tor auto-heal ladder from #4075 (PR #4095), and that ladder is not on this base. PR #4095 is still open against
develop.develop-v2.0.5has no commit for #4075, andbuild/tor/entrypoint.shandlib/pithead/02e-tor-recovery.shcarry no ladder code. #4261's acceptance criteria say to add triggers to #4095's ladder and reuse its caps, cooldowns, exhaustion alert and re-dial verification. Those cannot be written or tested until it lands. The hosttor-recoveris also gated on a saturated-state signature, so a cache-only reset would need a deliberate design on top of #4095's reworked gating. Nothing is branched or edited. The unblock is #4075 closing, which needs PR #4095 merged and its commit on the 2.0.5 line. After that, #4261 is one tier4-e2e change: the entrypoint's stale-consensus cleanup, the cache files added to thetor-recovermove list, and the new triggers. I left #4250 and #4251 out: they are CI and build supply-chain work unrelated to Tor. #4250 needs tier 1-3 only. #4251 needs a tier4-e2e job and waits on PR #4248, which owns.github/dependabot.yml.The runner resumes this issue when that one closes.
Merge develop-v2.0.5 into the #4261 branch
Merge develop-v2.0.5 into the #4261 branch
Merge develop-v2.0.5 into the #4261 branch
pithead-developer commentedon Nov 21, 2026
Waiting on a transient bench_outage condition, not on another issue. job 4382 completed with conclusion error before any scenario: baseline unverified since the last live-stack job (source checkout baseline: generic restore refused; managed rebuild and restoration proof required). Jobs 4377 and 4381 on other branches errored the same way. The runner re-checks it (first at 2026-11-21T18:58Z, at most 5 times).
pithead-developer commentedon Nov 22, 2026
Blocked on #4302. Blocked on pithead#4302 (Release pending: pithead 2.0.4). The owner reserved the bench fleet for the 2.0.4 release gate and cancelled my tier-4 job 4426 (bench-local 1039, head ba6037d) with the order not to resubmit until 2.0.4 is published. The code, docs and tests are finished, GitHub tiers 1–3 are green on that head, and it is mergeable against
develop-v2.0.5. What is unproven is bench behaviour. The five #3090lifecyclerows failed on two earlier heads because a dashboard request collided withsetup. My fix, a delayed first reading plus a pithead-lock check, has not yet run on the bench. The Torfault-injectionphase has not run on any head of this PR. This clears when #4302 closes; then I merge the base in if it moved and resubmit the samelifecycle,fault-injectionjob. I posted the same explanation on PR #4326. #4250 and #4251 were left out as unrelated. Five scratch branchesagent/4261-bisect-*with no PR remain for the operator to remove.The runner resumes this issue when that one closes.
pithead-developer commentedon Nov 27, 2026
Blocked on #4502. Blocked on pithead#4502, the forward merge of 2.0.4 into
develop-v2.0.5(PR #4569). With #4302 closed I mergeddevelop-v2.0.5into the #4261 branch, and it conflicts in ten files, including the Tor heal itself. The base carries #4121's guard-rotation rung (DROPGUARDS,_guard_rotated, aGUARDScontrol-signal verb). My branch carries #4095's ladder as shipped in 2.0.4 (STATUSverb, hosttor-recoverreset, restart rung). They are two designs for the same ladder, and reconciling them belongs in the forward merge. Resolving them here would be a competing reconciliation, and #4261's new triggers must sit on the combined ladder. I aborted the merge and changed nothing. The PR and branch are as before, head ba6037d, with tiers 1–3 green before the base moved. The bench fix for the #3090lifecyclecollision and the Torfault-injectionphase are still unproven on any head. This clears when #4569 merges and #4502 closes. Then I merge the new base in, re-resolve against the combined ladder, rerun tiers 1–3 and submitlifecycle,fault-injection. I posted the same explanation on PR #4326.The runner resumes this issue when that one closes.