From 2b2cf6e7a07be9d825b17fb8d70db79f02d63f99 Mon Sep 17 00:00:00 2001 From: p-ferreira Date: Thu, 14 Sep 2023 18:54:06 +0000 Subject: [PATCH] complements run.py to throw exception on dereg --- openvalidators/run.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/openvalidators/run.py b/openvalidators/run.py index 3b5e871..21b2784 100644 --- a/openvalidators/run.py +++ b/openvalidators/run.py @@ -16,7 +16,6 @@ # DEALINGS IN THE SOFTWARE. import asyncio -import time import bittensor as bt from traceback import print_exception @@ -25,8 +24,6 @@ from openvalidators.weights import should_set_weights, set_weights from openvalidators.misc import ttl_get_block -SLEEP_TIME = 180 - # Neuron run loop.` def run(self): bt.logging.info("run()") @@ -35,9 +32,7 @@ def run(self): try: while True: if not self.wallet.hotkey.ss58_address in self.metagraph.hotkeys: - bt.logging.info(f"Validator is not registered - sleeping for {SLEEP_TIME} seconds") - time.sleep(SLEEP_TIME) - continue + raise Exception(f"Validator is not registered - hotkey {self.wallet.hotkey.ss58_address} not in metagraph") bt.logging.info(f"step({self.step}) block({ttl_get_block( self )})") # Run multiple forwards.