Skip to content

Release 446 - #3077

Merged
UnArbosFive merged 35 commits into
mainfrom
release-v446
Aug 13, 2026
Merged

Release 446#3077
UnArbosFive merged 35 commits into
mainfrom
release-v446

Conversation

@UnArbosFour

@UnArbosFour UnArbosFour commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Release 446

Runtime spec 446 introduces corrected alpha accounting, a refined conviction ownership quorum, configurable Liquid Alpha consensus modes, auditable timelock reveal failures, and a GRANDPA warp-sync fix.

Alpha accounting and conviction ownership

  • Repairs historical SubnetAlphaOut undercounts and backfills alpha burned before AlphaBurned tracking began.
  • Rebases issuance, burn, and recycle counters inherited by reused subnet slots, guarded by each subnet generation's registration block.
  • Changes the conviction ownership quorum to 10% of eligible alpha:
    SubnetAlphaOut - SubnetProtocolAlpha - AlphaBurned, using saturating subtraction.
  • Prevents ownership transfer when eligible alpha is zero.

Liquid Alpha consensus modes

  • Adds LiquidAlphaConsensusMode with Current, Previous, and default Auto modes.
  • Current uses consensus calculated in the current epoch.
  • Previous uses persisted consensus from the prior epoch, falling back to current consensus when none is stored.
  • Auto uses previous consensus when bonds_penalty == u16::MAX and current consensus otherwise.
  • Adds an owner/root AdminUtils call to change the mode during the subnet admin window, subject to per-hyperparameter rate limiting.

Timelock commitment recovery

  • Accepts both pallet-native TLE ciphertext and the SDK's portable UserData envelope for timelocked commitments.
  • Adds explicit terminal failure states for corrupt ciphertext, round mismatches, invalid quicknet points, and expired pulses.
  • Emits CommitmentRevealFailed once, retains the failed field in CommitmentOf for audit, and removes it from the retry index.
  • Rejects user-submitted TimelockRevealFailed fields; only the runtime can create this state.
  • Adds Timelocked.encrypted for retrieving the pallet-native inner ciphertext.

GRANDPA warp sync

  • Applies Finney's historical initial set-ID offset only when warp sync starts from set zero.
  • Uses the set ID returned by each proof fragment for subsequent authority-set rotations instead of reapplying the initial offset.

Runtime

  • Bumps spec_version to 446.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview Aug 13, 2026 9:23pm

Request Review

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

VERY HIGH scrutiny (42-day-old account, one public repo), mitigated by repository write permission; no Gittensor association found; release-v446 → main.

Static analysis of the complete release diff found no security vulnerability or malicious behavior. The runtime specification is bumped to 446, and no AI-review trust-boundary files or dependency manifests were changed.

Findings

No findings.

Conclusion

The accounting migrations are mainnet- and generation-guarded, privileged calls retain appropriate origin checks, and the timelock, GRANDPA, consensus, and CI changes introduce no credible adverse path.


🔍 AI Review — Auditor (domain review)

VERDICT: 👎

UNKNOWN Gittensor association; newer contributor with repository write permission, so maximum scrutiny applied.

Duplicate work

This PR is the better candidate. Recommend closing #3073. This release incorporates the conviction/accounting changes with broader migration and behavioral test coverage.

The PR description is substantive and spec_version is bumped to 446. No build was needed because the remaining blocker is statically evident.

Findings

Sev File Finding
HIGH pallets/subtensor/src/migrations/migrate_rebase_recycled_alpha_asset_counters.rs:95 Rebase silently accepts invalid live counters inline

Prior-comment reconciliation

  • 5163b058: not addressed — The migration still reaches saturating subtraction without preflight validation and subsequently records completion.

Conclusion

The release remains blocked because a one-shot mainnet migration can silently clamp invalid counters to zero and permanently mark itself complete. Validate every affected counter before making any mutations.


📜 Previous run (superseded)
Sev File Finding Status
HIGH pallets/subtensor/src/migrations/migrate_rebase_recycled_alpha_asset_counters.rs:95 Rebase silently accepts invalid live counters ➡️ Carried forward to current findings
The migration still reaches saturating subtraction without preflight validation and subsequently records completion.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

unarbos and others added 3 commits August 13, 2026 08:18
Decrypt errors were wiping TimelockEncrypted storage without writing RevealedCommitments, which silently dropped SDK UserData envelopes after the pulse arrived.

Co-authored-by: Cursor <cursoragent@cursor.com>
Failed decrypts and rounds older than the oldest kept Drand pulse
leave TimelockedIndex after one attempt, so on_initialize does not
pair or emit forever.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fix alpha accounting and conviction terms
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions github-actions Bot left a comment

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.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment on lines +90 to +95
T::AlphaAssets::rebase_alpha_counters(
netuid,
AlphaBalance::from(issuance),
AlphaBalance::from(burned),
AlphaBalance::from(recycled),
);

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.

[HIGH] Rebase silently accepts invalid live counters

rebase_alpha_counters uses saturating subtraction, but this migration never verifies that each live counter is at least its embedded offset. If the snapshot is stale or any live counter differs unexpectedly, the migration silently clamps it to zero, continues with the remaining rows, and later records HasMigrationRun, making the corruption permanent. The tests only construct counters as offset + remainder, so they do not cover this failure mode.

Before mutating, read and validate all affected counters (including recycled), and abort or skip without setting the run marker on any inconsistency. Add try-runtime pre/post checks proving that each post-state equals its exact pre-state minus the offset, plus a test where a counter is below its offset.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions github-actions Bot left a comment

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.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

AlphaBalance::from(issuance),
AlphaBalance::from(burned),
AlphaBalance::from(recycled),
);

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.

[HIGH] Rebase silently accepts invalid live counters

This helper uses saturating_sub without proving each live counter is at least its embedded offset. If a constant is wrong or live state differs, the migration clamps the counter to zero, continues applying corrections, and later sets HasMigrationRun, making the partial corruption permanent. Preflight every matching generation and all three counters before any mutation; on failure, change nothing and leave the marker unset. Add a live < offset regression test.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

…on-failure

Keep timelock commitments when reveal fails

@github-actions github-actions Bot left a comment

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.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment on lines +90 to +95
T::AlphaAssets::rebase_alpha_counters(
netuid,
AlphaBalance::from(issuance),
AlphaBalance::from(burned),
AlphaBalance::from(recycled),
);

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.

[HIGH] Rebase silently accepts invalid live counters

rebase_alpha_counters applies each offset with saturating_sub. If any live counter is below its archived offset, this silently writes zero; the migration then records completion, making the corruption permanent. Preflight every matching generation and verify all three current counters are at least their offsets before mutating any entry. On validation failure, leave all counters and the migration marker untouched.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions github-actions Bot left a comment

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.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment on lines +90 to +95
T::AlphaAssets::rebase_alpha_counters(
netuid,
AlphaBalance::from(issuance),
AlphaBalance::from(burned),
AlphaBalance::from(recycled),
);

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.

[HIGH] Rebase silently accepts invalid live counters

This still passes offsets directly to rebase_alpha_counters, whose saturating_sub operations silently clamp any live counter below its expected historical offset to zero. The migration then records completion, making corrupted results permanent; processing rows sequentially can also leave a partial rebase if validation is added only inside this loop. Preflight-read and validate all three counters for every generation-matching row before performing any mutation, and do not set HasMigrationRun when validation fails. Add a test where one counter is below its offset and assert that no rows are changed and the migration remains retryable.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions github-actions Bot left a comment

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.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment on lines +90 to +95
T::AlphaAssets::rebase_alpha_counters(
netuid,
AlphaBalance::from(issuance),
AlphaBalance::from(burned),
AlphaBalance::from(recycled),
);

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.

[HIGH] Rebase silently accepts invalid live counters

rebase_alpha_counters uses saturating subtraction. If any live issuance, burned, or recycled counter is below its hard-coded offset, this silently clamps that counter to zero; the migration then continues and records itself complete. Because this is a one-shot mainnet accounting migration, preflight every affected generation and counter before performing any writes, and abort without setting HasMigrationRun when an offset exceeds the live value. Add a regression test covering an undersized counter.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@UnArbosFive
UnArbosFive merged commit 52d7e7c into main Aug 13, 2026
107 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants