Skip to content

Add override-only emission suppression for testnet#2462

Open
ppolewicz wants to merge 7 commits intotestnetfrom
emission_suppression_testnet
Open

Add override-only emission suppression for testnet#2462
ppolewicz wants to merge 7 commits intotestnetfrom
emission_suppression_testnet

Conversation

@ppolewicz
Copy link
Collaborator

@ppolewicz ppolewicz commented Feb 25, 2026

Summary

  • Ports emission suppression from emission_suppression branch with only root-level override functionality (no vote map, no vote extrinsic, no vote collection)
  • EmissionSuppressionOverride storage: root can force-suppress/unsuppress subnets via sudo_set_emission_suppression_override (call_index 133)
  • Suppressed subnets get zero TAO emission share; remaining shares renormalized
  • Alpha emissions continue on suppressed subnets (intentional — alpha issuance follows the subnet's own halving curve independently of TAO)
  • Root alpha always accumulates for root validators on suppressed subnets (Enable behavior hardcoded, no mode selection)

Changes from emission_suppression branch

  • Removed: EmissionSuppression (vote-derived map), EmissionSuppressionVote (per-coldkey votes), vote extrinsic, vote collection logic
  • Removed: RootSellPressureOnSuppressedSubnetsMode enum, KeepRootSellPressureOnSuppressedSubnets storage, sudo_set_root_sell_pressure_on_suppressed_subnets_mode (call_index 135)
  • Renamed: CannotVoteOnRootSubnet error → CannotSuppressRootSubnet

Key design decisions

  • TAO-only suppression: suppression zeroes the TAO share but alpha issuance is independent. Suppressed subnets continue to mint and distribute alpha to miners, validators, and root validators.
  • Some(false) override: accepted and stored but currently identical to None for emission calculations. Reserved for future use (e.g. explicit override of a future automatic suppression mechanism).

Test plan

  • 14 unit tests passing (cargo test emission_suppression)
    • Override force suppress/unsuppress/clear
    • Share renormalization (single and all-suppressed)
    • Dissolution cleanup
    • Alpha emissions continue on suppressed subnets
    • Root alpha accumulation on suppressed subnets
    • Extrinsic event emission
    • Authorization failures (BadOrigin, SubnetNotExists, CannotSuppressRootSubnet)
    • End-to-end run_coinbase integration test
  • Verify extrinsic works on testnet deployment
  • Confirm suppressed subnet receives zero TAO but continues alpha emissions

🤖 Generated with Claude Code

Port emission suppression from emission_suppression branch with only
root-level override functionality (no EmissionSuppression vote map,
no EmissionSuppressionVote, no vote_emission_suppression extrinsic).

Includes:
- EmissionSuppressionOverride storage (root sets per-subnet)
- KeepRootSellPressureOnSuppressedSubnets (Disable/Enable/Recycle modes)
- sudo_set_emission_suppression_override extrinsic (call_index 133)
- sudo_set_root_sell_pressure_on_suppressed_subnets_mode (call_index 135)
- Suppressed subnets get zero emission share with renormalization
- Root alpha handling: Disable recycles to validators, Recycle swaps+burns
- Subnet dissolution cleanup
- 18 override-only tests
@ppolewicz ppolewicz added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Feb 25, 2026
Clarify that Recycle mode swaps root alpha to TAO via AMM, then
recycles the TAO (removes from TotalIssuance). Add assertions that
the TotalIssuance drop equals the TAO that left the subnet pool,
proving all swap proceeds were recycled. Fix comments to use
"recycled" instead of "burned" throughout.
Tests 14 and 16 were incorrectly asserting that TotalIssuance decreases
in Recycle mode. In reality, emission increases TotalIssuance first
(via inject_and_maybe_swap), then the recycle partially offsets it.
The net effect is a smaller increase, not a decrease.

Rewrite both tests to run Enable mode as baseline, then Recycle mode
from the same starting state, and assert Recycle issuance < Enable
issuance — proving TAO was recycled without depending on test-setup
artifacts.
…behavior

Remove the mode enum, storage value, sudo extrinsic (call_index 135), and
event. Root always accumulates alpha on suppressed subnets. Remove all
mode-related tests.
- Add test verifying suppressed subnets still receive alpha emissions
  (TAO-only suppression is intentional)
- Rename CannotVoteOnRootSubnet to CannotSuppressRootSubnet
- Clarify doc comments: Some(false) is currently identical to None
- Add benchmark for sudo_set_emission_suppression_override
- Add extrinsic authorization failure tests
- Add end-to-end run_coinbase integration test
// Get subnet TAO emissions.
let shares = Self::get_shares(subnets_to_emit_to);
let mut shares = Self::get_shares(subnets_to_emit_to);
Self::apply_emission_suppression(&mut shares);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we filter out the suppressed subnet in get_subnets_to_emit_to, instead of compute the emission again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed we could!

Instead of computing shares, zeroing suppressed entries, and
renormalizing, filter suppressed subnets out before get_shares so
remaining subnets naturally split the full emission. Suppressed
subnets are added back with zero TAO so alpha issuance continues.

Remove apply_emission_suppression and normalize_shares (no longer
needed). Update tests to use get_subnet_block_emissions and
is_subnet_emission_suppressed directly. Add symmetric tolerance
check in e2e test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants