Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/6.7.2 #1695

Merged
merged 23 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b7d9efb
Merge pull request #1691 from opentensor/master
ifrit98 Feb 5, 2024
559ec18
return messages with subtensor extrinsic to set weights
ifrit98 Feb 5, 2024
d202bdf
black format
ifrit98 Feb 5, 2024
00ffc37
proper type hints
ifrit98 Feb 5, 2024
3705c7c
Merge pull request #1692 from opentensor/bugfix/set-weights-return-me…
ifrit98 Feb 5, 2024
92ada18
trace logging for axon events
ifrit98 Feb 7, 2024
789a98c
dendrite trace log events
ifrit98 Feb 7, 2024
7a8ba27
Merge pull request #1694 from opentensor/logging/debug-to-trace-axon
ifrit98 Feb 7, 2024
e2faf7f
release branch setup
ifrit98 Feb 8, 2024
d144975
changelog update
ifrit98 Feb 8, 2024
7b98420
fix: Adds exception class MaxAttemptedException
gus-opentensor Feb 8, 2024
9c8ea52
naming
gus-opentensor Feb 8, 2024
fedce65
typo fix bittenst
ifrit98 Feb 8, 2024
f830267
oops commit
ifrit98 Feb 8, 2024
cc053a0
black
ifrit98 Feb 8, 2024
f78ef92
update aiohttp for python 311
ifrit98 Feb 8, 2024
41c723d
Merge pull request #1696 from opentensor/fix/max-attempted-exception
ifrit98 Feb 8, 2024
4bca694
coverage extended to extrinsics & increases global coverage 65% -> 66…
gus-opentensor Feb 8, 2024
7e34e9c
rm unneeded exception
gus-opentensor Feb 9, 2024
a4e5c2a
black
gus-opentensor Feb 9, 2024
39068a7
Merge pull request #1699 from opentensor/tests/extend-coverage
ifrit98 Feb 9, 2024
588f231
Merge pull request #1697 from opentensor/req/aiohttp-update-fix-py311
ifrit98 Feb 9, 2024
44653d5
Merge branch 'staging' into release/6.7.2
ifrit98 Feb 9, 2024
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 6.7.2 / 2024-02-08

## What's Changed
* Release/6.7.1 by @ifrit98 in https://github.com/opentensor/bittensor/pull/1688
* Increases test coverage for cli & chain_data by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1690
* Subtensor/update pysubstrate latest/phil by @ifrit98 in https://github.com/opentensor/bittensor/pull/1684
* Update staging to latest master by @ifrit98 in https://github.com/opentensor/bittensor/pull/1691
* return messages with subtensor extrinsic to set weights by @ifrit98 in https://github.com/opentensor/bittensor/pull/1692
* Logging/debug to trace axon by @ifrit98 in https://github.com/opentensor/bittensor/pull/1694


**Full Changelog**: https://github.com/opentensor/bittensor/compare/v6.7.1...v6.7.2


## 6.7.1 / 2024-02-02

## What's Changed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.7.1
6.7.2
2 changes: 1 addition & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
nest_asyncio.apply()

# Bittensor code and protocol version.
__version__ = "6.7.1"
__version__ = "6.7.2"

