Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Feat/ninja commitment - #73

Merged
bitzic merged 2 commits into
mainfrom
feat/ninja-commitment
Jun 28, 2026
Merged

Feat/ninja commitment#73
bitzic merged 2 commits into
mainfrom
feat/ninja-commitment

Conversation

@bitzic

@bitzic bitzic commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

bitzic and others added 2 commits June 28, 2026 12:38
Port of SN66 Ninja's content-addressed commitment to Ralph.

- chain_layer/submission_commitment.py: readable, content-addressed
  commitment `ralph-submission:<submission_id>:<bundle_sha256>` (one per
  hotkey). build/parse/verify + canonical submission_id derivation
  (<hotkey[:16]>-<sha[:16]>) that resists id-spoofing
- BittensorChain.commit_submission() (miner) + .verify_submission
  _commitment_onchain() (validator) — additive, do NOT change the legacy
  op1 handshake path; op1 cutover is a coordinated follow-up
- vs legacy: validator reads WHICH bundle is current straight from chain
  (no hash reconstruction), and overwrite=update (no nonce race)
- 9 tests: content-addressing, overwrite-as-update, anti-spoof, malformed

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- validator/inflight.py: InFlightGuard — at most one submission per hotkey
  evaluated at a time; the hotkey can submit again the moment its prior one
  is scored (NOT Ninja's one-shot). File-backed; claim/release/reconcile.
- wire into run_epoch behind RALPH_ONE_IN_FLIGHT=1 (default OFF, so pulling
  it never changes live behavior): claim at loop top (defer extras), reconcile
  at epoch start (frees scored/crash-orphaned claims) — one bundle per hotkey
  per epoch, no per-bundle release needed
- bounds validator GPU to <=1 eval/hotkey, kills the overwrite-race, zero tax
  on honest iterators; pairs with the on-chain set_commitment rate-limit +
  (future) op1 novelty-rejection for churn
- 7 tests: claim/defer/release, idempotent reprocess, restart-persist,
  reconcile stale claims, corrupt-state safe

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bitzic
bitzic merged commit b91fe2a into main Jun 28, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant