Skip to content

Commit a403ffe

Browse files
committed
fix states
1 parent 8547510 commit a403ffe

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

subvortex/validator/neuron/src/state.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from wandb.apis import public
2525
from typing import List
2626
from datetime import datetime
27+
from collections import Counter
2728

2829
from subvortex.core.constants import TESTNET_SUBNET_UID, MAIN_SUBNET_UID
2930

@@ -119,10 +120,16 @@ def log_miners_table(self, miners: List[Miner], commit=False):
119120

120121

121122
def log_distribution(miners: List[Miner], verified=True, commit=False):
123+
# Define the ip occurences
124+
ip_occurrences = Counter(miner.ip for miner in miners)
125+
122126
# Build the data for the metric
123127
country_counts = {}
124128
for miner in miners:
125-
if verified and (not miner.verified or miner.has_ip_conflicts):
129+
# Define if miner has ip conflicts or not
130+
has_ip_conflicts = ip_occurrences.get(miner.ip, 0) > 1
131+
132+
if verified and (not miner.verified or has_ip_conflicts):
126133
continue
127134

128135
miner_country = miner.country

0 commit comments

Comments
 (0)