opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
117 stars 107 forks source link

fix remove_network #564

Open distributedstatemachine opened 1 week ago

distributedstatemachine commented 1 week ago

Description

Currently, the remove_network function does not properly handle the unstaking of nominators and delegates when a network is removed. This leads to orphaned stakes in neurons. Additionally, there may be existing neurons staked in already dissolved networks that need to be addressed.

We need to update the remove_network function to correctly differentiate between delegates and nominators when returning stakes, and implement a storage migration to handle existing neurons staked in dissolved networks.

Acceptance Criteria

Tasks

}



- [ ] Implement a storage migration to handle existing neurons staked in dissolved networks:
- [ ] Write unit tests for the updated `remove_network` function.
- [ ] Write integration tests for the storage migration.

## Related Links

-  [User Issue setting weights ](https://github.com/opentensor/subtensor/issues/560)