← Back to Pull requests

feat(genesis): carry testnet identities and points into mainnet block 0 #1129

Open
unknown opened this pull request with 408 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 05, 2026 14:46 UTC
Author

Mainnet starts from a fresh block 0 that carries testnet users' identities, points and referrals, with every balance at 0. Validators come from the launch list in the genesis.

Refs kynesyslabs/mainnet-launch#26

What changes

  • New fork identityCarryover (off by default, scheduled at 0 in the mainnet genesis). Under it block 0 restores gcr_main.jsonl (identities, points, referralInfo, balances 0), copies storage programs and identity commitments byte for byte, and replaces validators.jsonl with the genesis launch validators.

  • Block 0 refuses (before anything is written) a snapshot with a non-zero balance, a manifest balance_sum other than "0", a missing or mismatched validators.jsonl, an unstake in flight, or osDenomination not recorded as applied. A genesis that schedules the fork at 0 without a pinned snapshot manifest is refused too.

  • genesis_imported_identities records every imported identity key. Under the fork, linking one of them again does not pay the first-link award a second time, to any account. Wallet keys are lowercased so a case-flipped relink can't miss the table. The table is derived from the snapshot that the genesis hash binds, so it is not in the state hash; on restart the node rebuilds it from the bound gcr_main.jsonl and refuses to boot on a mismatch.

  • Web2 and TLSN unlink by platform account (userId), so an imported link whose username changed since testnet can still be removed.

  • bun run snapshot:carryover --in data/snapshot --validators <file> --out <dir> builds the zeroed snapshot and a reproducible manifest.

  • Design and operator steps: docs/mainnet/genesis-import.md.
  • Evidence

  • Real snapshot (testnet block 563,541): 14,216 accounts (1,329 had a balance, all zeroed), 27,290 imported identity keys, 0 accounts sharing a username under different user ids.

  • scripts/test-consensus.sh: 136 files, 0 failed (after merging current stabilisation). identityCarryoverFork.test.ts 5/5. Type check clean.

  • Genesis acceptance on an image built from this branch (testing/genesis-acceptance/run.sh): 12/12 scenarios matched (fresh boot with pins, one-byte genesis change, missing and malformed pins, changed snapshot, restart with changed pin, moved and far fork schedules, unknown fork, wrong block-0 pin).
  • The SDK side (optional userId on the Web2/TLSN unlink builders) is a separate sdks PR; this node change accepts both forms.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

  • New Features

  • - Added support for carrying identity data into a mainnet genesis snapshot while resetting account balances and applying the launch validator list.
    - Added snapshot validation and integrity checks, including requirements for matching validators, compatible fork settings, and a bound manifest hash.
    - Under the carryover fork, Web2 and TLSN unlink requests can identify accounts by user ID; imported identities do not receive a first-link award.
  • Documentation

  • - Added guidance for building and reproducing carryover snapshots, and updated mainnet launch configuration and readiness requirements.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 408 lines (+306 / -102) across 5 files Reviewer: claude[bot] Review duration: 4m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.45) × (1 − Review Confidence (0.27)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 408 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 40% · Reviewer familiarity: 35%
    27%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.360
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #1129"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 27.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.8% (MEDIUM) · Higher = larger blast radius
    44.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 27.2% · Lower = rushed or shallow review
    27.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.6% · Safe to merge
    32.6%