chore(trust-root): set design/prism emission to 50/50 - #79
Conversation
Rebalance owner-signed challenge emission shares from design 2000 / prism 8000 to 5000/5000 so each challenge takes half of subnet emissions.
📝 WalkthroughWalkthroughThe committed and staging challenge configurations now assign 5000 basis points to both design and prism. Signatures, validation tests, freeze checks, deployment comments, and documentation now reflect the 50/50 allocation. ChangesEmission allocation rebalance
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/challenges.toml`:
- Line 16: Remove the duplicate [[challenges]] table header before the prism row
in both config/challenges.toml at lines 16-16 and config/challenges.staging.toml
at lines 16-16, leaving exactly one header in each file so the intended two-row
challenge body is loaded.
In `@config/challenges.toml.sig`:
- Line 1: Verify the signature in config/challenges.toml.sig:1 against the
committed config/challenges.toml using load_challenges_file_with_sig or the
CLI/library verifier, including the parsed metadata, SCALE-encoded body,
owner.pubkey, and base-trustroot-v1 domain. Apply the same exact-environment
verification to config/challenges.staging.toml.sig:1 against
config/challenges.staging.toml; do not rely only on hexadecimal format
validation.
In `@docs/COMPLETENESS.md`:
- Line 120: Update the “Design emission ceremony” status entry in
COMPLETENESS.md to avoid claiming production emission is live; state that it is
configured at 5000/5000 with production activation still pending, including the
required deployment, restarts, and sealed:true step as appropriate.
In `@docs/external-miner/prism.md`:
- Around line 124-125: Update the Prism miner allocation section in prism.md to
include the current 5000 bps Prism / 5000 bps Design (50/50) split, while
retaining the note that the emission share is owner-controlled via the trust
root. Ensure the public documentation matches the allocation stated in the
BaseIntelligence/prism mining docs.
In `@docs/runbooks/design-enable-and-emission.md`:
- Around line 72-74: Update docs/runbooks/design-enable-and-emission.md lines
72-74 and docs/runbooks/prism-enable-lium-and-emission.md lines 13-26 so the
fresh seal is the activation boundary: document environment-specific trust-root
deployment, required consumer restarts, fresh sealing, and verification that
/v1/weights/latest returns sealed: true before relying on the allocation. In
both runbooks, preserve the existing ceremony details while explicitly requiring
this sequence for activation.
In `@docs/runbooks/prism-enable-lium-and-emission.md`:
- Line 13: Add fresh-seal activation steps to the emission ceremony in the
relevant runbook section: deploy the updated trust root, restart components that
load it as required, create a fresh seal, and verify /v1/weights/latest reports
the intended emission shares with sealed: true. Explicitly include verification
of the raw-weight seal path producing sealed: true weights.
In `@xtask/src/design_check.rs`:
- Around line 31-32: Update the freeze-gate checks in the design validation
logic to require distinct 5,000-basis-point values for both Design and Prism,
and validate that their combined allocation is exactly 10,000 rather than merely
searching for an unrelated substring. Extend the related test cases with a
document using a non-5,000 Prism value and assert that the gate rejects it.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d0223f5f-e8ad-4c0a-b0c2-506e6c0f3bd8
📒 Files selected for processing (20)
config/CEREMONY.mdconfig/challenges.staging.tomlconfig/challenges.staging.toml.sigconfig/challenges.tomlconfig/challenges.toml.sigcrates/site-api/src/handlers.rscrates/site-data/src/metrics.rscrates/site-data/src/weights.rscrates/trustroot/tests/trustroot_verify.rsdeploy/compose/env-staging.ymldeploy/scripts/prod-burn-seal.shdocs/ARCHITECTURE.mddocs/COMPLETENESS.mddocs/DESIGN_CHALLENGE.mddocs/DESIGN_CHALLENGE_CHECKLIST.mddocs/PRISM.mddocs/external-miner/prism.mddocs/runbooks/design-enable-and-emission.mddocs/runbooks/prism-enable-lium-and-emission.mdxtask/src/design_check.rs
| emission_share_bps = 5000 | ||
| policy = "all_metagraph_hotkeys" | ||
|
|
||
| [[challenges]] |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Remove the duplicate challenge-table header from both trust roots.
Each file contains two consecutive [[challenges]] headers at Line 16. This creates an empty challenge entry and prevents the loader from producing the intended two-row body.
config/challenges.toml#L16-L16: keep one[[challenges]]header before theprismrow.config/challenges.staging.toml#L16-L16: keep one[[challenges]]header before theprismrow.
📍 Affects 2 files
config/challenges.toml#L16-L16(this comment)config/challenges.staging.toml#L16-L16
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@config/challenges.toml` at line 16, Remove the duplicate [[challenges]] table
header before the prism row in both config/challenges.toml at lines 16-16 and
config/challenges.staging.toml at lines 16-16, leaving exactly one header in
each file so the intended two-row challenge body is loaded.
| @@ -1 +1 @@ | |||
| e68a49e313f41aa892898d50b99e94393424a5c173e6136b397e24c726f14d13f031f75f685213f3d84f791fc67836e4765e5a9c70f4f4c956022679fabac98f | |||
| c0c1be58a06daa6713c482ac3619649354ae3229fdc307f212f401dc5d2c17318f8ac9f8d3f9be6ab605a525907b77d9e083cb47c37f4df8231285a4fc104f80 | |||
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
for pair in \
"config/challenges.toml config/challenges.toml.sig" \
"config/challenges.staging.toml config/challenges.staging.toml.sig"
do
read -r config signature <<<"$pair"
test -f "$config"
test -f "$signature"
value="$(tr -d '[:space:]' <"$signature")"
[[ "$value" =~ ^[0-9a-fA-F]{128}$ ]]
done
rg -n -C 6 \
'load_config_dir|challenges(\.staging)?\.toml\.sig|verify|signature' \
config crates/trustrootRepository: BaseIntelligence/base
Length of output: 34272
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== local lock/config files for trustroot =="
git ls-files | rg '(^|/)(Cargo\.lock|Cargo\.toml|trustroot|config/.*\.toml|config/.*\.sig|config/owner\.pubkey)$' || true
echo "== config ownership/signature files =="
for f in config/owner.pubkey config/challenges.toml config/challenges.toml.sig config/challenges.staging.toml config/challenges.staging.toml.sig; do
if [ -f "$f" ]; then
echo "--- $f"
wc -c "$f"
if [[ "$f" == *.toml ]]; then
sed -n '1,120p' "$f"
else
cat "$f"
fi
else
echo "MISSING $f"
fi
done
echo "== trustroot bin CLI candidate files =="
fd -i 'main\.rs|cli|bin' crates/trustroot 2>/dev/null || true
rg -n "struct .*Cli|clap|sign --|verify --|owner-pub|kind" crates/trustroot .cargo 2>/dev/null || true
echo "== local build tool availability =="
command -v cargo || true
command -v rustc || trueRepository: BaseIntelligence/base
Length of output: 5060
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== trustroot CLI files =="
git ls-files | rg 'trustroot|bins/trustroot|xtask|cargo-hack|xtask|dev|ci' | rg -v '(^|/)(README\.md|LICENSE|\.md)$' || true
sed -n '1,260p' bins/trustroot/Cargo.toml
echo
rg -n "runbin|bin|trustroot|verify|sign|owner-pub|kind" bins/trustroot crates/trustroot xtask Cargo.toml Cargo.lock crates/crypto/src crates/crypto -g '*.rs' || trueRepository: BaseIntelligence/base
Length of output: 34833
Verify both replacement signatures against their exact environment-specific configurations.
load_challenges_file_with_sig reads the adjacent TOML, parses /version, /introduced_epoch, and [[challenges]], SCALE-encodes the TOML body, and verifies the 64-byte sr25519 signature under config/owner.pubkey over scale(version, introduced_epoch, body) in the base-trustroot-v1 domain. Use the CLI or library verifier for both paths; a 128-character hexadecimal value is only a format check.
config/challenges.toml.sig#L1-L1: verify against committedconfig/challenges.toml.config/challenges.staging.toml.sig#L1-L1: verify against committedconfig/challenges.staging.toml.
📍 Affects 2 files
config/challenges.toml.sig#L1-L1(this comment)config/challenges.staging.toml.sig#L1-L1
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@config/challenges.toml.sig` at line 1, Verify the signature in
config/challenges.toml.sig:1 against the committed config/challenges.toml using
load_challenges_file_with_sig or the CLI/library verifier, including the parsed
metadata, SCALE-encoded body, owner.pubkey, and base-trustroot-v1 domain. Apply
the same exact-environment verification to config/challenges.staging.toml.sig:1
against config/challenges.staging.toml; do not rely only on hexadecimal format
validation.
| | DCAP error classification | Matches on `anyhow` message text; re-run `cargo test -p attest-policy --features dcap` after any `dcap-qvl` bump. | | ||
| | Design compose/images | deploy-wiring in progress; local port `28093` documented. | | ||
| | Design emission ceremony | Owner must keygen prod `design_sk`, set bps, re-sign trust root. | | ||
| | Design emission ceremony | Emission live at 5000/5000 with design; optional prod `design_sk` / owner key rotation still pending. | |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not mark production emission as live before activation.
Line 83 still marks the production master as pending. The PR also requires configuration deployment, service restarts, and a subsequent sealed: true seal before the new shares become active. Use a status such as “configured at 5000/5000; production activation pending.”
As per coding guidelines, normative documentation is the source of truth for contracts, operations, and status.
Proposed wording
-| Design emission ceremony | Emission live at 5000/5000 with design; optional prod `design_sk` / owner key rotation still pending. |
+| Design emission ceremony | Configured at 5000/5000; production activation pending deployment, restart, and `sealed: true` verification. |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Design emission ceremony | Emission live at 5000/5000 with design; optional prod `design_sk` / owner key rotation still pending. | | |
| | Design emission ceremony | Configured at 5000/5000; production activation pending deployment, restart, and `sealed: true` verification. | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/COMPLETENESS.md` at line 120, Update the “Design emission ceremony”
status entry in COMPLETENESS.md to avoid claiming production emission is live;
state that it is configured at 5000/5000 with production activation still
pending, including the required deployment, restarts, and sealed:true step as
appropriate.
Source: Coding guidelines
| Emission share for prism is owner-controlled via the trust root. Current split is | ||
| `5000` bps prism / `5000` bps design (50/50) — see |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 4 'github\.com|emission|5000|10000' docs/external-miner docs/PRISM.mdRepository: BaseIntelligence/base
Length of output: 7974
🌐 Web query:
BaseIntelligence prism github BaseIntelligence/prism emission share prism design 5000 10000
💡 Result:
Prism is a decentralized neural architecture search (NAS) challenge hosted on the BASE subnet (Subnet 100 on the Bittensor network) [1][2]. It is designed to evaluate a model's ability to learn from scratch by having miners submit two-script bundles (architecture.py and training.py) [1]. Regarding your query on emission and design: 1. Emission Share: Recent documentation for the BaseIntelligence ecosystem explicitly confirms an "absolute 50/50 emission" split between the Prism challenge and other challenges (such as the agent-challenge) within the subnet [3]. This policy is emphasized in the context of "emission honesty" to ensure transparent distribution [3][4]. 2. Design (5000/10000): The specific figures 5000 and 10000 do not appear as fundamental design constants or emission parameters in the Prism repository documentation [1][5]. Prism's design centers on "prequential" (online) compression metrics, where submitted models are evaluated using a locked FineWeb-Edu dataset under forced random initialization [1]. The score is based on the area under the from-scratch loss curve, normalized by bytes consumed [1]. The platform operates as a decentralized challenge where miners own their models and training loops, while the challenge retains ownership of the data and the scoring process [1]. System tools for managing these environments are maintained within the BaseIntelligence monorepo, which provides lab tools for local deployment and testing of Prism miners [6][7][4].
Citations:
- 1: https://github.com/PlatformNetwork/prism
- 2: https://github.com/BaseIntelligence
- 3: 17196bc
- 4: main@{1day}...main
- 5: https://github.com/BaseIntelligence/prism/blob/main/docs/architecture.md
- 6: 5b1c7e9
- 7: BaseIntelligence:85d20e0...BaseIntelligence:5b2c88e
🌐 Web query:
site:github.com/BaseIntelligence/prism emission_share prism 5000 design
💡 Result:
I couldn’t find an indexed GitHub result matching all terms for BaseIntelligence/prism, emission_share, 5000, and design.
The search results mainly surfaced unrelated Prism repositories, including PrismLibrary and runprism/prism. (github.com)
Citations:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
curl -fsSL https://raw.githubusercontent.com/BaseIntelligence/prism/main/README.md > /tmp/prism_readme.txt 2>/tmp/curl_error.txt || true
if [ -s /tmp/prism_readme.txt ]; then
rg -n -C 4 'emission|5000|10000|split|shares?|subnets?|docs?/.*md#L|docs/|docs' /tmp/prism_readme.txt || true
echo '---'
wc -l /tmp/prism_readme.txt
else
echo 'README fetch empty or failed'
cat /tmp/curl_error.txt || true
fi
printf '\n--- README docs/prism-related files ---\n'
if command -v gh >/dev/null 2>&1; then
gh api repos/BaseIntelligence/prism/contents/docs 2>/tmp/gh_api_err.txt | jq -r '.[].name // empty' || true
else
echo 'gh not available'
fiRepository: BaseIntelligence/base
Length of output: 1582
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- public BaseIntelligence/prism docs: mining docs ---'
github=BaseIntelligence/prism
for file in docs/README.md docs/getting-started.md docs/submit.md docs/scoring.md docs/api.md; do
echo "### $file"
curl -fsSL "https://raw.githubusercontent.com/$github/main/$file" > "/tmp/$file"
rg -n -C 5 'emission|emission|5000|10000|split|shares?|competit(ion|ing)|challenge|prism|design' "/tmp/$file" || true
done
echo '--- local external-miner/prism.md excerpt ---'
sed -n '1,150p' docs/external-miner/prism.md | rg -n -C 5 'README|Miner|emission|5000|10000|split|docs/getting-started|Getting started' || trueRepository: BaseIntelligence/base
Length of output: 295
🏁 Script executed:
#!/bin/bash
set -euo pipefail
github=BaseIntelligence/prism
for file in docs/README.md docs/getting-started.md docs/submit.md docs/scoring.md docs/api.md; do
echo "### $file"
curl -fsSL "https://raw.githubusercontent.com/$github/main/$file" ">/tmp/prism-$file" 2>/tmp/curl-err.txt || { echo "fetch failed"; cat /tmp/curl-err.txt; continue; }
rg -n -C 5 'emission|5000|10000|split|shares?|competit(ion|ing)|challenge|prism|design' "/tmp/prism-$file" || true
done
echo '--- local external-miner/prism.md relevant excerpt ---'
rg -n -C 6 'emission|5000|10000|split|README|Getting started|getting-started' docs/external-miner/prism.md docs/external-miner/README.mdRepository: BaseIntelligence/base
Length of output: 13429
Update the public Prism miner docs for the allocation.
docs/external-miner/prism.md now documents a 5000/5000 Prism/Design split, but BaseIntelligence/prism mining docs only say prism’s emission share is owner-controlled and does not include the current allocation. Keep miner-facing documentation synchronized.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/external-miner/prism.md` around lines 124 - 125, Update the Prism miner
allocation section in prism.md to include the current 5000 bps Prism / 5000 bps
Design (50/50) split, while retaining the note that the emission share is
owner-controlled via the trust root. Ensure the public documentation matches the
allocation stated in the BaseIntelligence/prism mining docs.
Source: Coding guidelines
| Re-sign challenges.toml with previous bps (e.g. design 2000 / prism 8000, or | ||
| design 0 / prism 10000), roll validators. Challenge service can keep running; | ||
| emission share alone changes aggregation weight. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Make the fresh seal the activation boundary in both runbooks.
Re-signing and validator rollout do not modify an existing sealed bundle. Both procedures must state the environment-specific trust-root deployment, required consumer restarts, fresh sealing, and /v1/weights/latest verification before operators rely on the new allocation.
docs/runbooks/design-enable-and-emission.md#L72-L74: extend rollback with deployment, restart, fresh-seal, andsealed: trueverification steps.docs/runbooks/prism-enable-lium-and-emission.md#L13-L26: extend the emission ceremony with the same activation sequence.
As per coding guidelines: docs/{runbooks/**/*.md,external-miner/**/*.md} requires verifying the raw-weight seal path produces sealed: true weights.
📍 Affects 2 files
docs/runbooks/design-enable-and-emission.md#L72-L74(this comment)docs/runbooks/prism-enable-lium-and-emission.md#L13-L26
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/runbooks/design-enable-and-emission.md` around lines 72 - 74, Update
docs/runbooks/design-enable-and-emission.md lines 72-74 and
docs/runbooks/prism-enable-lium-and-emission.md lines 13-26 so the fresh seal is
the activation boundary: document environment-specific trust-root deployment,
required consumer restarts, fresh sealing, and verification that
/v1/weights/latest returns sealed: true before relying on the allocation. In
both runbooks, preserve the existing ceremony details while explicitly requiring
this sequence for activation.
Source: Coding guidelines
| ## Emission ceremony (shared with design) | ||
|
|
||
| Trust root today: **`prism = 10000` bps**, **`design = 0` bps** (sum must stay | ||
| Trust root today: **`prism = 5000` bps**, **`design = 5000` bps** (sum must stay |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Add the fresh-seal activation steps to the emission ceremony.
The ceremony stops after re-signing and rolling validators. A new EpochBundleBodyV1 receives emission_shares during sealing, so operators must deploy the new trust root, restart components that load it as required, create a fresh seal, and verify /v1/weights/latest reports the intended shares with sealed: true.
As per coding guidelines: docs/{runbooks/**/*.md,external-miner/**/*.md} requires verifying the raw-weight seal path produces sealed: true weights.
Also applies to: 23-26
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/runbooks/prism-enable-lium-and-emission.md` at line 13, Add fresh-seal
activation steps to the emission ceremony in the relevant runbook section:
deploy the updated trust root, restart components that load it as required,
create a fresh seal, and verify /v1/weights/latest reports the intended emission
shares with sealed: true. Explicitly include verification of the raw-weight seal
path producing sealed: true weights.
Source: Coding guidelines
| ("emission_share", "emission_share_bps = 5000"), | ||
| ("bps_sum", "10000"), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Make the freeze gate verify both sides of the 50/50 split.
The new checks require emission_share_bps = 5000 for Design and the substring 10000. They never require a Prism value of 5000 or bind both values to the same 10,000-basis-point allocation. A document with Design at 5,000 and Prism at 8,000 can pass if 10000 appears elsewhere. Add a distinct Prism pin and a negative test for a non-5,000 Prism value.
Also applies to: 129-133, 194-194
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@xtask/src/design_check.rs` around lines 31 - 32, Update the freeze-gate
checks in the design validation logic to require distinct 5,000-basis-point
values for both Design and Prism, and validate that their combined allocation is
exactly 10,000 rather than merely searching for an unrelated substring. Extend
the related test cases with a document using a non-5,000 Prism value and assert
that the gate rejects it.
Summary
10000bps.design,prism); no other challenge was zeroed.config/challenges.toml+config/challenges.staging.tomlunder the committed throwaway owner key; updated design-check pins, site/trustroot tests, and normative docs/runbooks.Deploy / seal impact
Prod is not updated by this PR alone. After merge:
config/challenges.toml+.sigonto prod master and prod validator (bind-mounted/etc/base/config).base-real-seal/base-burn-seal, or operator one-shotweights-smokeagainsthttps://chain.joinbase.ai.GET https://chain.joinbase.ai/v1/weights/latestshowsemission_shares: {design: 0.5, prism: 0.5}andsealed: true.Weight impact
Test plan
/v1/weights/latestis 0.5/0.5 sealedSummary by CodeRabbit