Skip to content

Commit 95fa263

Browse files
fix bugs in filter, update lock
1 parent fef1d3e commit 95fa263

File tree

2 files changed

+353
-4
lines changed

2 files changed

+353
-4
lines changed

neurons/validator.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,22 @@ def filter_miners(self) -> List[int]:
6262

6363
ROOT_DIR = Path(__file__).resolve().parents[1]
6464

65-
with open(os.path.join(ROOT_DIR, "blacklist.txt", "r")) as f:
65+
with open(os.path.join(ROOT_DIR, "blacklist.txt"), 'r') as f:
6666
blacklist = f.read()
6767

6868
blacklist: List[str] = blacklist.split()
69+
70+
logger.warning(f"Blacklist on the following coldkeys: {blacklist}")
6971
malicious_uids = np.where(np.isin(self.metagraph.coldkeys, blacklist))[0]
7072

7173
# Remove the malicious uids from the list of all miner uids
7274
logger.warning(f"Removing {len(malicious_uids)} malicious uids from the list of all miner uids.")
7375
mask = ~np.isin(self.all_miner_uids, malicious_uids)
7476

75-
return self.all_miner_uids[mask]
77+
all_miner_uids = list(np.array(self.all_miner_uids)[mask])
78+
logger.info(f"Initial number of uids: {len(self.all_miner_uids)}. After filter: {len(all_miner_uids)}")
79+
80+
return all_miner_uids
7681

7782
def parse_mdrun_args(self) -> str:
7883
mdrun_args = ""

0 commit comments

Comments
 (0)