Repository navigation
feat(ledger): pinned production bootstrap issuance and economic-bound writer - #27
Merged
Merged
Conversation
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>
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A run with
ledger_mode="production"could not be funded: genesis is test-only, shadow bootstrap is CPU/test-only, and nothing writes theeconomic-boundrecord 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-signedProductionBootstrapper run, idempotent peroperation_id, capped bymax_total_issuance. Origins have a NULL hotkey, sopayable()never emits them.POST /v2/runs/{run_id}/admin/bootstrap(CPU refused, BLS beacon required) andPOST /v2/runs/{run_id}/admin/economic-bound(written once, 409 when the bound is false).manifest_v2 example --ledger-mode production.docs/network-v2.mdanddocs/operator.mdupdated, including: a test-ledger run hosted on the production challenge steers real emission once its first reward matures.Evidence
Review points for Lens (custody)
escrow_v2.py:364-410.admission._beaconfrom the route.trust_v2.economic_boundvs what the writer records.Risk / rollback
Custody code, no deployment. Nothing is live until a new attested digest and canary switch. Revert the merge.