From 5540be8555e44b15f5b74d5782197ac7ca8742c1 Mon Sep 17 00:00:00 2001 From: hscott Date: Thu, 19 Dec 2024 16:46:26 -0500 Subject: [PATCH] changed how metagraph is updated to prevent indexing into scores wrong --- precog/validators/weight_setter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/precog/validators/weight_setter.py b/precog/validators/weight_setter.py index d252b87..f8a4aa5 100755 --- a/precog/validators/weight_setter.py +++ b/precog/validators/weight_setter.py @@ -99,10 +99,10 @@ async def resync_metagraph(self): for uid, hotkey in enumerate(self.metagraph.hotkeys): if (uid not in self.MinerHistory and uid in self.available_uids) or self.hotkeys[uid] != hotkey: bt.logging.info(f"Replacing hotkey on {uid} with {self.metagraph.hotkeys[uid]}") - self.hotkeys[uid] = hotkey - self.scores[uid] = 0 # hotkey has been replaced + self.hotkeys = self.metagraph.hotkeys self.MinerHistory[uid] = MinerHistory(uid, timezone=self.timezone) self.moving_average_scores[uid] = 0 + self.scores = list(self.moving_average_scores.values()) self.save_state() def query_miners(self):