Skip to content

Liquid Alpha 2.1 Consensus Modes - #3070

Merged
UnArbosFour merged 11 commits into
release-v446from
agent/liquid-alpha-consensus-mode
Aug 13, 2026
Merged

Liquid Alpha 2.1 Consensus Modes#3070
UnArbosFour merged 11 commits into
release-v446from
agent/liquid-alpha-consensus-mode

Conversation

@UnArbosSix

Copy link
Copy Markdown
Collaborator

Summary

Adds per-subnet control over which consensus values are used during liquid alpha bond calculations.

  • Adds Current, Previous, and Auto consensus modes.
  • Defaults to Auto, which uses previous consensus at maximum bond penalty and current consensus otherwise.
  • Applies mode selection to dense and sparse bond calculations.
  • Safely handles missing, shorter, or longer previous-consensus vectors.
  • Adds an owner/root admin call with rate limiting and proxy support.
  • Cleans up consensus-mode storage when dissolving a subnet.
  • Preserves existing SCALE indices by appending the new event and call.

Testing

  • Dense and sparse legacy-behavior regression tests.
  • Auto mode branch coverage.
  • Missing and resized previous-consensus coverage.
  • Root and subnet-owner authorization tests.
  • Mode storage and event tests.
  • SCALE event and call index regression tests.
  • Subnet dissolution cleanup test.
  • Native pallet and runtime checks.
  • Runtime-benchmark feature check.

Generated weights are intentionally left for the benchmark action runner.

@vercel

vercel Bot commented Aug 11, 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 7:31pm

Request Review

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

VERY HIGH scrutiny: 42-day-old account with zero public repos and six UnArbosFour-authored commits, mitigated by repository write permission and substantial merged contributions; no Gittensor association; agent/liquid-alpha-consensus-mode → release-v446.

Static review found the consensus selection, per-mechanism persistence, UID lifecycle handling, authorization, rate limiting, proxy exposure, dissolution cleanup, and updated metadata proof consistent with the stated feature. The GHCR retry does not broaden credential scope, and no AI-review trust-boundary files changed.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found. Runtime changes include the required spec-version bump to 446.


🔍 AI Review — Auditor (domain review)

VERDICT: 👎

Gittensor association UNKNOWN; contributor has substantial recent repository activity and write permission.

The consensus-mode implementation is well tested and generally matches the stated behavior. However, the generated weight for the new extrinsic is still missing. The PR description also omits the unrelated GHCR login retry change in .github/workflows/check-bittensor-e2e-tests.yml.

No spec-version auto-fix is required for the release-v446 base. No runtime confirmation was needed.

Findings

Sev File Finding
HIGH pallets/admin-utils/src/lib.rs:1345 Use the benchmarked weight for the new extrinsic inline

Prior-comment reconciliation

  • 95101df0: not addressed — The benchmark exists, but generated weights remain unchanged and the extrinsic still uses sudo_set_alpha_values().

Conclusion

The generated-weight issue remains blocking: this state-mutating extrinsic must use its own benchmarked weight before merge.


📜 Previous run (superseded)
Sev File Finding Status
HIGH pallets/admin-utils/src/lib.rs:1345 Use the benchmarked weight for the new extrinsic ➡️ Carried forward to current findings
The benchmark exists, but generated weights remain unchanged and the extrinsic still uses sudo_set_alpha_values().

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@UnArbosFour
UnArbosFour changed the base branch from main to release-v446 August 13, 2026 15:37

@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.


/// Sets which consensus values liquid alpha uses for a subnet.
#[pallet::call_index(104)]
#[pallet::weight(<T as pallet::Config>::WeightInfo::sudo_set_alpha_values())]

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] Use the benchmarked weight for the new extrinsic

This new extrinsic is charged as sudo_set_alpha_values, whose generated weight models different storage accesses (LiquidAlphaOn and AlphaValues). The added benchmark is not connected to WeightInfo, so the runtime has no generated weight accounting for LiquidAlphaConsensusMode and its rate-limit writes. Generate the benchmark weights, add sudo_set_liquid_alpha_consensus_mode() to both WeightInfo implementations, and reference it here.

@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.


/// Sets which consensus values liquid alpha uses for a subnet.
#[pallet::call_index(104)]
#[pallet::weight(<T as pallet::Config>::WeightInfo::sudo_set_alpha_values())]

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] Use the benchmarked weight for the new extrinsic

The benchmark function now exists, but generated WeightInfo still has no sudo_set_liquid_alpha_consensus_mode entry, and this call continues to reuse sudo_set_alpha_values. Generate and commit the admin-utils weights, then reference the new weight function here so the declared reads, writes, proof size, and execution time match this call.

@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.

}

/// Sets which consensus values liquid alpha uses for a subnet.
#[pallet::call_index(104)]

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] Use the benchmarked weight for the new extrinsic

The benchmark definition was added, but WeightInfo and both generated implementations still lack sudo_set_liquid_alpha_consensus_mode(). Reusing sudo_set_alpha_values() assigns a profile for different storage accesses and leaves this extrinsic without a generated weight. Run the benchmark action, propagate its output into weights.rs, and reference the new weight function here.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@UnArbosFive
UnArbosFive self-requested a review August 13, 2026 18:38

@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.


/// Sets which consensus values liquid alpha uses for a subnet.
#[pallet::call_index(104)]
#[pallet::weight(<T as pallet::Config>::WeightInfo::sudo_set_alpha_values())]

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] Use the benchmarked weight for the new extrinsic

The benchmark definition now exists, but WeightInfo and its generated implementations still lack sudo_set_liquid_alpha_consensus_mode(). Reusing sudo_set_alpha_values() assigns measurements for different storage access. Regenerate and commit the admin-utils weights, then reference the new method here.

@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.


/// Sets which consensus values liquid alpha uses for a subnet.
#[pallet::call_index(104)]
#[pallet::weight(<T as pallet::Config>::WeightInfo::sudo_set_alpha_values())]

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] Use the benchmarked weight for the new extrinsic

The benchmark now exists, but this extrinsic still charges sudo_set_alpha_values(). Its authorization, rate-limit recording, and storage accesses differ, so that weight does not account for the actual reads and writes. Generate the weights and add/use a dedicated sudo_set_liquid_alpha_consensus_mode() method before merge.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@UnArbosFour
UnArbosFour merged commit 462e29b into release-v446 Aug 13, 2026
87 of 89 checks passed
@UnArbosFour UnArbosFour mentioned this pull request Aug 13, 2026
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.

3 participants