Repository navigation
tor,lan-guard: fix #4263, #4598 — pending-circuit budget review and boot-timer only on real exposure - #4675
Draft
pithead-developer[bot] wants to merge 4 commits into
Draft
tor,lan-guard: fix #4263, #4598 — pending-circuit budget review and boot-timer only on real exposure#4675pithead-developer[bot] wants to merge 4 commits into
pithead-developer[bot] wants to merge 4 commits into
Conversation
… boot check lan_guard_watched_ports watched a fixed port whenever the engine read for a node container failed or came back empty, which is exactly what every stopped container answers after a reboot. The appliance therefore installed pithead-lan.timer at boot and the same function took it down minutes later once Compose converged: churn, a false "checked every 2 minutes" promise, and no protection because the read-back was empty either way. The read-back now wins when it says something, and a successful empty read-back publishes nothing. A failed read-back asks the engine whether the container is running: stopped means not watched, running or unreadable stays watched, and an unreadable container list still watches all fixed ports. The two-minute check is installed only when the render installs it, and a configured LAN bind is watched with every node stopped, so #3290 crash recovery and the switch-off teardown keep their behavior. Co-Authored-By: Claude Code <noreply@anthropic.com>
…l exposure The configuration prose said the check "also runs on the appliance after pithead up" and that a port published "by a node container" keeps the timer. Neither was what the appliance now does: the boot render decides with the same read-back rules the check uses, so a loopback-only box installs nothing and never mentions the two-minute check, and a stopped container that publishes nothing no longer keeps the timer on a Docker install either. Co-Authored-By: Claude Code <noreply@anthropic.com>
Upstream Tor developers advise against raising MaxClientCircuitsPending: a client in trouble pushes twice as many circuit builds into a network that is already stressed. Review the whole dial budget against that advice and record the decision: keep 64. Raising it amplifies exactly the failure the wedges showed, the 32 default does not fit the current budget (monerod's default 24 plus the Tari and P2Pool dials dial about 44 at boot), and an adaptive cap would rise when the network is least able to take it. Capping Tari's simultaneous outbound dials waits for the diagnostics measurement of what fills the pending queue during a wedge; the operations doc now carries that reasoning and the out_peers row points at it. Enforce the version half. The tor image build now refuses a pin below the 0.4.9.17 floor before apk runs, the daily bump tool reads the floor from the Dockerfile and refuses a pin below it (and refuses every pin when the floor line is malformed), and the support bundle's tor/control.txt asks GETINFO version, so the floor an appliance runs is auditable from a bundle instead of inferred from the pin. Co-Authored-By: Claude Code <noreply@anthropic.com>
…d bind, not dropped Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
Blocked on #4674: the tor image does not build on develop (Alpine retired the pinned tor 0.4.9.17-r0), so no tier-4 e2e can deploy this head. Tiers 1 to 3 are otherwise green except that same image build. Finished: #4598 fix and tests, #4263 floor, diagnostics version and cap decision. Unblocks when the tor pin bump (#4668) merges to develop; then bring develop in and run tier4-e2e targeted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the problem
Two open v2.0.6 issues meet at the Tor/LAN boundary of the appliance:
MaxClientCircuitsPending 64and the per-service dial budgets (monerodout_peers, Tari's outbound dials) were never checked against upstream advice, the Tor version floor 0.4.9.17 is not enforced at build time nor shown in diagnostics, and the decision is undocumented.pithead-lan.timeron every boot and removes it minutes later on loopback-only machines, becauselan_guard_watched_portscounted every stopped container's failed or emptydocker portread as a LAN publication — producing boot-log churn and a check the box then takes down.How I fixed it
lan_guard_watched_ports(Appliance installs the LAN rule check timer at boot and removes it minutes later #4598, committed): a read-back that says something wins (non-loopback → watched even if the inspect read says stopped); a successful empty read-back publishes nothing; a failed read-back asksdocker inspect: a running or unreadable container stays watched, a stopped one is judged by the bind it was created with (loopback or none is not watched, all-interface is), and an unreadable container list still watches all fixed ports. The "checked every 2 minutes" line now prints only when the render actually installed the unit, and a configured LAN bind stays watched with every node stopped, so A crashed monerod or Tari container stays down: the LAN guard's restart policynoalso suppresses crash restarts #3290 crash recovery is unchanged.versionin the support-bundle control-port snapshot, and the documented budget decision (keep 64; the arithmetic is already indocs/configuration.md) plus the reviewed dial budgets.Here is the proof
Shell tests (pithead suite)check is the verdict): the nine(#4598)assertions pass and the domain's red-assert name set is byte-identical to the same run on unmodified develop (17 pre-existing macOS-only reds,RED-SET-IDENTICAL):DOMAIN-RESULT 412 passed, 17 failedvs baselineDOMAIN-RESULT 403 passed, 17 failedmake lint-file-budget,make lint-pithead-build, shellcheck clean;lib/pithead/02b-lan-guard.shtakes a 403-line entry indocs/dev/file-budget.tsv.9ea7385fwith a configured-bind read and three new assertions (tests/stack/firewall/lan-guard-check.sh).Build image (tor)is red ondevelopbecause Alpine retiredtor=0.4.9.17-r0(Build image (tor) red: Alpine retired tor=0.4.9.17-r0, the exact-version pin no longer resolves #4674, Pin-bump workflows push their branch but cannot open the PR #4677); the pin bump rides in Twenty-nine fixes for 2.0.5 in one pull request, one commit each #4668. No tier-4 job can build the stack until that merges.Part of #4263
Part of #4598
Left out: #4338 (realupgrade fidelity gaps, a separate battery-phase scope).
🤖 Generated with Claude Code