From 21872077a5caff0d37452d26e74ed9d0ab2f8fdf Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Tue, 17 Sep 2024 09:19:40 +0800 Subject: [PATCH 1/3] fix(validator.py): fix wandb rate limit issue --- neurons/validator.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/neurons/validator.py b/neurons/validator.py index a2d1474e..78a059df 100644 --- a/neurons/validator.py +++ b/neurons/validator.py @@ -196,6 +196,9 @@ def __init__(self): # Initialize penalized_hotkeys as an empty list self.penalized_hotkeys = [] + # Initialize penalized_hotkeys_checklist as an empty list + self.penalized_hotkeys_checklist = [] + # Init the thread. self.lock = threading.Lock() self.threads: List[threading.Thread] = [] @@ -358,6 +361,7 @@ def sync_status(self): self.init_prometheus(force_update=True) def sync_checklist(self): + self.penalized_hotkeys_checklist = self.wandb.get_penalized_hotkeys_checklist(self.get_valid_validator_hotkeys(), True) self.threads = [] for i in range(0, len(self.uids), self.validator_challenge_batch_size): for _uid in self.uids[i : i + self.validator_challenge_batch_size]: @@ -569,9 +573,11 @@ def execute_miner_checking_request(self, uid, axon: bt.AxonInfo): if port: is_port_open = check_port(axon.ip, port) - penalized_hotkeys_checklist = self.wandb.get_penalized_hotkeys_checklist(self.get_valid_validator_hotkeys(), True) + penalized_hotkeys_checklist = self.penalized_hotkeys_checklist checklist_hotkeys = [item['hotkey'] for item in penalized_hotkeys_checklist] + update_needed = False # Track if we need to update the penalized hotkeys + if is_port_open: is_ssh_access = True bt.logging.info(f"Debug {Allocate.__name__} - status of Checking allocation - {status} {uid}") @@ -598,13 +604,17 @@ def execute_miner_checking_request(self, uid, axon: bt.AxonInfo): if axon.hotkey in checklist_hotkeys: penalized_hotkeys_checklist = [item for item in penalized_hotkeys_checklist if item['hotkey'] != axon.hotkey] + update_needed = True if not is_ssh_access: - penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "SSH_ACCESS_DISABLED", "description": "It can not access to the server via ssh"}) + penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "SSH_ACCESS_DISABLED", "description": "It can not access to the server via ssh"}) + update_needed = True else: if axon.hotkey not in checklist_hotkeys: penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "PORT_CLOSED", "description": "The port of ssh server is closed"}) + update_needed = True - self.wandb.update_penalized_hotkeys_checklist(penalized_hotkeys_checklist) + if update_needed: + self.wandb.update_penalized_hotkeys_checklist(penalized_hotkeys_checklist) def execute_specs_request(self): if len(self.queryable_for_specs) > 0: @@ -833,7 +843,7 @@ async def start(self): # Perform miner checking if self.current_block % block_next_miner_checking == 0 or block_next_miner_checking < self.current_block: # Next block the validators will do port checking again. - block_next_miner_checking = self.current_block + 50 # 50 -> every 10 minutes + block_next_miner_checking = self.current_block + 300 # 300 -> every 60 minutes # Filter axons with stake and ip address. self._queryable_uids = self.get_queryable() From 1b1ed8f55cc3f967f5d4c61f91136dca7a4262ee Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Tue, 17 Sep 2024 16:05:13 +0800 Subject: [PATCH 2/3] fix(validator.py): update to call wandb api once after all threads done on sync_checklist --- neurons/validator.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/neurons/validator.py b/neurons/validator.py index 78a059df..5f5df46a 100644 --- a/neurons/validator.py +++ b/neurons/validator.py @@ -383,6 +383,7 @@ def sync_checklist(self): for thread in self.threads: thread.join() + self.wandb.update_penalized_hotkeys_checklist(self.penalized_hotkeys_checklist) def sync_miners_info(self, queryable_tuple_uids_axons: List[Tuple[int, bt.AxonInfo]]): if queryable_tuple_uids_axons: @@ -573,10 +574,7 @@ def execute_miner_checking_request(self, uid, axon: bt.AxonInfo): if port: is_port_open = check_port(axon.ip, port) - penalized_hotkeys_checklist = self.penalized_hotkeys_checklist - checklist_hotkeys = [item['hotkey'] for item in penalized_hotkeys_checklist] - - update_needed = False # Track if we need to update the penalized hotkeys + checklist_hotkeys = [item['hotkey'] for item in self.penalized_hotkeys_checklist] if is_port_open: is_ssh_access = True @@ -603,18 +601,13 @@ def execute_miner_checking_request(self, uid, axon: bt.AxonInfo): if axon.hotkey in checklist_hotkeys: - penalized_hotkeys_checklist = [item for item in penalized_hotkeys_checklist if item['hotkey'] != axon.hotkey] - update_needed = True + self.penalized_hotkeys_checklist = [item for item in self.penalized_hotkeys_checklist if item['hotkey'] != axon.hotkey] if not is_ssh_access: - penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "SSH_ACCESS_DISABLED", "description": "It can not access to the server via ssh"}) - update_needed = True + self.penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "SSH_ACCESS_DISABLED", "description": "It can not access to the server via ssh"}) else: if axon.hotkey not in checklist_hotkeys: - penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "PORT_CLOSED", "description": "The port of ssh server is closed"}) - update_needed = True + self.penalized_hotkeys_checklist.append({"hotkey": axon.hotkey, "status_code": "PORT_CLOSED", "description": "The port of ssh server is closed"}) - if update_needed: - self.wandb.update_penalized_hotkeys_checklist(penalized_hotkeys_checklist) def execute_specs_request(self): if len(self.queryable_for_specs) > 0: From 18f171e274d9d793206ccbb53359ae4c658ece0c Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Wed, 2 Oct 2024 22:15:33 +0800 Subject: [PATCH 3/3] chore: update Tensorplex hotkey --- compute/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/__init__.py b/compute/__init__.py index 43eb218a..63b5a8c8 100644 --- a/compute/__init__.py +++ b/compute/__init__.py @@ -79,7 +79,7 @@ "5EhvL1FVkQPpMjZX4MAADcW42i3xPSF1KiCpuaxTYVr28sux", # TAO-Validator.com "5FFApaS75bv5pJHfAp2FVLBj9ZaXuFDjEypsaBNc1wCfe52v", # RoundTable21 "5DvTpiniW9s3APmHRYn8FroUWyfnLtrsid5Mtn5EwMXHN2ed", # FirstTensor - "5HbLYXUBy1snPR8nfioQ7GoA9x76EELzEq9j7F32vWUQHm1x", # Tensorplex + "5E4z3h9yVhmQyCFWNbY9BPpwhx4xFiPwq3eeqmBgVF6KULde", # Tensorplex "5CXRfP2ekFhe62r7q3vppRajJmGhTi7vwvb2yr79jveZ282w", # Rizzo "5HNQURvmjjYhTSksi8Wfsw676b4owGwfLR2BFAQzG7H3HhYf", # Neural Inτerneτ "5DnXm2tBGAD57ySJv5SfpTfLcsQbSKKp6xZKFWABw3cYUgqg", # Love