Skip to content

beyond-v3: HA recommendation (exploration, DO NOT MERGE) - #761

Closed
RobertClarke wants to merge 1 commit into
mainfrom
RobertClarke/beyond-v3
Closed

RobertClarke wants to merge 1 commit into
mainfrom
RobertClarke/beyond-v3

Conversation

@RobertClarke

@RobertClarke RobertClarke commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Exploration only. DO NOT MERGE. This is the beyond-v3 explorer's high-availability recommendation for the PRISM pair. It is research and design only: nothing in it was run against the pair.

Read: docs/beyond-v3/ha-recommendation.md

The recommendation

Automate the failover now, without changing what any coinbase pays. Then anchor payouts to the chain, and build PRISM 4.0 as two always-on nodes.

  1. This week: server-side TCP keepalives on the pair's PostgreSQL.
    • Today a dead or cut-off client can hold ORDER_LOCK on the writer for up to about 2 h 11 min. Every share append fails, and nothing fails over.
    • Keepalives end only sessions whose peer is dead or unreachable.
  2. Step 1 (3.x): automatic, standby-fenced failover.
    • It runs behind a model-checked safety kernel, and the Hashbalancer follows node-reported health.
    • PRISM publishes only standby-durable work, and lands blocks from the chain.
    • If A dies, the pool is without a writer for about 20–30 s, with no human. That figure depends on PhoenixNAP power-off latency, which is unmeasured.
    • B dying, the link breaking, or a node returning causes no mining outage.
  3. Step 2 (3.x, shadow mode first, needs approval): chain-anchored payouts.
  4. Step 3 (4.0): two always-on nodes.
    • Per-node share logs, an identity-keyed log transport, and chain-derived settlement.
    • No failover, fence, promotion or PhoenixNAP credential.
    • Its timing should rest on measured miner reconnect behaviour.

What's in this PR

  • docs/beyond-v3/ha-recommendation.md, in the order asked for: the recommendation; one comparison table; the failure-case walkthroughs for each candidate; the phased path (what ships on 3.x and what needs 4.x); open questions. Appendices cover the precise payout rules, the step 1 safety kernel, the evidence, and where the research disagreed.
  • docs/beyond-v3/models/, standard-library Python that nothing imports:
    • red team A's payout-rule model: a policy port matching all 25 of PRISM's fixture vectors, an exhaustive search and a two-node simulator;
    • red team D's availability model.

How it was produced

Ten research agents worked from read-only copies of 3.x.x (v3.0.0-rc.6) and the pair's infrastructure: code mapping, fencing, two-node PostgreSQL HA, accounting redesign, routing, alternative databases, chain-anchored payouts, DRBD, and evidence.

Four red teams followed:

  • the payout rules, with the model;
  • the 3.x failover system;
  • the 4.0 design, with PostgreSQL 16 replication drills;
  • a devil's advocate.

A read-only fact-check then compared every claim with rc.6 and the reports. The 50 findings it raised are corrected.

The model's strict configuration was re-run independently: 6,388,553 chains, no overpay.

No production system was touched: no SSH, no PhoenixNAP API calls, no deploys.

🤖 Generated with Claude Code

Adds the beyond-v3 explorer's recommendation for making one node's
death a non-event on the two-node PRISM pair, without a witness or a
runbook. Fix the writer lock wedge now. Then build an automatic,
standby-fenced failover that changes no coinbase. Then anchor payouts
to the chain, so a job's prior balances come from its own parent
chain. Finally build PRISM 4.0 as two always-on nodes with per-node
share logs.

The document covers the recommendation, one comparison table, the
failure-case walkthroughs, the phased path and open questions. Its
appendices give the payout rules, the supervisor's safety kernel, the
evidence, and where the research disagreed. Under models/ are the
payout-rule model (a policy port that matches PRISM's 25 fixture
vectors, an exhaustive search and a two-node simulator) and a small
availability model. Both are research code that nothing imports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RobertClarke

Copy link
Copy Markdown
Member Author

Closing as superseded. This exploration's recommendation shipped as the PRISM 3.1 dual writer (#766, #768, #767, #769, #763 and #773), released in v3.1.0: https://github.com/Qbit-Org/qbit-mining-bootstrap/releases/tag/v3.1.0. The branch is kept as the record of the HA analysis and its payout and availability models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant