Skip to content

Support solo daemon pools and report node health - #645

Draft
pithead-developer[bot] wants to merge 1 commit into
developfrom
astra/528-rigforge
Draft

pithead-developer[bot] wants to merge 1 commit into
developfrom
astra/528-rigforge

Conversation

@pithead-developer

Copy link
Copy Markdown
Contributor

What's the problem

RigForge drops XMRig's daemon pool settings, rejects daemon URL schemes, and describes every connection as Stratum. Operators cannot configure solo mining or get useful node health information.

How I fixed it

  • Validate and render daemon pools, their two millisecond timers, and the optional ZMQ setting. Infer the required daemon: true flag from a daemon URL; reject explicit false and incompatible settings before apply changes anything.
  • Canonicalize integral numbers for XMRig and keep timers in the exact JSON integer range shared by supported jq versions.
  • Check daemon get_info with bounded curl timeouts and report height and sync state. Add connection.mode: "daemon" to the sister feed while retaining the existing Stratum behavior.
  • Reject daemon socks5 and tls-fingerprint: the pinned miner ignores them. Document its unauthenticated HTTPS transport, the separate CA verification in doctor's probe, node ownership, and the unsupported self-select, submit-to-origin and spend-secret-key fields.
  • Add focused regressions and an opt-in canned-node proof using the pinned miner. Existing test assertions and Stratum contract fixtures are unchanged.

Here is the proof

  • Before, identical final tests: timeout -k 10 900 bash tests/test-daemon-pools.sh <(git show HEAD:rigforge.sh) — exit 1; 66 passed, 72 failed.
  • After: timeout -k 10 900 bash tests/test-daemon-pools.sh — exit 0; 138 passed, 0 failed on jq 1.8.2.
  • timeout -k 10 900 env PATH="/private/tmp/rigforge528-jq16-path:$PATH" bash tests/test-daemon-pools.sh — exit 0; 138 passed, 0 failed on official jq 1.6. The temporary PATH shim selected that binary and was removed afterward. Tests verify exact emitted timer integers, including the portable upper bound.
  • Final Stratum parity used PARITY_DIR=/private/tmp/rigforge528-parity.P9BktE, with git show HEAD:rigforge.sh >"$PARITY_DIR/head.sh". Both bash /private/tmp/rigforge528-stratum-parity.sh "$PWD" "$PARITY_DIR/head.sh" "$PARITY_DIR/head" "$PARITY_DIR/work" and bash /private/tmp/rigforge528-stratum-parity.sh "$PWD" "$PWD/rigforge.sh" "$PARITY_DIR/current" "$PARITY_DIR/work" passed. cmp -s "$PARITY_DIR/head.$surface" "$PARITY_DIR/current.$surface" passed for each of render, doctor, apply and feed. All four outputs were raw byte-identical; the clock was fixed before feed generation with no JSON post-processing. The temporary harness and scratch directory were removed afterward.
  • timeout -k 10 180 shellcheck --severity=warning util/daemon-pools.sh tests/daemon-pools.sh tests/test-daemon-pools.sh and /private/tmp/rigforge528-tools.fKGzli/shfmt -i 4 -d rigforge.sh util/daemon-pools.sh tests/daemon-pools.sh tests/test-daemon-pools.sh — passed.
  • FILE_BUDGET_REQUIRE_BASE=1 bash scripts/lint-file-budget.sh and git diff --check — passed. No existing file ceiling increased.
  • timeout -k 5 120 bash -c 'shellcheck --severity=warning rigforge.sh util/daemon-pools.sh && shfmt -i 4 -d rigforge.sh util/daemon-pools.sh' — timed out; the longer aggregate run completed ShellCheck before reaching the formatter mismatch below.
  • timeout -k 30 5400 make test — exit 2 before unit tests: installed shfmt 3.13.1 disagreed with untouched tests. The repository pins 3.14.1. Its official binary was checked against its release asset digest; /private/tmp/rigforge528-tools.fKGzli/shfmt -i 4 -d $(git ls-files '*.sh') util/daemon-pools.sh tests/daemon-pools.sh tests/test-daemon-pools.sh passed.
  • timeout -k 30 5400 make test-suite — exit 2; 2552 passed, 19 failed. It caught the reference key-set and new-module setup problems, both fixed, plus two failures from GNU stat shadowing macOS stat.
  • PATH="/private/tmp/rigforge528-tools.fKGzli:$PATH" timeout -k 30 5400 make test — exit 2; 2566 passed, one existing legacy-upgrade assertion failed. The isolated fixture subsequently passed with both default and accelerated sampling; the original one-off failure did not reproduce.
  • PATH="/private/tmp/rigforge528-tools.fKGzli:$PATH" AUTOTUNE_WARMUP=0 AUTOTUNE_INTERVAL=0 AUTOTUNE_SAMPLES=1 timeout -k 30 3600 make test — exit 0; 2569 main-suite checks passed, zero failed, and all five auxiliary suites passed. The temporary tool directory selects the pinned formatter and native macOS stat; the timing overrides skip sampling delays, not an asserted timing contract.
  • PATH="/private/tmp/rigforge528-tools.fKGzli:$PATH" timeout -k 10 620 python3 -B /private/tmp/rigforge528-legacy-appliance-default.py — exit 0 in 268 seconds. This isolated the existing legacy appliance fixture, explicitly unset all three autotune timing overrides, passed all six setup assertions and returned zero from the exact upgrade invocation. Fixture data was removed; the temporary extraction wrapper remains available.
  • timeout -k 5 120 npx --offline --yes --logs-max=0 markdownlint-cli2@0.23.3 AI_RULES.md docs/configuration.md docs/pithead-integration.md — unavailable: the pinned package was not cached (ENOTCACHED). Markdown lint is not claimed as passed.

