Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions allways/commitments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Shared commitment parsing logic — used by validator, miner, and CLI."""

import math
from typing import List, Optional

import bittensor as bt
Expand Down Expand Up @@ -41,6 +42,11 @@ def parse_commitment_data(raw: str, uid: int = 0, hotkey: str = '') -> Optional[
counter_rate_str = parts[6]
counter_rate = float(counter_rate_str)

if not (math.isfinite(rate) and rate > 0):
return None
if not (math.isfinite(counter_rate) and counter_rate > 0):
return None

if src_chain not in SUPPORTED_CHAINS or dst_chain not in SUPPORTED_CHAINS:
return None

Expand Down