Skip to content

Commit

Permalink
added reinitializing subtensor to resync metagraph code
Browse files Browse the repository at this point in the history
  • Loading branch information
hayden-yuma committed Dec 5, 2024
1 parent 3b08678 commit fff5587
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions precog/validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fff5587

Please sign in to comment.