-
Notifications
You must be signed in to change notification settings - Fork 253
Emission-based Neuron Deregistration #2158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devnet-ready
Are you sure you want to change the base?
Conversation
…r/subtensor into refactor-neuron-deregistration
| let rank_keys: Vec<NetUid> = Rank::<T>::iter_keys().collect(); | ||
| let rank_removed = rank_keys.len() as u64; | ||
| total_reads = total_reads.saturating_add(rank_removed); | ||
| for k in rank_keys { | ||
| Rank::<T>::remove(k); | ||
| total_writes = total_writes.saturating_add(1); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ::clear MultiRemovalResults in one go and the backend/loops fields as reads/writes may be more optimal iterations/memory wise, I'm not sure how many items are there
| let trust_keys: Vec<NetUid> = Trust::<T>::iter_keys().collect(); | ||
| let trust_removed = trust_keys.len() as u64; | ||
| total_reads = total_reads.saturating_add(trust_removed); | ||
| for k in trust_keys { | ||
| Trust::<T>::remove(k); | ||
| total_writes = total_writes.saturating_add(1); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
| let ps_keys: Vec<NetUid> = PruningScores::<T>::iter_keys().collect(); | ||
| let ps_removed = ps_keys.len() as u64; | ||
| total_reads = total_reads.saturating_add(ps_removed); | ||
| for k in ps_keys { | ||
| PruningScores::<T>::remove(k); | ||
| total_writes = total_writes.saturating_add(1); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Co-authored-by: Loris Moulin <45130584+l0r1s@users.noreply.github.com>
| let min_free: u16 = Self::get_min_non_immune_uids(netuid); | ||
| let can_prune_non_immune = free_count > min_free; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this?
Description
Removes
trust,rankandpruning_scoreand instead selects a neuron for deregistration based onimmunity,emission,reg_block, and thenuidRelated Issue(s)
Fix neuron pruning #1903
Set a minimum number of non-immune, non-immortal UIDs per (sub)subnet #2058