Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion bittensor/core/extrinsics/async_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def register_extrinsic(
`True` if extrinsic was finalized or included in the block. If we did not wait for finalization/inclusion, the response is `True`.
"""

logging.debug("Checking subnet status")
logging.debug("[magenta]Checking subnet status... [/magenta]")
if not await subtensor.subnet_exists(netuid):
logging.error(
f":cross_mark: [red]Failed error:[/red] subnet [blue]{netuid}[/blue] does not exist."
Expand Down
12 changes: 4 additions & 8 deletions bittensor/utils/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,9 @@ def is_connected(substrate) -> bool:
)
def reconnect_with_retries(self):
"""Attempt to reconnect with retries using retry library."""
logging.info("Attempting to reconnect to substrate...")
logging.console.info("Attempting to reconnect to substrate...")
self._get_substrate()

old_level = logging.get_level()
logging.set_info()
logging.success("Connection successfully restored!")
logging.setLevel(old_level)
logging.console.success("Connection successfully restored!")

@wraps(func)
def wrapper(self, *args, **kwargs):
Expand All @@ -198,14 +194,14 @@ def wrapper(self, *args, **kwargs):
try:
return func(self, *args, **kwargs)
except WebSocketConnectionClosedException:
logging.warning(
logging.console.warning(
"WebSocket connection closed. Attempting to reconnect 5 times..."
)
try:
reconnect_with_retries(self)
return func(self, *args, **kwargs)
except ConnectionRefusedError:
logging.error("Unable to restore connection. Raising exception.")
logging.critical("Unable to restore connection. Raising exception.")
raise ConnectionRefusedError("Failed to reconnect to substrate.")

return wrapper
6 changes: 3 additions & 3 deletions tests/e2e_tests/test_dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def test_dendrite(local_chain):
AssertionError: If any of the checks or verifications fail
"""

logging.info("Testing test_dendrite")
logging.console.info("Testing test_dendrite")
netuid = 1

# Register root as Alice - the subnet owner
Expand Down Expand Up @@ -113,7 +113,7 @@ async def test_dendrite(local_chain):
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
logging.info("Neuron Alice is now validating")
logging.console.info("Neuron Alice is now validating")
await asyncio.sleep(
5
) # wait for 5 seconds for the metagraph and subtensor to refresh with latest data
Expand All @@ -133,4 +133,4 @@ async def test_dendrite(local_chain):
assert updated_neuron.coldkey == bob_keypair.ss58_address
assert updated_neuron.pruning_score != 0

logging.info("✅ Passed test_dendrite")
logging.console.info("✅ Passed test_dendrite")
4 changes: 2 additions & 2 deletions tests/e2e_tests/test_liquid_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_liquid_alpha(local_chain):
"""
u16_max = 65535
netuid = 1
logging.info("Testing test_liquid_alpha_enabled")
logging.console.info("Testing test_liquid_alpha_enabled")

# Register root as Alice
keypair, alice_wallet = setup_wallet("//Alice")
Expand Down Expand Up @@ -183,4 +183,4 @@ def test_liquid_alpha(local_chain):
assert (
subtensor.get_subnet_hyperparameters(netuid=1).liquid_alpha_enabled is False
), "Failed to disable liquid alpha"
logging.info("✅ Passed test_liquid_alpha")
logging.console.info("✅ Passed test_liquid_alpha")
4 changes: 2 additions & 2 deletions tests/e2e_tests/test_metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_metagraph(local_chain):
Raises:
AssertionError: If any of the checks or verifications fail
"""
logging.info("Testing test_metagraph_command")
logging.console.info("Testing test_metagraph_command")
netuid = 1

# Register Alice, Bob, and Dave
Expand Down Expand Up @@ -174,4 +174,4 @@ def test_metagraph(local_chain):
metagraph.neurons == metagraph_pre_dave.neurons
), "Neurons don't match after save and load"

logging.info("✅ Passed test_metagraph")
logging.console.info("✅ Passed test_metagraph")
2 changes: 1 addition & 1 deletion tests/unit_tests/test_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def normalize_hyperparameters(
else:
norm_value = value
except Exception as e:
logging.warning(f"Error normalizing parameter '{param}': {e}")
logging.console.error(f"Error normalizing parameter '{param}': {e}")
norm_value = "-"

normalized_values.append((param, str(value), str(norm_value)))
Expand Down