Skip to content

[Phase 6] Inquisition + time-warp roadmap (tracking) #110

Description

@neverDefined

Goal

Make go-regtest a first-class test harness for the upcoming soft-forks shipping in Bitcoin Inquisition (BIP54 Consensus Cleanup, BIP118 ANYPREVOUT, BIP119 CTV, BIP347 OP_CAT, BIP348 OP_CHECKSIGFROMSTACK, BIP349 OP_INTERNALKEY) and to expose first-class time-warping primitives so consumers can write deterministic activation tests without learning bitcoind RPC quirks.

End state: a developer who depends on CTV/CSFS/CAT/APO sets Config.BinaryPath = "/path/to/bitcoind-inquisition", calls rt.MineUntilActiveBIP(ctx, BIP119, addr, 2000), and gets a green test. CI matrices that run on Core skip Inquisition-only tests cleanly via rt.SupportsBIP(BIP119).

What lives where

  • Soft-fork rules live in bitcoind (Core or bitcoind-inquisition). go-regtest stays binary-agnostic.
  • go-regtest's job is the deterministic harness: pick the right binary, feed flags, observe activation state, and now — advance time.
  • The new layer: a curated BIPID registry that joins live getdeploymentinfo with BIP metadata so devs use typed constants instead of magic strings.

The shape of the change

                        ┌─────────────────────────────────────┐
                        │          Public API surface          │
                        └─────────────────────────────────────┘
 Config.BinaryPath ──┐    ┌─ rt.Variant()         ─┐    ┌─ rt.SetMockTime(ctx, unix)
                     │    │  (Core | Inquisition)  │    │  rt.MineWithTimestamp(ctx, n, ts, miner)
                     ▼    │                        │    │  rt.WarpTime(ctx, dur, miner)
            ┌──────────────────────┐               │    └──────────┬─────────────────
            │  initialize()        │               │               │
            │  (regtest.go)        │               │               ▼
            │  • LookPath chain    │               │       ┌──────────────────┐
            │  • write script      │               │       │ rawRPC(ctx, ...) │  ← rpc.go (existing)
            └─────────┬────────────┘               │       └────────┬─────────┘
                      │ BITCOIND_BIN +             │                │
                      │ BITCOIN_CLI_BIN env        │                ▼
                      ▼                            │       ┌──────────────────┐
            ┌──────────────────────┐               │       │ bitcoind RPC     │
            │ bitcoind_manager.sh  │               │       │  setmocktime     │
            │ uses $BITCOIND_BIN   │               │       │  generatetoaddr  │
            └──────────┬───────────┘               │       │  getnetworkinfo  │
                       │                           │       │  getdeployinfo   │
                       ▼                           │       └──────────────────┘
                  bitcoind /                       │                ▲
                  bitcoind-inquisition             │                │
                                                   ▼                │
                                          ┌────────────────┐        │
                                          │ deployments.go │────────┘
                                          │  registry      │
                                          │  ListDeploys   │
                                          │  SupportsBIP   │
                                          └────────────────┘

Layering: WarpTimeMineWithTimestampSetMockTime + WarpContext. ListDeployments/SupportsBIPGetDeploymentInfoContext. Nothing reaches into r.client directly — every new wrapper goes through rawRPC or lockedClient per CLAUDE.md invariant #1.

Milestones

Phase 6.0 — Inquisition foundation

Tier A — Binary plumbing

Tier B — Deployment registry

Tier E — Acceptance + docs

Phase 6.1 — Time-warp expansion

Tier C — Time API

Tier E — Acceptance

Dependency graph

#97 BinaryPath ─────┬──> #98 PATH auto-detect ─────┐
                    │                              │
                    └──> #99 Variant() ───────┬────┤
                                              │    │
#100 BIPID + registry ──┬──> #101 ListDeployments ─┤
                        │                          │
                        └──> #102 SupportsBIP ─────┼──> #106 BIP119 example
                                                   │
                                                   └──> #107 README
                                                   │
                                              └────┴──> #109 Variant smoke test (needs #99)

#103 SetMockTime ──> #104 MineWithTimestamp ──> #105 WarpTime ──> #108 timeout-without-lockin example

The unblocking path to a runnable Inquisition test is #97#98#99#100#101#102#106#107. Time API (#103#104#105) is independent and can land in parallel after Phase 6.0 closes.

PR sequence

  1. PR1 — closes [Phase 6.A.1] Config.BinaryPath + script env-var indirection #97 + [Phase 6.A.2] PATH auto-detect (bitcoind-inquisition → bitcoind) #98 + [Phase 6.A.3] Variant() getter from getnetworkinfo.subversion #99 (binary plumbing + Variant). Tightly coupled, single review unit.
  2. PR2 — closes [Phase 6.B.1] BIPID constants + bipRegistry #100 + [Phase 6.B.2] ListDeployments(ctx) joining live + registry #101 + [Phase 6.B.3] SupportsBIP(ctx, BIPID) + MineUntilActiveBIP #102 (registry + SupportsBIP + MineUntilActiveBIP).
  3. PR3 — closes [Phase 6.E.1] Worked example: TestExampleActivateBIP119 #106 + [Phase 6.E.2] README: Inquisition install + skip-when-missing pattern #107 (BIP119 example + README). Closes Phase 6.0.
  4. PR4 — closes [Phase 6.C.1] SetMockTime(ctx, unix) wrapper #103 + [Phase 6.C.2] MineWithTimestamp(ctx, blocks, ts, miner) #104 + [Phase 6.C.3] WarpTime(ctx, duration, miner) advancing MTP #105 (layered time API).
  5. PR5 — closes [Phase 6.E.3] TestExampleTimeoutWithoutLockin via WarpTime #108 + [Phase 6.E.4] TestVariantDetection smoke test #109 (timeout + variant examples). Closes Phase 6.1.

Per CLAUDE.md invariants: additive only, no breaking signatures, every public RPC method has a Context variant, make ai-check green before each PR.

Related

Out of scope (deferred)

  • cmd/regtest-doctor diagnostic CLI — useful but not required for the API.
  • Renaming/refactoring existing MineUntilActive(string, ...) to take BIPID. New MineUntilActiveBIP is additive; string variant stays per CLAUDE.md invariant Config #5.
  • Bundling Inquisition build instructions into a Makefile target. README copy is sufficient.
  • Default-signet support (Inquisition's other operating mode).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions