Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5389957
Clarify return ordering and units for get_revealed_commitment_by_hotkey
Dairus01 Dec 27, 2025
eeec6e4
Add write permission for issues in workflow
Dairus01 Dec 28, 2025
c318f4c
Clarify return format in get_revealed_commitment_by_hotkey
Dairus01 Dec 30, 2025
8fc3420
Restore assertion in test_subtensor.py
Dairus01 Dec 30, 2025
1fe3ae6
Update .github/workflows/monitor_requirements_size_master.yml
Dairus01 Dec 30, 2025
825d9c0
Update subtensor.py
Dairus01 Dec 30, 2025
010ceed
Update bittensor/core/subtensor.py
basfroman Dec 30, 2025
8135462
Update bittensor/core/subtensor.py
basfroman Dec 30, 2025
1f62fa7
fix for async metagraph initialization
basfroman Dec 30, 2025
d58cddf
correct `subtensor.initialize`
basfroman Dec 30, 2025
3bb9e54
Merge pull request #3236 from opentensor/fix/roman/metagraph
basfroman Dec 30, 2025
70a873c
Merge pull request #3231 from Dairus01/clarify-return-ordering-and-units
basfroman Dec 30, 2025
ef0658f
skips user liquidity e2e test pending the rework
basfroman Jan 5, 2026
f5487ce
Merge pull request #3239 from opentensor/tests/roman/@pytest.mark.ski…
basfroman Jan 5, 2026
0ae1c31
chore: fix incorrect Optional type annotation in utils
Olexandr88 Jan 5, 2026
72994b6
chore: run make check
Olexandr88 Jan 8, 2026
2af4498
Merge pull request #3238 from Olexandr88/master
basfroman Jan 9, 2026
20b2790
chore: remove unused test helper
Olexandr88 Jan 9, 2026
595d2b5
Merge remote-tracking branch 'upstream/staging' into cleanup-remove-u…
Olexandr88 Jan 10, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/monitor_requirements_size_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
permissions:
pull-requests: write
contents: read
issues: write

jobs:
read-python-versions:
Expand Down
19 changes: 15 additions & 4 deletions bittensor/core/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ async def sync(
await self._apply_extra_info(block=block)

async def _initialize_subtensor(
self, subtensor: "AsyncSubtensor"
self, subtensor: Optional["AsyncSubtensor"]
) -> "AsyncSubtensor":
"""
Initializes the subtensor to be used for syncing the metagraph.
Expand Down Expand Up @@ -1422,8 +1422,8 @@ async def _initialize_subtensor(
# Lazy import due to circular import (subtensor -> metagraph, metagraph -> subtensor)
from bittensor.core.async_subtensor import AsyncSubtensor

self.subtensor = AsyncSubtensor(network=self.chain_endpoint)
await self.subtensor.initialize()
subtensor = AsyncSubtensor(network=self.chain_endpoint)
await subtensor.initialize()
self.subtensor = subtensor
return subtensor

Expand Down Expand Up @@ -1720,7 +1720,7 @@ def sync(
# apply MetagraphInfo data to instance
self._apply_extra_info(block=block)

def _initialize_subtensor(self, subtensor: "Subtensor") -> "Subtensor":
def _initialize_subtensor(self, subtensor: Optional["Subtensor"]) -> "Subtensor":
"""
Initializes the subtensor to be used for syncing the metagraph.

Expand Down Expand Up @@ -1939,6 +1939,17 @@ async def async_metagraph(
) -> "AsyncMetagraph":
"""
Factory function to create an instantiated AsyncMetagraph, mainly for the ability to use sync at instantiation.

Parameters:
netuid: The netuid of the subnet for which to create the AsyncMetagraph.
mechid: The mechid of the subnet for which to create the AsyncMetagraph.
network: The network to use for the AsyncMetagraph.
lite: Whether to use a lite version of the AsyncMetagraph.
sync: Whether to sync the AsyncMetagraph.
subtensor: The subtensor to use for the AsyncMetagraph.

Returns:
AsyncMetagraph: The instantiated AsyncMetagraph.
"""
metagraph_ = AsyncMetagraph(
netuid=netuid,
Expand Down
14 changes: 7 additions & 7 deletions bittensor/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def strtobool(val: str) -> Union[bool, Literal["==SUPRESS=="]]:

def _get_explorer_root_url_by_network_from_map(
network: str, network_map: dict[str, dict[str, str]]
) -> Optional[dict[str, str]]:
) -> dict[str, str]:
"""
Returns the explorer root url for the given network name from the given network map.

Expand All @@ -151,7 +151,7 @@ def _get_explorer_root_url_by_network_from_map(
Returns:
The explorer url for the given network. Or None if the network is not in the network map.
"""
explorer_urls: Optional[dict[str, str]] = {}
explorer_urls: dict[str, str] = {}
for entity_nm, entity_network_map in network_map.items():
if network in entity_network_map:
explorer_urls[entity_nm] = entity_network_map[network]
Expand All @@ -161,7 +161,7 @@ def _get_explorer_root_url_by_network_from_map(

def get_explorer_url_for_network(
network: str, block_hash: str, network_map: dict[str, dict[str, str]]
) -> Optional[dict[str, str]]:
) -> dict[str, str]:
"""
Returns the explorer url for the given block hash and network.

Expand All @@ -174,10 +174,10 @@ def get_explorer_url_for_network(
The explorer url for the given block hash and network. Or None if the network is not known.
"""

explorer_urls: Optional[dict[str, str]] = {}
# Will be None if the network is not known. i.e. not in network_map
explorer_root_urls: Optional[dict[str, str]] = (
_get_explorer_root_url_by_network_from_map(network, network_map)
explorer_urls: dict[str, str] = {}

explorer_root_urls: dict[str, str] = _get_explorer_root_url_by_network_from_map(
network, network_map
)

if explorer_root_urls != {}:
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e_tests/test_liquidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
)


@pytest.mark.skip("Skips user liquidity e2e test pending the rework")
def test_liquidity(subtensor, alice_wallet, bob_wallet):
"""
Tests the liquidity mechanism
Expand Down Expand Up @@ -281,6 +282,7 @@ def test_liquidity(subtensor, alice_wallet, bob_wallet):
logging.console.info("✅ Passed [blue]test_liquidity[/blue]")


@pytest.mark.skip("Skips user liquidity e2e test pending the rework")
@pytest.mark.asyncio
async def test_liquidity_async(async_subtensor, alice_wallet, bob_wallet):
"""
Expand Down
5 changes: 0 additions & 5 deletions tests/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
get_mock_keypair,
get_mock_wallet,
)


def is_running_in_circleci():
"""Checks that tests are running in the app.circleci.com environment."""
return os.getenv("CIRCLECI") == "true"
Loading