Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5752085
add `_sub*` extrinsics
Sep 13, 2025
5fdc8e9
add sudo `_sub*` extrinsics
Sep 13, 2025
249afc1
add common `sudo_call_extrinsic`
Sep 13, 2025
1c888c8
add custom types for uids, weights, and salt
Sep 13, 2025
cb5c477
add sub methods to subtensors
Sep 13, 2025
a83c462
TODO deprecate in SDKv10
Sep 13, 2025
8328991
update MetagraphInfo
Sep 13, 2025
fdd7d10
improve `generate_weight_hash`
Sep 13, 2025
e8ca0ad
update tests
Sep 13, 2025
37933a4
update SubtensorApi
Sep 13, 2025
95c263f
update docstrings
Sep 13, 2025
2f84875
add unit tests
Sep 15, 2025
cf44906
improve `subtensor.weights` (use subuid)
Sep 15, 2025
e0fb27f
improve e2e test
Sep 15, 2025
ee390e3
Merge branch 'staging' into feat/roman/sub-subnet
Sep 15, 2025
3883f7c
fix `sudo_call_extrinsic`
Sep 15, 2025
53df6e7
update `get_timelocked_weight_commits` method
Sep 15, 2025
3749555
update unit and e2e tests
Sep 15, 2025
4ac39bc
fix `generate_weight_hash` logic + tests
Sep 16, 2025
b3afc49
refactoring
Sep 16, 2025
cd69bb6
update e2e tests (use subuid)
Sep 16, 2025
07fee6b
add unit test for new extrinsics
Sep 16, 2025
3bb28f4
update `sudo_set_sub_subnet_emission_split`
Sep 17, 2025
0b204ad
add `subtensor.get_sub_subnets_emission_split` + tests
Sep 17, 2025
18a054b
fix SubtensorApi tests
Sep 17, 2025
f6c9b8c
Merge branch 'staging' into feat/roman/sub-subnet
Sep 17, 2025
3cfd493
rename `sub subnets` to `mechanism`
Sep 17, 2025
48f6872
tests improvement
Sep 17, 2025
46ccf64
fix runtime call method + tests
Sep 19, 2025
7687442
Improve MetagraphInfo calls
Sep 19, 2025
1379841
improve Metagraph
Sep 19, 2025
2c9ff5e
update SubtensorApi
Sep 19, 2025
6d67b58
check query better
Sep 19, 2025
6b42893
tests
Sep 19, 2025
bf2efa6
TODO
Sep 19, 2025
faeb926
They change error back to SubnetNotExists
Sep 19, 2025
89b4c8f
bring back old error on docstrings
Sep 19, 2025
707332e
fix typo
Sep 19, 2025
044723f
Update bittensor/core/async_subtensor.py
basfroman Sep 22, 2025
35caea0
Update bittensor/core/async_subtensor.py
basfroman Sep 22, 2025
1c0ffd3
review changes + ruff
Sep 22, 2025
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
445 changes: 287 additions & 158 deletions bittensor/core/async_subtensor.py

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions bittensor/core/chain_data/metagraph_info.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from enum import Enum

from dataclasses import dataclass
from enum import Enum
from typing import Optional, Union
from bittensor.core import settings
from bittensor.core.chain_data.axon_info import AxonInfo
from bittensor.core.chain_data.chain_identity import ChainIdentity
from bittensor.core.chain_data.info_base import InfoBase
from bittensor.core.chain_data.subnet_identity import SubnetIdentity
from bittensor.core.chain_data.utils import decode_account_id
from bittensor.utils import u64_normalized_float as u64tf, u16_normalized_float as u16tf
from bittensor.utils import (
get_netuid_and_mechid_by_storage_index,
u64_normalized_float as u64tf,
u16_normalized_float as u16tf,
)
from bittensor.utils.balance import Balance, fixed_to_float


Expand Down Expand Up @@ -170,11 +173,13 @@ class MetagraphInfo(InfoBase):

commitments: Optional[tuple[tuple[str, str]]]

mechid: int = 0

@classmethod
def _from_dict(cls, decoded: dict) -> "MetagraphInfo":
"""Returns a MetagraphInfo object from decoded chain data."""
# Subnet index
_netuid = decoded["netuid"]
_netuid, _mechid = get_netuid_and_mechid_by_storage_index(decoded["netuid"])

# Name and symbol
if name := decoded.get("name"):
Expand All @@ -198,6 +203,7 @@ def _from_dict(cls, decoded: dict) -> "MetagraphInfo":
return cls(
# Subnet index
netuid=_netuid,
mechid=_mechid,
# Name and symbol
name=decoded["name"],
symbol=decoded["symbol"],
Expand Down Expand Up @@ -394,7 +400,7 @@ def _from_dict(cls, decoded: dict) -> "MetagraphInfo":
else None
),
validators=[v for v in decoded["validators"]]
if decoded.get("validators") is not None
if decoded.get("validators")
else None,
commitments=get_selective_metagraph_commitments(decoded),
)
Expand Down
2 changes: 1 addition & 1 deletion bittensor/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class NotDelegateError(StakeError):
"""


class SubNetworkDoesNotExist(ChainTransactionError):
class SubnetNotExists(ChainTransactionError):
"""
The subnet does not exist.
"""
Expand Down
2 changes: 1 addition & 1 deletion bittensor/core/extrinsics/asyncex/children.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def set_children_extrinsic(
NotEnoughStakeToSetChildkeys: Parent key doesn't have minimum own stake.
ProportionOverflow: The sum of the proportions does exceed uint64.
RegistrationNotPermittedOnRootSubnet: Attempting to register a child on the root network.
SubNetworkDoesNotExist: Attempting to register to a non-existent network.
SubnetNotExists: Attempting to register to a non-existent network.
TooManyChildren: Too many children in request.
TxRateLimitExceeded: Hotkey hit the rate limit.
bittensor_wallet.errors.KeyFileError: Failed to decode keyfile data.
Expand Down
Loading
Loading