From 8cac1e0d6ad3d853b64dce100a7eccf8bc3ca94a Mon Sep 17 00:00:00 2001 From: codebender <167290009+codebender37@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:16:51 +0630 Subject: [PATCH] fix: fixed from PR feedback --- .env.miner.example | 4 +--- commons/score_storage.py | 2 +- dojo/utils/uids.py | 1 - neurons/validator.py | 2 -- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.env.miner.example b/.env.miner.example index 9562b10e..6f9aea32 100644 --- a/.env.miner.example +++ b/.env.miner.example @@ -17,6 +17,7 @@ SUBTENSOR_ENDPOINT=wss://entrypoint-finney.opentensor.ai:443 # NETUID=98 # SUBTENSOR_NETWORK=test # SUBTENSOR_ENDPOINT=ws://testnet-lite:9944 +# VALIDATOR_MIN_STAKE=1 # Task related config # this a maximum of 4 workers may submit responses for a single task @@ -48,6 +49,3 @@ S3_PUBLIC_URL= JWT_SECRET= # e.g. infura, alchemy API url for ethereum ETHEREUM_NODE= - -# Add this line with other environment variables -VALIDATOR_MIN_STAKE=20000 diff --git a/commons/score_storage.py b/commons/score_storage.py index 969a0c0e..ec8d8c77 100644 --- a/commons/score_storage.py +++ b/commons/score_storage.py @@ -12,7 +12,7 @@ class ScoreStorage: """Handles persistence of validator scores""" SCORES_DIR = Path("scores") - SCORES_FILE = SCORES_DIR / "validator_scores.pt" + SCORES_FILE = SCORES_DIR / "miner_scores.pt" @classmethod async def migrate_from_db(cls) -> bool: diff --git a/dojo/utils/uids.py b/dojo/utils/uids.py index c346d034..e61d60e7 100644 --- a/dojo/utils/uids.py +++ b/dojo/utils/uids.py @@ -29,7 +29,6 @@ def is_miner(metagraph: bt.metagraph, uid: int) -> bool: stakes = metagraph.S.tolist() from dojo import VALIDATOR_MIN_STAKE - print(f"Validator min stake {VALIDATOR_MIN_STAKE}") return stakes[uid] < VALIDATOR_MIN_STAKE diff --git a/neurons/validator.py b/neurons/validator.py index 126d3baa..34222911 100644 --- a/neurons/validator.py +++ b/neurons/validator.py @@ -46,7 +46,6 @@ set_expire_time, ttl_get_block, ) -from database.client import connect_db from dojo import __spec_version__ from dojo.protocol import ( CompletionResponses, @@ -731,7 +730,6 @@ async def save_state( async def _load_state(self): try: - await connect_db() scores = await ScoreStorage.load() if scores is None: