Skip to content

feat(ledger): pinned production bootstrap issuance and economic-bound writer - #27

Merged
Mathis (echobt) merged 4 commits into
mainfrom
feat/production-bootstrap
Oct 21, 2026
Merged

Mathis (echobt) merged 4 commits into
mainfrom
feat/production-bootstrap

Conversation

@echobt

Copy link
Copy Markdown
Contributor

Why

A run with ledger_mode="production" could not be funded: genesis is test-only, shadow bootstrap is CPU/test-only, and nothing writes the economic-bound record that production eligibility reads. Founder decision 2026-10-21: route (a).

What

  • EconomicsPolicyV2.bootstrap_allocation_hash (production only, omitted when unset: existing policy digests and run IDs unchanged).
  • EscrowV2.production_bootstrap: one coordinator-signed ProductionBootstrap per run, idempotent per operation_id, capped by max_total_issuance. Origins have a NULL hotkey, so payable() never emits them.
  • POST /v2/runs/{run_id}/admin/bootstrap (CPU refused, BLS beacon required) and POST /v2/runs/{run_id}/admin/economic-bound (written once, 409 when the bound is false).
  • manifest_v2 example --ledger-mode production. docs/network-v2.md and docs/operator.md updated, including: a test-ledger run hosted on the production challenge steers real emission once its first reward matures.
  • Not included: issue Dispatch/qualification: od-encoder rounds cannot be served by a GPU-less challenge (inventory) #25 (host/promotion field), still needed before a production od-base round can be dispatched. Pinned the allocation hash, not the whole object, to avoid a run_id recursion.

Evidence

Review points for Lens (custody)

  1. Sum of the issuance cap, escrow_v2.py:364-410.
  2. Private access admission._beacon from the route.
  3. Meaning of "bound true" in trust_v2.economic_bound vs what the writer records.

Risk / rollback

Custody code, no deployment. Nothing is live until a new attested digest and canary switch. Revert the merge.

Mathis (echobt) and others added 2 commits October 21, 2026 08:57
A run with ledger_mode="production" had no issuance path at all:
test_genesis is test-only, shadow bootstrap is CPU/test-only, so a
production run could never fund an admission lock.

EconomicsPolicyV2 gains an optional bootstrap_allocation_hash (production
only, omitted when unset so every existing policy digest and run ID is
unchanged). EscrowV2.production_bootstrap accepts one coordinator-signed
ProductionBootstrap per run: idempotent per operation_id, conflict on
changed content, refused for a second bootstrap, a wrong authority, an
allocation other than the pin, or when bootstrap + issued + reserved
shadow units exceed max_total_issuance. Origins are issued with a NULL
hotkey, so payable() never emits them; they are collateral like genesis.

The manifest_v2 example gets --ledger-mode production, which pins a
bootstrap allocation instead of a test genesis.

Rejected: opening the shadow path to CUDA/production (it mints per trial
reward rather than a pinned, capped one-time allocation).

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
POST /v2/runs/{run_id}/admin/bootstrap hands a coordinator-signed
ProductionBootstrap envelope to the escrow after the run's services
resolve (production refuses the CPU backend there) and after the latest
beacon round passes the admission BLS check.

Nothing wrote the records_v2 economic-bound row that production
eligibility reads, so no production miner could ever become eligible.
POST /v2/runs/{run_id}/admin/economic-bound writes it once,
coordinator-signed and bound to the economics policy hash, only when
trust_v2.economic_bound holds q_floor*s*beta*(R+S) >= G on the pinned
policy; a false bound answers 409 and writes nothing. Later calls return
the stored record; one bound to another policy answers 409.

docs/network-v2.md and docs/operator.md describe the production path and
that a test-ledger run hosted on the production challenge steers real
emission once its first live reward matures.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c7ad008-1f50-4cf4-83db-ab284dc7d67e
📥 Commits

Reviewing files that changed from the base of the PR and between d1e273d and 7c7346e.

📒 Files selected for processing: 11
  • docs/network-v2.md
  • docs/operator.md
  • src/hypertrain/challenge/app.py
  • src/hypertrain/challenge/store.py
  • src/hypertrain/challenge/trust_v2.py
  • src/hypertrain/ledger/escrow_v2.py
  • src/hypertrain/ops/manifest_v2.py
  • src/hypertrain/protocol/messages_v2.py
  • tests/challenge/test_production_economics_v2.py
  • tests/ledger/test_production_bootstrap_v2.py
  • tests/ops/test_manifest_v2.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Mathis (echobt) and others added 2 commits October 21, 2026 20:33
Lens found two surviving mutants on the cap check in
production_bootstrap: removing the pending shadow-reservation term and
turning '>' into '>='. Add the exact-at-cap case and a pending
reservation case at one unit short and at an exact fit. Both mutants now
fail a test; no change under src/.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@echobt
Mathis (echobt) merged commit 9da3b7f into main Oct 21, 2026
13 checks passed
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