Propagate price-based emissions and locked transfer flags - testnet#2782
Propagate price-based emissions and locked transfer flags - testnet#2782gztensor wants to merge 17 commits into
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)
- 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>
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: gztensor has repo write permission, account age >2 years, substantial subtensor contribution history, no trusted Gittensor allowlist hit; branch feat/propagate-pr-2780-testnet -> testnet. Static Skeptic review covered the runtime/pallet changes for locked-alpha receive flags and miner-burn emission weighting. The PR does not modify FindingsNo findings. ConclusionNo malicious pattern or security vulnerability was found in the diff. The new dispatch is signed and fee-paying, locked-alpha rejection checks run before affected storage writes, and the emission reweighting uses saturating fixed-point math with a zero-weight fallback. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor: UNKNOWN by trusted allowlists; author has repo write permission and substantial subtensor contribution history. Description matches the implementation. The PR carries a testnet runtime Duplicate-work check: #2785 is the matching devnet-ready propagation and does not supersede this testnet-targeted PR. #2746 is a broader main-targeted account-transfer flag proposal, not a better candidate for this deployment propagation. Other overlapping PRs are deployment branches or unrelated work sharing common subtensor files.
FindingsNo findings. ConclusionI found no domain-level blockers in the locked-alpha receive flag, same-subnet stake transfer and coldkey swap checks, miner-burn accounting, emission-share reweighting, or dissolve cleanup. This is ready from the Auditor perspective, subject to normal CI. |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
# Conflicts: # pallets/subtensor/src/macros/dispatches.rs # pallets/subtensor/src/macros/errors.rs # pallets/subtensor/src/staking/lock.rs # pallets/subtensor/src/tests/coinbase.rs
…into feat/propagate-pr-2780-testnet
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Description
Back-propagates the locked-alpha transfer flag and price-based emission updates to
testnet.What changed
AccountFlagsstorage and theset_reject_locked_alphaextrinsic so coldkeys can opt in or out of receiving locked alpha.MinerBurnedaccounting for the proportion of miner incentive emission withheld from miners because it was directed to subnet owner or immune hotkeys.root_proportion * price * (1 - miner_burned)and falls back to price shares if all combined weights are zero.MinerBurnedon subnet dissolution and updates weights/tests for the new storage reads.Behavioral impact
Coldkeys reject incoming locked alpha by default. A coldkey can call
set_reject_locked_alpha(false)to accept locked alpha from stake transfers or coldkey swaps, andset_reject_locked_alpha(true)to return to the default rejection behavior.Subnets that withhold miner incentive emission through owner or immune hotkeys receive proportionally less future chain emission, with that emission reallocated among eligible subnets.
Spec version / migration
This changes runtime behavior and requires a testnet runtime
spec_versionbump. The Auditor auto-fix bumpedruntime/src/lib.rsfrom421to422. The new storage maps use defaults and do not require an explicit storage migration.Testing
The PR adds coverage for account flag defaults and setter behavior, locked-alpha rejection/allowance on stake transfer and coldkey swap paths, subnet dissolve cleanup, and emission-share reweighting for no burn, partial burn, full burn, all-full-burn fallback, and root-proportion weighting.