diff --git a/bittensor/metagraph.py b/bittensor/metagraph.py index 2c31ccf6b1..c128dae983 100644 --- a/bittensor/metagraph.py +++ b/bittensor/metagraph.py @@ -340,7 +340,6 @@ def sync( block: Optional[int] = None, lite: bool = True, subtensor: Optional["bittensor.subtensor"] = None, - root: bool = False, ) -> "metagraph": """ Initiates the synchronization process of the metagraph. @@ -364,7 +363,7 @@ def sync( # If not a 'lite' version, compute and set weights and bonds for each neuron if not lite: - self._set_weights_and_bonds(root=root, subtensor=subtensor) + self._set_weights_and_bonds(subtensor=subtensor) def _initialize_subtensor(self, subtensor): """ @@ -474,9 +473,7 @@ def _create_tensor(self, data, dtype) -> torch.nn.Parameter: # TODO: Check and test the creation of tensor return torch.nn.Parameter(torch.tensor(data, dtype=dtype), requires_grad=False) - def _set_weights_and_bonds( - self, root: bool = False, subtensor: bittensor.subtensor = None - ): + def _set_weights_and_bonds(self, subtensor: bittensor.subtensor = None): """ Computes and sets weights and bonds for each neuron. @@ -484,7 +481,7 @@ def _set_weights_and_bonds( None. """ # TODO: Check and test the computation of weights and bonds - if root: + if self.netuid == 0: # Is this the root network? self.weights = self._process_root_weights( [neuron.weights for neuron in self.neurons], "weights", subtensor ) diff --git a/bittensor/subtensor.py b/bittensor/subtensor.py index 99b15d5060..9eda2fada1 100644 --- a/bittensor/subtensor.py +++ b/bittensor/subtensor.py @@ -2310,7 +2310,6 @@ def metagraph( netuid: int, lite: bool = True, block: Optional[int] = None, - root: bool = False, ) -> "bittensor.Metagraph": r"""Returns a synced metagraph for the subnet. Args: @@ -2327,7 +2326,7 @@ def metagraph( metagraph_ = bittensor.metagraph( network=self.network, netuid=netuid, lite=lite, sync=False ) - metagraph_.sync(block=block, lite=lite, subtensor=self, root=root) + metagraph_.sync(block=block, lite=lite, subtensor=self) return metagraph_