@@ -217,7 +217,7 @@ async def challenge_miner(self, miner: Miner):
217217 miner .axon ,
218218 Synapse (),
219219 deserialize = False ,
220- timeout = 10 ,
220+ timeout = 5 ,
221221 )
222222
223223 status_code = response .dendrite .status_code
@@ -341,6 +341,11 @@ def challenge_subtensor(miner: Miner, challenge, max_retries=3):
341341 details = str (ex )
342342 break
343343
344+ if "id" not in response :
345+ reason = "Response ID is missing"
346+ details = ""
347+ break
348+
344349 if "error" in response :
345350 reason = f"Error in response: { response ['error' ].get ('message' , 'Unknown error' )} "
346351 details = ""
@@ -351,6 +356,11 @@ def challenge_subtensor(miner: Miner, challenge, max_retries=3):
351356 details = ""
352357 break
353358
359+ if response ['id' ] != item_id :
360+ reason = f"Response ID mismatch: expected '{ item_id } ', got '{ response ['id' ]} '"
361+ details = ""
362+ break
363+
354364 # Verify the challenge
355365 verified = response ["result" ] == value
356366
@@ -405,8 +415,11 @@ async def handle_challenge(self, uid: int, challenge):
405415 if miner_verified :
406416 btul .logging .success (f"[{ CHALLENGE_NAME } ][{ miner .uid } ] Miner verified" )
407417 else :
418+ message = (
419+ ", " .join (filter (None , [miner_reason , miner_details ])) or "Unknown reason"
420+ )
408421 btul .logging .warning (
409- f"[{ CHALLENGE_NAME } ][{ miner .uid } ] Miner not verified - { miner_reason } "
422+ f"[{ CHALLENGE_NAME } ][{ miner .uid } ] Miner not verified - { message } "
410423 )
411424
412425 # Challenge Subtensor if the miner is verified
@@ -421,8 +434,12 @@ async def handle_challenge(self, uid: int, challenge):
421434 btul .logging .success (f"[{ CHALLENGE_NAME } ][{ miner .uid } ] Subtensor verified" )
422435 process_time = subtensor_time
423436 else :
437+ message = (
438+ ", " .join (filter (None , [subtensor_reason , subtensor_details ]))
439+ or "Unknown reason"
440+ )
424441 btul .logging .warning (
425- f"[{ CHALLENGE_NAME } ][{ miner .uid } ] Subtensor not verified - { subtensor_reason } "
442+ f"[{ CHALLENGE_NAME } ][{ miner .uid } ] Subtensor not verified - { message } "
426443 )
427444
428445 # Flag the miner as verified or not
0 commit comments