Skip to content

Subnet Protocol Alpha Accounting#2645

Open
JohnReedV wants to merge 8 commits into
devnet-readyfrom
chain-buy-cache
Open

Subnet Protocol Alpha Accounting#2645
JohnReedV wants to merge 8 commits into
devnet-readyfrom
chain-buy-cache

Conversation

@JohnReedV
Copy link
Copy Markdown
Contributor

Description

This PR adds protocol-owned alpha accounting for subnet chain buys and includes that alpha in subnet deregistration settlement.

  • Stops recycling alpha bought during protocol TAO buys
  • Adds per-subnet cached protocol alpha accounting
  • Includes protocol alpha-in and cached protocol alpha in deregistration pro-rata settlement
  • Clears cached protocol alpha when a subnet is dissolved
  • Updates tests for the new deregistration settlement behavior

@JohnReedV JohnReedV added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label May 7, 2026
if let Ok(buy_swap_result_ok) = buy_swap_result {
let bought_alpha: AlphaBalance =
buy_swap_result_ok.amount_paid_out.into();
Self::recycle_subnet_alpha(*netuid_i, bought_alpha);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please call burn_alpha if no changes in total alpha issuance are required? We need to account for all kinds of alpha disappearance

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It gets recycled later after being added to the protocol account on subnet dereg

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