Unclear cleanup of weights and bonds on deregistration or stake loss
Summary
It is unclear whether weight and bond entries are removed when a neuron is deregistered, loses vpermit, or falls below minimum stake.
Problem
- Weight and bond storage may persist beyond neuron lifecycle.
- No clear guarantees exist for cleanup in all exit paths.
- Potential for long-term accumulation of orphaned matrices.
Details
- Storage layout:
(netuid, neuron_uid) -> Vec<(uid, weight)>
- One entry per validator per subnet.
Expected Outcome
- Audit of cleanup behavior across all exit paths.
- Explicit removal of weights and bonds for inactive neurons.
- Prevention of silent chain state growth.
Context
Filed at the request of Rhef to enable supervised investigation and fix.