Back propagate new subnet emission off - clean merge#2790
Conversation
- Add a per-subnet MinerBurned storage holding the proportion (0..1) of each tempo's miner (incentive) emission that was burned during emission distribution because the recipient hotkey is owned by the subnet owner. - Weight price-based emission shares by (1 - miner_burned) and renormalize, so subnets that burn more of their miner emission receive proportionally less chain emission (reallocated toward non-burning subnets). Co-authored-by: Cursor <cursoragent@cursor.com>
- Count miner emission withheld via an owner/immune hotkey toward the burned proportion whether it is recycled or burned, so the emission penalty is independent of a subnet's RecycleOrBurn config (no Recycle bypass, no unique penalty for the unset default). - Clear MinerBurned on subnet removal so a deregistered subnet leaves no stale proportion; extend dissolve cleanup test to cover it. - Add active tests for the price-share reweight by (1 - miner_burned): no-burn, partial burn, full burn, and all-full-burn fallback to price shares. Co-authored-by: Cursor <cursoragent@cursor.com>
Emission share is now proportional to root_proportion * price * (1 - miner_burned), renormalized. Multiplying by root_proportion (which shrinks as a subnet's alpha issuance grows) reallocates chain emission away from older subnets toward newer ones, easing entrance for new subnets. Falls back to unweighted price shares when the combined weight is zero (e.g. no root stake). Adds get_shares tests: no-burn, partial/full burn, all-full-burn fallback, and root_proportion favoring newer subnets. Co-authored-by: Cursor <cursoragent@cursor.com>
Price-based emissions with miner-burn scaling (+ locked transfer flags)
New subnets registered via do_register_network now start with SubnetEmissionEnabled set to false so emission must be explicitly enabled, rather than relying on the storage default of true. Update the two coinbase tests that registered a dynamic network and expected emission to be on by enabling it explicitly. Co-authored-by: Cursor <cursoragent@cursor.com>
…-off Default subnet emission off on registration
eco-tests changed — indexer review requiredThis PR modifies files under Changed files
|
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: gztensor has write permission, an established account, and substantial prior subtensor PR history; branch targets devnet-ready. Static Skeptic review found no The security-relevant changes are limited to pallet/runtime code: locked-alpha recipient opt-in flags, guards on locked stake transfer/coldkey swap, miner-burn tracking, emission-share reweighting, storage cleanup, weights, tests, and a runtime FindingsNo findings. ConclusionNo malicious behavior or security vulnerability was found in the static diff review. I did not run builds or tests, per Skeptic rules. 🔍 AI Review — Auditor (domain review)VERDICT: 👎 Gittensor: UNKNOWN by allowlist; author has write access and substantial repo history, so review is calibrated as established contributor/backport work. PR body was empty/trivial; the Auditor has auto-filled it. Please review. The PR body is currently trivial, so I populated Duplicate-work check: PR #2785 is the same author's earlier propagation branch and includes the missing Findings
ConclusionBlocking on missing active tests for the new emission accounting and share-weighting behavior. The runtime spec bump is present and the locked-alpha transfer paths have targeted coverage. |
| ); | ||
| } | ||
|
|
||
| // Record the proportion of this tempo's miner emission that was withheld from | ||
| // miners (directed to owner/immune hotkeys, whether recycled or burned). | ||
| let withheld_proportion: U96F32 = U96F32::saturating_from_num(withheld_incentive.to_u64()) | ||
| .checked_div(U96F32::saturating_from_num(total_incentive.to_u64())) | ||
| .unwrap_or_else(|| U96F32::saturating_from_num(0)); | ||
| MinerBurned::<T>::insert(netuid, withheld_proportion); |
There was a problem hiding this comment.
[HIGH] Emission penalty path lacks active tests
This adds a new economic signal (MinerBurned) and feeds it into chain emission allocation, but the final diff has no active test proving the recorded ratio or the resulting share math. The only change in tests/subnet_emissions.rs is an import, even though the commits and overlapping branches contain tests for no-burn, partial-burn, full-burn, all-full-burn fallback, and root-proportion weighting. Please restore/add active coverage for both sides of the behavior: distribute_emissions records withheld_incentive / total_incentive correctly, including recycle/burn/default and zero-total cases, and get_shares reallocates as root_proportion * price * (1 - miner_burned) with the all-zero fallback. This is runtime emission economics, so it should not merge untested.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
Summary
Back-propagates the main-branch locked-alpha receiver flag and subnet-emission scaling changes onto
devnet-readyafter resolving merge conflicts.What Changed
AccountFlagsandset_reject_locked_alpha, allowing a coldkey to opt in or out of receiving locked alpha from stake transfers and coldkey swaps. Coldkeys reject locked alpha by default unless they opt in.MinerBurnedtracking for the proportion of miner incentive emission withheld from miners because it was directed to owner/immune hotkeys.root_proportion * (1 - miner_burned)and renormalizes, reallocating emission away from older/high-withholding subnets.MinerBurnedon subnet dissolve and updates transfer-stake weights for the extraAccountFlagsread.runtimespec_versionto422.Behavioral Impact
Destination coldkeys must explicitly opt in before receiving nonzero locked alpha through stake transfer or coldkey swap paths. Subnet block emission allocation now depends on EMA price, root proportion, and the recently withheld miner-emission proportion.
Testing
The diff includes unit coverage for account flag defaults and fee payment, locked-alpha transfer rejection/allowance, coldkey swap rejection/allowance, and subnet dissolve cleanup. Before merge, active tests should also cover the new
MinerBurnedrecording andget_sharesemission weighting boundary cases.