The pinned source is XMRig v6.26.0 at b2ca72480c58d197e18c885d9fc1a0c8d517e60a, built natively with HTTP, TLS, RandomX and hwloc. Unrelated algorithms, GPU backends, MSR and DMI were disabled for the local proof; the donation minimum/default received RigForge's normal zero patch. XMRIG_BIN=/private/tmp/rigforge528-xmrig-source/build/xmrig timeout -k 10 180 python3 -B tests/prove-daemon.py --runtime 120 passed again on the final numeric mapper: all three URL forms passed config checks, three jobs were fetched and accepted, doctor reported height 2286447 as synced, and a slow node produced the bounded warning in six seconds. The helper checks effective zero donation before launching, verifies the exact local stub connection, and cleans up its own processes and temporary directories.

Container e2e and coverage were not run because Docker's shared disk lacked capacity. Bench and hardware jobs were not submitted; the worker-to-coordinator hardware contract remains unrun. No KVM proof is required for this change. HTTPS and bare daemon URLs received config acceptance checks; the actual job and doctor proof used HTTP against a disposable local stub.

Closes #528

Draft from an operator-run GPT session (owner request, 2026-11-02). The operator gates it before it leaves draft.

🤖 Generated with Claude Code

Part of #528. Implemented by an operator-run GPT session at the owner's request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added the operator-action Needs the operator's hands, not an answer: nothing waits on it and no ruling clears it label Nov 3, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Operator: this stays a held draft until RigForge 1.18.1 is tagged (due Fri 2026-11-06, Sat 11-07 at the latest). 1.18.1 is cut from develop, so merging this first would widen that release. After the tag: rebase on develop, run the agent review, and request the owner's approval.

@pithead-developer pithead-developer Bot added this to the v2.x - post-GA milestone Nov 3, 2026
@pithead-developer pithead-developer Bot added the stage/operator parked for the operator label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

operator-action Needs the operator's hands, not an answer: nothing waits on it and no ruling clears it stage/operator parked for the operator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solo mining is impossible: daemon, daemon-*, self-select, submit-to-origin, spend-secret-key are dropped and every check assumes Stratum

0 participants