Skip to content

rig: pool-kind contract — paired, TLS and fingerprint from wizard submit through rig.json into the miner config #4065

Open

Description

@pithead-architect

What's the problem

The rig wizard only knows Pithead pools. The rig-request.json written by _submit_rig (dashboard/mining_dashboard/wizard/server.py) and the rig.json landed by firstboot_consume_rig (lib/pithead/08-uninstall-firstboot.sh) carry only pool, worker, stratum_password — no TLS, and no way to say "this pool is not a Pithead". firstboot_consume_rig's 5 s plain-TCP dial blocks setup when the pool is down (error.txt, request removed), so an unrelated outage becomes a setup failure. render_rig_miner_config (lib/pithead/14-local-miner.sh) emits no tls/tls-fingerprint into pools[] although RigForge validates and passes both today (rigforge config.reference.json: pools[].tls default false; pools[].tls-fingerprint 64 hex).

This is the contract piece of #4009 (owner decision 2026-11-10, item 4): the wizard UI child and the api_allow_from child both build on the keys this issue adds.

What it impacts

Owners setting up an appliance rig against a TLS pool, and every owner whose pool is unreachable at setup time: both are hard-blocked today.

How I found it

Split from #4009 after reading the functions named above and rigforge's pools schema. The criteria come from the owner decision that wrote #4009.

How important is it

High for 2.1.0 — part of making the rig stand alone; sibling work waits on this contract.

Acceptance criteria

  • rig-request.json accepts optional tls (boolean), tls_fingerprint (64-hex string, or absent) and paired (boolean); wrong types are refused at submit with a 400 under today's spool discipline; absent means tls=false, no pin, paired=true. paired is never inferred from the address.
  • firstboot_consume_rig lands those keys verbatim into rig.json and a rig.json missing paired reads as paired everywhere. The rig.json/rig-request.json contract is corrected in docs/dev/appliance-wizard.md, not appended.
  • With tls true, the reachability check performs a TLS handshake: a port answering plain TCP but not TLS reads unreachable.
  • A failed dial (plain or TLS) no longer rejects: host:port shape validation stays and still refuses; a shape-valid but undialable address lands rig.json, publishes a rig-warning.txt spool sidecar (cleared at the start of every rig submission) for the confirmation screen, and the flow proceeds to the card instead of erroring.
  • render_rig_miner_config emits tls: true and tls-fingerprint in pools[0] when set, omits both when unset, and never emits a fingerprint without tls true (rigforge refuses that pair).
  • Token mint/keep and the coordinator flows stay byte-for-byte unchanged.
  • Tests fail without the change: a tests/os selftest (accept-with-warning on failed dial; shape refusal unchanged; TLS-dial path against a local listener in both directions — plain-answers vs TLS-answers), and a tests/stack/appliance case asserting the rendered pools[] with and without tls/pin.
  • No Pithead-only field becomes mandatory.

Possible solutions

Parent: #4009

Worker brief: Test tier: tier 1 on GitHub (shell suites: tests/os selftests + tests/stack/appliance cases). The rig role boots this on the box: the box proof is a tier4-kvm job, phase rig, on your head (there is no container e2e row for the rig role). The new 'Another pool' KVM leg lands in a separate child and does not replace your row.

Contract the sibling children build on — do not drift from it: rig-request.json/rig.json gain optional keys paired (bool, read-default true), tls (bool, default false), tls_fingerprint (64-hex string; emitted to rigforge's pools[0].tls-fingerprint ONLY when set, never with tls false). Failed dial of a shape-valid address: land rig.json, write a rig-warning.txt spool sidecar (cleared at the start of every rig submission), return accepted — no error.txt for a dial failure anymore; shape failures still refuse exactly as today.

Read CLAUDE.md first, then firstboot_consume_rig (lib/pithead/08-uninstall-firstboot.sh), _submit_rig (dashboard/mining_dashboard/wizard/server.py), render_rig_miner_config + rig_access_token (lib/pithead/14-local-miner.sh), and the rig flow section of docs/dev/appliance-wizard.md. Edit the lib/pithead slices and run scripts/build-pithead.sh — commit both; run make lint-file-budget and make lint-pithead-build before your proof. No comments in code; explanations go in the docs. Register selftests where CI runs them, never source. Mac only: shellcheck and the tier-1 suites — no Docker here. Branch from origin/develop-v2.1.0; PR base develop-v2.1.0. This issue lands before the wizard-UI and api_allow_from children and must keep every existing rig.json working unchanged.

Activity

  1. added this to the v2.1.0 milestone on Nov 12, 2026
  2. added
    appliance
    needs-triage
    size:M
    on Nov 12, 2026
  3. pithead-developer commented on Nov 18, 2026

    @pithead-developer
    Contributor

    Blocked on #4118. Blocked on pithead#4118 (fix PR pithead#4120, open CONFLICTING + review-required): the bench refuses tier4-kvm phase rig for every head whose battery predates that fix — job 4254@a6d9348b4cd817763e8744d9114950f2f0698221 errored at admission with "this commit's KVM battery predates pithead#4118 ... node phases stay refused until the branch includes pithead#4120 (merge develop once it lands there), then resubmit"; the two earlier attempts on this head (4222@…, 4253@…) were stopped mid-run as "cancelled by client request" before that admission existed and never ran a candidate row, so no branch fault is shown. Finished and holding on PR #4189: reviewer's return items all addressed on the head (dash-host guard test that fails without the guard — RED without, 24/24 GREEN with; rules.md rule-8 row named; tiers 1–3 green 50 pass/2 by-design skips; prior head's rig battery passed 293/0/2 as 4218@6ecb05759cfed0e4887d232b2012d8b9c9221204, block in the body). Unblocks when #4120 merges to develop and the sync lands it on develop-v2.1.0 (owner of #4118/#4120 acts); then this session merges the base in, pushes, resubmits tier4-kvm phase rig and pastes the evidence block. Block explanation posted on PR #4189.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 18, 2026
  5. removed
    blocked
    on Nov 21, 2026
  6. added
    bug
    on Nov 21, 2026
  7. pithead-developer commented on Nov 21, 2026

    @pithead-developer
    Contributor

    Blocked on #4175. #4118 closed (fix #4120 merged to develop as e40f58a), but the bench's rig-phase admission still refuses this PR's head until the fix reaches its base branch develop-v2.1.0 — the forward merge pithead#4175 carries it after the 2.0.4 cut (no v2.0.4 tag exists yet; owner acts). Merging develop into this branch is not the move: develop runs 62 commits ahead of the base and would sweep all of it into the PR diff. Finished and holding on PR #4189: reviewer return items all addressed on head a6d9348 (dash-host guard test RED without the guard, 24/24 GREEN with it; rules.md rule-8 row named; tiers 1–3 green 50 pass/2 by-design skips; prior head's rig battery passed 293/0/2 as 4218@6ecb05759cfed0e4887d232b2012d8b9c9221204, block in the body). Unblocks when #4175 closes: this session then merges the base in, watches tiers 1–3 on the new head, resubmits tier4-kvm phase rig, and pastes the unedited evidence block. Updated block explanation posted on PR #4189 (also fixed a duplicated intro sentence in the body's proof paragraph).

    The runner resumes this issue when that one closes.

  8. added
    blocked
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    applianceblockedbugneeds-triagesize:M

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions