BlockEmission RPC#2778
Conversation
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: established @opentensor contributor with write permission; no Gittensor allowlist hit; branch block-emission-rpc -> devnet-ready. Reviewed the trusted instructions, prefetched metadata, prior Skeptic sticky, contributor signals, comments, changed-file list, and full patch. The PR does not modify FindingsNo findings. ConclusionNo malicious behavior or security vulnerability was found in the static diff. The prior Skeptic sticky has no finding IDs, so there is nothing to reconcile. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor UNKNOWN; author has write permission and substantial prior subtensor activity, so review is calibrated as established contributor domain review. PR body is substantive and implementation is aligned with the stated behavior, except for one stale detail: the body says
Findings
Prior-comment reconciliation
ConclusionThe PR removes the derived per-block 📜 Previous run (superseded)
|
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
conflicts |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Description
This PR replaces the
BlockEmissionstorage-map update path with a custom block-emission RPC. The goal is to avoid writing the same derived emission value to storage every block while still exposing the current block emission to callers.What Changed
subnetInfo_getBlockEmissionto the subtensor custom RPC surface.get_block_emission()to the subtensor runtime API and wired the runtime implementation toSubtensorModule::calculate_block_emission().BlockEmissioninsidecalculate_block_emission().BlockEmissionstorage value as deprecated in favor ofcalculate_block_emission()or the new RPC.runtime/src/lib.rsspec_versionfrom421to422.Behavioral Impact
Block emission is now computed on demand for the RPC instead of being persisted to
BlockEmissionduring block execution. Coinbase minting continues to use the same calculation path, so the emission formula and mint amount are unchanged.Migration / Runtime Version
This is runtime-affecting and includes a
spec_versionbump. No storage migration is introduced; the existingBlockEmissionstorage item remains present but deprecated.Testing
CI should run the runtime/RPC compile checks. The Auditor pass verified formatting for the changed Rust files with
rustfmt --edition 2024 --checkandgit diff --check; a local targetedcargo checkattempt was blocked by the sandboxed read-only Cargo/rustup cache paths.