Repository navigation
coordinator: a duplicate rig id from two sources blocks control; moved hardware is an info event (#4182) - #4646
Conversation
…d hardware is an info event (#4182) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…budget-open shell proof, docs wording Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
FAIL What I investigatedReview details are in the private record because they contain sensitive information. Reviewed head: What are the gaps
|
…row hides (#4182) xmrig-proxy 6.26.0 groups worker rows by rig id (Workers::add keyed by rigId(true), default workers mode RigID), so two cloned machines arrive as ONE row whose IP is whichever connection spoke last; the same-name rows the first cut detected on never occur. Detect instead on the proxy's per-connection /1/miners listing (ApiRouter::getMiners), keyed by rig id with the stratum user as fallback, observing each (id, ip) pair only when the id is a live feed id. A merged clone row now raises the fault from its two connections, two connections from one machine never do, and the re-key proof keeps both copies online through an adopted entry's host. Drop the stale allowlist comment the request-key edit left in the hunk. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ial per id The proxy and stratum occasionally report an "ip:port" form for a worker address, so a healthy machine could present its row address and its connection address as two sources, and a re-login's new ephemeral port looked like a new machine. Strip the port from a source key exactly as the SSRF probe guard does, and let the connection leg reuse the credential the row leg resolved for an id so the two legs never reset each other's source history. Annotate the fail-soft miners fetch return channel, as the collapsed-return gate requires. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
FAIL What I investigatedReview details are in the private record because they contain sensitive information. Reviewed head: What are the gaps
Models: claude-opus-5-5 (reviewer); claude-sonnet-5-5 x3 (angles) |
|
Blocked on #4677. The required check Finished on this head: all of round 2's findings are fixed (F4646-1, -6, -7, -8, -9). The other 41 checks pass. Two are still in progress, one was cancelled (the macOS soak self-test) and two are skipped. To clear it: the tor bump (draft PR #4683, or the bot branch #4677 names) has to land on |
What's the problem
Part of #4182
Two machines booted from copies of one stick share a name, token and rig id, and nothing noticed: the dashboard showed them as ordinary rows and the control verbs dialed whichever host the name matched. #4182 requires a duplicate-identity fault that blocks control and update for that record until the operator re-keys one copy, and a moved-hardware info event that blocks nothing.
How I fixed it
Workers::addkeys each connection byrigId(true)(rig id, else login) under the default workers modeRigID, andWorker::add(ip)on an existing worker only bumpsconnectionsand overwrites the row IP — so two clones arrive as ONE proxy row whose IP is whichever connection joined last, and the same name at two IPs as two rows never occurs (ApiRouter.cppgetWorkers, Workers.cppadd/nameByMiner, Worker.hadd). Detection therefore runs on the per-connection listing that same pinned release serves:GET /1/miners(ApiRouter::getMiners, format[id, ip, tx, rx, state, diff, user, password, rig_id, agent]).service/workers/worker_identity_poll.pyobserves two channels each poll: every connected online row's feed rig id (the edited-login clone shape), and every(key, machine IP)pair/1/minersreports, where the key is the stratumrig-idelse the login and is mapped to the feed rig id through the live row's worker name (the feedrig_idand the stratumrig-idare separate RigForge settings, the stratum one unset by default; a+suffixlogin falls back to its bare name only when no row carries the exact name)./1/minersis not fetched while no online row carries a feed id — a merged clone row now raises the fault from its two connections, while several stratum threads from one machine (one IP) never do._parse_proxy_minersis length- and type-checked, and a failed/1/minersfetch adds no sources, so a flaky read can only let the fault decay, never clear it early. A source address is keyed with the port stripped exactly as the SSRF probe guard tolerates it (the proxy/stratum occasionally reportip:port), so one machine never appears as two sources, and the connection leg reuses the credential the row leg resolved for an id so the two legs never reset each other's source history.service/workers/worker_identity.pyholds the in-memory tracker keyed by rig id → live source addresses; ≥2 withinIDENTITY_WINDOW_S(three poll intervals) is the fault, it decays when a source goes quiet, and it resets when the endpoint's derived read credential changes (a re-key through adopt/re-adopt).mark_duplicatessetsduplicate_identityon the worker rows.rig-identity/moved-hardware/inforow to the existing audit log (at most one per rig id per hour) and blocks nothing.control_service.submit_worker_applyandsubmit_worker_upgradestampduplicate_identityon the spooled intent while the worker is faulted (the same carry-the-flag pattern asappliance).control_worker_applyandcontrol_worker_upgradeinlib/pithead/46-control-worker-ops.shrefuse it after resolving the target and before the dial budget or any dial, naming the duplicate identity and the cure. The fault state isduplicate_identityon the worker rows, for Coordinator: Upgrade rig and Remove rig drive the RigForge API and revoke a removed rig #4016's Update all; that verb is not built here.docs/workers.mdgained the clone / moved stick / dead stick section — the clone row now reads as it really looks: one merged proxy row whose IP is whichever copy spoke last, the id answering from two machine addresses.rig-idreach the proxy as one worker and are indistinguishable from a clone; the docs tell the operator to give each its ownuserorrig-id.Here is the proof
test_two_simulated_sources_raise_and_decay(two rows, one feed id),test_a_merged_clone_row_raises_from_its_connectionsandtest_the_fault_decays_when_one_copy_stops_answering(the merged-row shape, fed the pinned proxy's own/1/minerspayload),test_two_connections_from_one_machine_are_not_a_fault(stratum threads are not clones)tests/stack/control/test-control-status-vocabulary.sh(dial budget open, no dial logged; the unflagged apply dials the stub)test_same_id_different_hints_from_one_source_is_an_info_event,test_moved_hardware_events_are_rate_limited_per_rig_idtest_rekeying_one_copy_clears_the_faultholds two live connections and an adopted entry withhost; re-adopting one copy under a new rig id and token leaves both rows online, and the old id is no longer faulted — no copy is dropped from the poll to make it passTestParseProxyMiners(rig id, else login; malformed rows dropped),test_get_minerspins the endpointtest_a_row_ip_with_a_port_is_the_same_source_as_the_bare_ip,test_the_same_machine_with_two_ephemeral_ports_is_not_a_fault,test_the_fault_survives_a_failed_miners_fetch(both legs carry one credential per id)rig-idunset, login only), a+suffixlogin, suffix-separated rows kept apart, another login not attributed:test_a_default_clone_pair_with_no_stratum_rig_id_raises_from_the_login,test_a_login_suffix_still_maps_to_the_worker,test_rows_that_differ_only_by_a_login_suffix_stay_separate,test_connections_under_another_login_are_not_attributedtest_a_stick_moved_after_a_quiet_gap_is_still_an_info_event,test_a_second_move_after_the_rate_limit_and_a_gap_is_recorded,test_a_fingerprint_change_after_the_window_is_moved,test_remembered_fingerprints_are_bounded,test_the_moved_clock_map_is_bounded,test_no_miners_fetch_without_a_feed_id;test_the_fault_survives_a_failed_miners_fetchnow makesget_minersraiseRed-without-the-fix: with only the
/1/minersleg removed fromobserve_poll,test_a_merged_clone_row_raises_from_its_connections,test_the_fault_decays_when_one_copy_stops_answeringandtest_rekeying_one_copy_clears_the_faultFAIL; on the previous headtest_a_row_ip_with_a_port_is_the_same_source_as_the_bare_ip,test_the_same_machine_with_two_ephemeral_ports_is_not_a_faultandtest_the_fault_survives_a_failed_miners_fetchFAIL; at this round's head the new gap, login-mapping, bound and fetch-skip tests FAIL with the two source files reverted toab02c1f0and pass with them; the full module is green.Local, on this Mac (corroboration only; GitHub CI is the tier-1 evidence):
pytest tests/service tests/web tests/clientindashboard/: exit 0;ruff checkandruff format --check: clean.make lint-file-budget(entry forlib/pithead/49-control-request-loop.shremoved because the hunk's comment deletion dropped it below target) andmake lint-pithead-build: pass; no ceiling raised.ipandcurlunder the repo's untrusted-macOS flag: 12 pass, 0 fail. With the gate call disabled in the builtpithead, 5 of the new rows fail.Bench evidence,
tier4-e2e(phasesrigforge,rigforge-control) on the head before this round's dashboard-only commits (ab02c1f0; this round touches no shell, compose or control-path file, so tiers 1 to 3 on the new head are its proof). An earlier attempt, 4780, errored at reserve in one second on a bench lending zero rigs for this repo/tier (0 rows executed, an environment refusal). The fleet has no cloned stick, so it shows the refusal path deploys and the normal path still dials, not a live clone.bench-ci job 4836@ab02c1f0a3d2fed21240573512ccbc2c3564e772 · pithead · tier4-e2e
Generated by
bench-ci evidence 4836@ab02c1f0a3d2fed21240573512ccbc2c3564e772; re-run it to check.Ponytail pass: cut a persisted fault table, a UI view-model field and a second proxy poll (the identity poll fetches
/1/minersitself —data_serviceis at its recorded ceiling and this keeps the fetch beside its consumer); kept the tracker caps because the listing is unauthenticated miner input.