Validator helper patch summary for bittensor 10 compatibility failures
This note describes a narrow troubleshooting case for a validator helper after a SDK bump to bittensor 10. It addresses the specific combination where Python 3.9 install rejects the environment, the runtime raises AttributeError: 'Subtensor' object has no attribute 'get_subnets', staking logic breaks because add_stake returns an object instead of a boolean, newer calls require strict amount typing, and the helper must adopt renamed hotkey address parameters.
Exact scope
The intended outcome is the smallest safe patch set only. Fix the compatibility edges that block the helper, do not redesign the service, and do not add support for multi-mechanism subnets unless required for correctness.
Patch summary
- Raise the supported interpreter floor so the environment no longer fails under Python 3.9.
- Replace direct
get_subnetsassumptions with a compatibility path that matches the currentSubtensorsurface. - Update stake success checks because
add_stakenow returns an object. - Construct the amount using the strict typed form expected by the current API.
- Rename hotkey-related keyword arguments at the wrapper or call-site boundary only.
Why this patch should stay small
The safest approach is to preserve existing service behavior and repair only the seams introduced by the release. A wider migration creates more churn than necessary when the helper only needs to install, read subnet state, and complete the existing staking path correctly again.
Schematic pseudo-diff
- python_requires=">=3.9"
+ python_requires=">=3.10"
- subnets = subtensor.get_subnets()
+ subnets = compat_list_subnets(subtensor)
- ok = subtensor.add_stake(wallet=wallet, amount=amount, hotkey=hotkey)
- if ok:
+ receipt = subtensor.add_stake(wallet=wallet, amount=to_balance(amount), hotkey_ss58=hotkey)
+ if receipt and receipt.success:
Smoke-check list
Confirm installation succeeds on the supported interpreter, subnet discovery works through the compatibility wrapper, the staking flow handles the returned object correctly, and renamed hotkey parameters are accepted in the existing job path.