From 1879e8fe42fd4b9d6c212c12e6135426b90479e2 Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 09:52:46 -0500 Subject: [PATCH 1/7] updates --- .env.miner.example | 5 +++-- .env.validator.example | 3 ++- Makefile | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.env.miner.example b/.env.miner.example index 06d144d..694b989 100644 --- a/.env.miner.example +++ b/.env.miner.example @@ -1,5 +1,5 @@ # Network Configuration -NETWORK=localnet # Options: localnet, testnet, finney +NETWORK=testnet # Options: localnet, testnet, finney # Wallet Configuration COLDKEY=miner @@ -10,6 +10,7 @@ MINER_NAME=miner MINER_PORT=8092 AXON_IP=127.0.0.1 AXON_EXTERNAL_IP=127.0.0.1 +AXON_EXTERNAL_PORT=8092 # Miner Settings TIMEOUT=16 @@ -17,4 +18,4 @@ VPERMIT_TAO_LIMIT=2 FORWARD_FUNCTION=base_miner # Logging -LOGGING_LEVEL=info # Options: info, debug, trace +LOGGING_LEVEL=debug # Options: info, debug, trace diff --git a/.env.validator.example b/.env.validator.example index 9de8931..76f0bad 100644 --- a/.env.validator.example +++ b/.env.validator.example @@ -10,6 +10,7 @@ VALIDATOR_NAME=validator VALIDATOR_PORT=8091 AXON_IP=127.0.0.1 AXON_EXTERNAL_IP=127.0.0.1 +AXON_EXTERNAL_PORT=8091 # Logging -LOGGING_LEVEL=info # Options: info, debug, trace +LOGGING_LEVEL=debug # Options: info, debug, trace diff --git a/Makefile b/Makefile index 58babb6..44d71b5 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ validator: --axon.port $(VALIDATOR_PORT) \ --axon.ip $(AXON_IP) \ --axon.external_ip $(AXON_EXTERNAL_IP) \ + --axon.external_port $(AXON_EXTERNAL_PORT) \ --netuid $(netuid) \ --logging.level $(LOGGING_LEVEL) @@ -47,6 +48,7 @@ miner: --axon.port $(MINER_PORT) \ --axon.ip $(AXON_IP) \ --axon.external_ip $(AXON_EXTERNAL_IP) \ + --axon.external_port $(AXON_EXTERNAL_PORT) \ --netuid $(netuid) \ --logging.level $(LOGGING_LEVEL) \ --timeout $(TIMEOUT) \ From b73612f9efe90136d13bd82eff804c61fa7747c5 Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 10:46:39 -0500 Subject: [PATCH 2/7] typo --- precog/utils/bittensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precog/utils/bittensor.py b/precog/utils/bittensor.py index df6080c..4adbb0a 100644 --- a/precog/utils/bittensor.py +++ b/precog/utils/bittensor.py @@ -83,7 +83,7 @@ def print_info(self) -> None: f"VTrust:{self.metagraph.Tv[self.my_uid]:.3f} | " f"Dividend:{self.metagraph.D[self.my_uid]:.3f} | " f"Emission:{self.metagraph.E[self.my_uid]:.3f} | " - f"Seting weights in {weight_timing} blocks" + f"Setting weights in {weight_timing} blocks" ) elif self.config.neuron.type == "Miner": log = ( From ae7b18e2042c10f427a993b350f81faa106b233c Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 11:17:33 -0500 Subject: [PATCH 3/7] update .env example files --- .env.miner.example | 6 ++++-- .env.validator.example | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.env.miner.example b/.env.miner.example index 694b989..772d6dd 100644 --- a/.env.miner.example +++ b/.env.miner.example @@ -1,5 +1,6 @@ # Network Configuration -NETWORK=testnet # Options: localnet, testnet, finney +# Options: localnet, testnet, finney +NETWORK=testnet # Wallet Configuration COLDKEY=miner @@ -18,4 +19,5 @@ VPERMIT_TAO_LIMIT=2 FORWARD_FUNCTION=base_miner # Logging -LOGGING_LEVEL=debug # Options: info, debug, trace +# Options: info, debug, trace +LOGGING_LEVEL=debug diff --git a/.env.validator.example b/.env.validator.example index 76f0bad..2e8526d 100644 --- a/.env.validator.example +++ b/.env.validator.example @@ -1,5 +1,6 @@ # Network Configuration -NETWORK=testnet # Options: localnet, testnet, finney +# Options: localnet, testnet, finney +NETWORK=testnet # Wallet Configuration COLDKEY=validator @@ -13,4 +14,5 @@ AXON_EXTERNAL_IP=127.0.0.1 AXON_EXTERNAL_PORT=8091 # Logging -LOGGING_LEVEL=debug # Options: info, debug, trace +# Options: info, debug, trace +LOGGING_LEVEL=debug From 868c8762b8e94abe2e12af7567b795bd3db4610a Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 12:58:24 -0500 Subject: [PATCH 4/7] update metagraph sync --- precog/validators/weight_setter.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/precog/validators/weight_setter.py b/precog/validators/weight_setter.py index fe0b99c..580e1eb 100755 --- a/precog/validators/weight_setter.py +++ b/precog/validators/weight_setter.py @@ -95,14 +95,28 @@ async def resync_metagraph(self): self.metagraph.sync(subtensor=self.subtensor) bt.logging.info("Metagraph updated, re-syncing hotkeys, dendrite pool and moving averages") # Zero out all hotkeys that have been replaced. - self.available_uids = asyncio.run(self.get_available_uids()) - 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 = self.metagraph.hotkeys + self.available_uids = await self.get_available_uids() + + new_hotkeys = self.metagraph.hotkeys + + # Process each UID + for uid in range(len(new_hotkeys)): + # Check if this is a new UID or if the hotkey has changed + is_new_uid = uid not in self.MinerHistory and uid in self.available_uids + has_hotkey_changed = ( + uid < len(self.hotkeys) and uid < len(new_hotkeys) and self.hotkeys[uid] != new_hotkeys[uid] + ) + + if is_new_uid or has_hotkey_changed: + bt.logging.info(f"Replacing hotkey on {uid} with {new_hotkeys[uid]}") self.MinerHistory[uid] = MinerHistory(uid, timezone=self.timezone) self.moving_average_scores[uid] = 0 - self.scores = list(self.moving_average_scores.values()) + + # Update hotkeys after processing + self.hotkeys = new_hotkeys + self.scores = list(self.moving_average_scores.values()) + + # Save the updated state self.save_state() def query_miners(self): From 69ec9878995c70aec14e31bcd9d87cd12f0ef123 Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 13:00:18 -0500 Subject: [PATCH 5/7] update readme --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index e4782ea..f379af8 100644 --- a/README.md +++ b/README.md @@ -71,17 +71,6 @@ poetry install ## Configuration ### Makefile -Start by editing the Makefile with your wallet and network information: -``` -################################################################################ -# User Parameters # -################################################################################ -coldkey = default -validator_hotkey = validator -miner_hotkey = miner -netuid = $(testnet_netuid) -network = $(testnet) -``` ### .env Files Copy the example `.env` files and edit all desired values: From 97d823ed4e6eec1668d2673111cafedad31e6b99 Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 14:34:16 -0500 Subject: [PATCH 6/7] rolling back --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index e4782ea..f379af8 100644 --- a/README.md +++ b/README.md @@ -71,17 +71,6 @@ poetry install ## Configuration ### Makefile -Start by editing the Makefile with your wallet and network information: -``` -################################################################################ -# User Parameters # -################################################################################ -coldkey = default -validator_hotkey = validator -miner_hotkey = miner -netuid = $(testnet_netuid) -network = $(testnet) -``` ### .env Files Copy the example `.env` files and edit all desired values: From f51e0920380a285a66802476cb3fc5dff4fae4df Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 15:00:19 -0500 Subject: [PATCH 7/7] formatting --- precog/validators/weight_setter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precog/validators/weight_setter.py b/precog/validators/weight_setter.py index 9d25bde..bbea858 100755 --- a/precog/validators/weight_setter.py +++ b/precog/validators/weight_setter.py @@ -108,7 +108,7 @@ async def resync_metagraph(self): self.hotkeys = {uid: value for uid, value in enumerate(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.scores = list(self.moving_average_scores.values()) self.save_state() def query_miners(self):