Conviction enabled constant#2693
Conversation
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: FindingsNo findings. ConclusionNo malicious behavior or security vulnerability found in the static diff. The PR does not touch 🔍 AI Review — Auditor (domain review)VERDICT: 👎 Gittensor: LIKELY by repository-history heuristic; author has write permission and substantial recent subtensor contribution history. The Auditor proposed a replacement PR description, but the current body is non-trivial; not overwriting. Maintainers: ask the Auditor to regenerate if you want it. The implementation matches the stated intent at a high level: Spec-version auto-fix was not applied because the devnet RPC lookup failed in this environment ( Findings
ConclusionBlocking on the test gap: this PR disables the conviction path and also turns most existing conviction tests into no-ops, but it does not add assertions for the new disabled-mode contract. |
| use crate::staking::lock::{CONVICTION_ENABLED, LockState}; | ||
| use crate::*; | ||
|
|
||
| macro_rules! skip_if_conviction_disabled { |
There was a problem hiding this comment.
[MEDIUM] Disabled conviction mode is not tested
With CONVICTION_ENABLED set to false, this macro makes most conviction/lock tests return before executing their assertions. The PR changes runtime staking behavior, but it does not add positive coverage for the new disabled-mode contract: do_lock_stake should leave Lock/aggregate storage empty, rolling an existing lock should produce zero locked mass and zero conviction, and change_subnet_owner_if_needed should not reassign ownership. Add explicit tests for those disabled behaviors instead of only skipping the enabled-mode tests.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
Description
Add a global constant to enable/disable conviction in one-line change. Makes code maintenance while turning off conviction on testnet more convenient and non-breaking.
Type of Change
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctly