agicommies / subspace-network

MIT No Attribution
3 stars 1 forks source link

Introduce Rootnet Weight Control Delegation #186

Closed Supremesource closed 2 months ago

Supremesource commented 2 months ago

TL;DR

Validators on rootnet should have the ability to delegate their weight-setting control over to a different validator.

How will this work

  1. Registration process will stay completely the same for everyone.
  2. When it comes to weight setting on netuid 0 rootnet:
    • [x] Introduce new extrinsic delegate_rootnet_control takes AccountId of validator we are delegating weight control to on the rootnet
    • [x] Introduce a new storage RootnetControlDelegation map AccountId to AccountId
    • [x] When user calls the extrinsic, we will check if the validator key user wants to delegate to exists and is registered on the rootnet, then it checks if the user key is registered on the rootnet, if so insert association into the storage. if one of the checks fails provide that information in the error message
    • [x] Every 12 hours (5_400 blocks) iterate over this storage and "copy" the weights from the validators to the validators that are delegating the weight control

Example:

Alice is delegating rootnet weight control to key ABC Key ABC is a known rootnet validator. Every 12 hours Alice's rootnet weights will be overwritten by ABC's weights.