Closed teslashibe closed 1 month ago
Validators communicate with miners through axons and dendrites. Axons are the endpoints that expose the API for the miners, and dendrites are used to communicate these axons. This communication happens over specific ports, with the default being 8091 ( I suggest using 8092 for validators ). This process is demonstrated in the query_and_score
method in masa/validator/forward.py
.
Validators store information about miners in a state file (state.pt). This is done in the save_state method in masa/base/validator.py
. The state can be loaded back into the validator using the load_state method in the same file. However, these methods are not being used in the current setup. ( Will try this afterwards )
Validators set weights for miners based on the scores they have received. This is done in the set_weights
method in masa/base/validator.py
. The weights are processed using torch/numpy and the bittensor CLI, and then set on the blockchain using the subtensor's set_weights
method. More details about this method can be found in the subtensor documentation in /bittensor/lib/python3.10/site-packages/bittensor/subtensor.py
.
Some projects use different methods to store scores, such as SQL databases or server files. However, on the other side most projects use the default set_weights configuration.
As far as I understood form the code on our subnet + researching on others projects setting weights is a one way process, you facilitate the information to the subtensor, then the subtensor handles that and distributes based on the reports from all the validators on the subnet.
A subnet validator in a subnet expresses their perspective about how performant subnet miners in the subnet are, through a set of weights
Such weights are aggregated across all the subnet validators in the subnet, to produce a weight matrix W. Subnet validators learn their row in 𝑊 by running the validator module and continuously verifying the responses produced by the subnet miners in terms of speed, intelligence and diversity.
import bittensor as bt
subnet = bt.metagraph(1, 'ws://54.205.45.3:9945')
print ('weights', subnet.W )
At the moment, our validators seem to have trouble sending this weights
Yuma consensus: https://docs.bittensor.com/yuma-consensus#weights
Make our validators set weights correctly, now that we have a proper way to double check if they are being set ( with aboves snippet ) we can properly validate that our validators are working on the correct way
@hide-on-bush-x :wave: this ticket was moved to done: what's the changes/outcome of the spike? do we have follow-up cards to track the action items to implement this?
@hide-on-bush-x do we have any follow up tasks here?
Implemented on #46
Research how miner scores persists to the metagraph