version_split = __version__.split(".")
__version_as_int__ = (
Expand Down
4 changes: 2 additions & 2 deletions bittensor/axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ async def dispatch(
synapse: bittensor.Synapse = await self.preprocess(request)

# Logs the start of the request processing
bittensor.logging.debug(
bittensor.logging.trace(
f"axon | <-- | {request.headers.get('content-length', -1)} B | {synapse.name} | {synapse.dendrite.hotkey} | {synapse.dendrite.ip}:{synapse.dendrite.port} | 200 | Success "
)

Expand Down Expand Up @@ -1101,7 +1101,7 @@ async def dispatch(
finally:
# Log the details of the processed synapse, including total size, name, hotkey, IP, port,
# status code, and status message, using the debug level of the logger.
bittensor.logging.debug(
bittensor.logging.trace(
f"axon | --> | {response.headers.get('content-length', -1)} B | {synapse.name} | {synapse.dendrite.hotkey} | {synapse.dendrite.ip}:{synapse.dendrite.port} | {synapse.axon.status_code} | {synapse.axon.status_message}"
)

Expand Down
4 changes: 2 additions & 2 deletions bittensor/dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def _log_outgoing_request(self, synapse):
Args:
synapse: The synapse object representing the request being sent.
"""
bittensor.logging.debug(
bittensor.logging.trace(
f"dendrite | --> | {synapse.get_total_size()} B | {synapse.name} | {synapse.axon.hotkey} | {synapse.axon.ip}:{str(synapse.axon.port)} | 0 | Success"
)

Expand All @@ -285,7 +285,7 @@ def _log_incoming_response(self, synapse):
Args:
synapse: The synapse object representing the received response.
"""
bittensor.logging.debug(
bittensor.logging.trace(
f"dendrite | <-- | {synapse.get_total_size()} B | {synapse.name} | {synapse.axon.hotkey} | {synapse.axon.ip}:{str(synapse.axon.port)} | {synapse.dendrite.status_code} | {synapse.dendrite.status_message}"
)

Expand Down
37 changes: 26 additions & 11 deletions bittensor/extrinsics/set_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import torch
from rich.prompt import Confirm
from typing import Union
from typing import Union, Tuple
import bittensor.utils.weight_utils as weight_utils
import multiprocessing

Expand All @@ -40,9 +40,17 @@ def ttl_set_weights_extrinsic(
wait_for_finalization: bool = False,
prompt: bool = False,
ttl: int = 100,
):
) -> Tuple[bool, str]:
r"""Sets the given weights and values on chain for wallet hotkey account."""

def target(queue, *args):
result = set_weights_extrinsic(*args)
queue.put(result)

queue = multiprocessing.Queue()

args = (
queue,
subtensor.chain_endpoint,
wallet,
netuid,
Expand All @@ -53,14 +61,18 @@ def ttl_set_weights_extrinsic(
wait_for_finalization,
prompt,
)
process = multiprocessing.Process(target=set_weights_extrinsic, args=args)
process = multiprocessing.Process(target=target, args=args)
process.start()
process.join(timeout=ttl)
success, error_message = False, "Timeout or unknown error"

if process.is_alive():
process.terminate()
process.join()
return False
return True
else:
success, error_message = queue.get()

return success, error_message


def set_weights_extrinsic(
Expand All @@ -73,7 +85,7 @@ def set_weights_extrinsic(
wait_for_inclusion: bool = False,
wait_for_finalization: bool = False,
prompt: bool = False,
) -> bool:
) -> Tuple[bool, str]:
r"""Sets the given weights and values on chain for wallet hotkey account.

Args:
Expand Down Expand Up @@ -119,7 +131,7 @@ def set_weights_extrinsic(
[float(v / 65535) for v in weight_vals], weight_uids
)
):
return False
return False, "Prompt refused."

with bittensor.__console__.status(
":satellite: Setting weights on [white]{}[/white] ...".format(subtensor.network)
Expand All @@ -136,7 +148,10 @@ def set_weights_extrinsic(
)

if not wait_for_finalization and not wait_for_inclusion:
return True
return (
True,
"Not waiting for finalization or inclusion. Assume successful.",
)

if success == True:
bittensor.__console__.print(
Expand All @@ -146,7 +161,7 @@ def set_weights_extrinsic(
prefix="Set weights",
sufix="<green>Finalized: </green>" + str(success),
)
return True
return True, "Success."
else:
bittensor.__console__.print(
":cross_mark: [red]Failed[/red]: error:{}".format(error_message)
Expand All @@ -155,7 +170,7 @@ def set_weights_extrinsic(
prefix="Set weights",
sufix="<red>Failed: </red>" + str(error_message),
)
return False
return False, str(error_message)

except Exception as e:
# TODO( devs ): lets remove all of the bittensor.__console__ calls and replace with loguru.
Expand All @@ -165,4 +180,4 @@ def set_weights_extrinsic(
bittensor.logging.warning(
prefix="Set weights", sufix="<red>Failed: </red>" + str(e)
)
return False
return False, str(e)