From fff5587d36686bc9db0a7c6b946117a881a861f8 Mon Sep 17 00:00:00 2001 From: hscott Date: Thu, 5 Dec 2024 15:58:31 -0500 Subject: [PATCH] added reinitializing subtensor to resync metagraph code --- precog/validators/weight_setter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/precog/validators/weight_setter.py b/precog/validators/weight_setter.py index a704bd1..6981c7e 100755 --- a/precog/validators/weight_setter.py +++ b/precog/validators/weight_setter.py @@ -80,6 +80,7 @@ async def resync_metagraph(self, force=False): """Resyncs the metagraph and updates the hotkeys and moving averages based on the new metagraph.""" self.blocks_since_sync = self.current_block - self.last_sync if self.blocks_since_sync >= self.resync_metagraph_rate or force: + self.subtensor = bt.subtensor(config=self.config, network=self.config.subtensor.chain_endpoint) bt.logging.info("Syncing Metagraph...") self.metagraph.sync(subtensor=self.subtensor) bt.logging.info("Metagraph updated, re-syncing hotkeys, dendrite pool and moving averages")