Enforce conviction#2800
Conversation
| // Change subnet owner based on conviction. | ||
| Self::change_subnet_owner_if_needed(netuid); |
There was a problem hiding this comment.
[HIGH] Re-enabled conviction scan can make on_initialize unbounded
run_coinbase is invoked from block_step() in on_initialize, which returns a fixed weight. This call reaches change_subnet_owner_if_needed(), which calls get_total_conviction() and subnet_king(); those iterate HotkeyLock::<T>::iter_prefix(netuid) and DecayingHotkeyLock::<T>::iter_prefix(netuid) and build a BTreeMap over all matching hotkeys. Those maps are not bounded in the fixed hook weight, and the PR now runs the scans on every successful subnet epoch. An attacker can grow lock aggregate entries and force epoch blocks to do storage work proportional to lock-map size, risking overweight/slow block execution. Keep this disabled until the ownership check is made bounded, amortized, or otherwise accurately accounted in block weight.
| // Change subnet owner based on conviction. | |
| Self::change_subnet_owner_if_needed(netuid); | |
| // Reserved for potential future enhancements. | |
| // Ownership update logic based on conviction is currently inactive by design. | |
| // Self::change_subnet_owner_if_needed(netuid); |
🛡️ AI Review — Skeptic (security review)VERDICT: VULNERABLE BASELINE scrutiny: established repo write contributor, author/committer match, no Gittensor allowlist hit; branch feat/enforce-conviction -> devnet-ready. No prior Skeptic findings were present. The PR does not modify Findings
ConclusionThe change re-enables a runtime hook that performs unbounded lock-map scans during coinbase/on-initialize processing, creating a steady-state block production DoS risk. This should stay disabled until conviction enforcement is implemented with bounded per-block work or separately accounted execution. # 🔍 AI Review — Auditor (domain review) has not yet run on this PR. |
|
🔄 AI review updated — Skeptic: VULNERABLE |
Description
This PR enables conviction enforcement. If
the ownership will be changed to coldkey that is owner of hotkey A.
Type of Change
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctly