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.1 #1688

Merged
merged 36 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a092b58
Sixth docstrings formatting PR
Jan 25, 2024
9026220
Merge branch 'staging' into rajk/6-docstrings
Jan 25, 2024
514a64c
Seventh docstrings formatting PR
Jan 25, 2024
90e1798
Eighth (final) docstrings formatting PR
Jan 26, 2024
bd32e51
Merge pull request #1678 from rajkaramchedu/rajk/8-docstrings
ifrit98 Jan 26, 2024
b01c02a
Merge branch 'staging' into rajk/6-docstrings
ifrit98 Jan 26, 2024
cf19acc
Merge pull request #1676 from rajkaramchedu/rajk/6-docstrings
ifrit98 Jan 26, 2024
5a96270
Merge branch 'staging' into rajk/7-docstrings
ifrit98 Jan 26, 2024
a2380a1
Merge pull request #1677 from rajkaramchedu/rajk/7-docstrings
ifrit98 Jan 26, 2024
7c53ff2
burn -> recycle for public facing code
ifrit98 Jan 27, 2024
23c1312
Merge branch 'master' into staging
ifrit98 Jan 31, 2024
0f0cd1b
missed burn cmd in mock subtensor
ifrit98 Jan 31, 2024
f34ed74
Merge branch 'staging' into bugfix/btcli-burn-recycle-naming/phil
ifrit98 Jan 31, 2024
88579a2
blac formatting
ifrit98 Jan 31, 2024
1bc3e0e
black formatting with correct version
ifrit98 Jan 31, 2024
ceea108
add correct black version to circleci
ifrit98 Feb 1, 2024
b3cc063
Merge pull request #1685 from opentensor/format/black-staging-format/…
ifrit98 Feb 1, 2024
b7e05cb
Merge branch 'staging' into bugfix/btcli-burn-recycle-naming/phil
ifrit98 Feb 1, 2024
7070e9c
Merge pull request #1681 from opentensor/bugfix/btcli-burn-recycle-na…
ifrit98 Feb 1, 2024
f20bfeb
chore(pytest): Migrate unittest test cases to pytest
gus-opentensor Jan 29, 2024
0058a45
Expands test coverage for keyfile & refactor subtensor tests to pytes…
gus-opentensor Jan 30, 2024
19353db
Rm deprecated utils/stats.py & refactor test_utils to pytest fmt
gus-opentensor Jan 30, 2024
a03e322
Refactor test_balance to pytest fmt
gus-opentensor Jan 30, 2024
536a7d5
Refactor test_metagraph to pytest fmt
gus-opentensor Jan 30, 2024
0adc5c9
Refactor test_wallet to pytest fmt
gus-opentensor Jan 30, 2024
ad6808a
Expand test coverage for axon
gus-opentensor Jan 31, 2024
e5dcda2
Expand test coverage for weight_utils
gus-opentensor Jan 31, 2024
6916495
Pin black version in circle ci config
gus-opentensor Feb 1, 2024
202a11d
Merge pull request #1686 from opentensor/tests/1657/expand-cov-and-py…
ifrit98 Feb 1, 2024
b62d168
wrap set weights in a ttl multiprocessing call so we don't hang past TTL
ifrit98 Feb 1, 2024
edd1ab4
add ttl arg
ifrit98 Feb 1, 2024
492cf4a
fix failing test
ifrit98 Feb 2, 2024
e850873
remove unused ttl
ifrit98 Feb 2, 2024
474d10e
Merge pull request #1687 from opentensor/feature/subtensor-set-weight…
ifrit98 Feb 2, 2024
e9aa396
release subtensor patch version 671
ifrit98 Feb 2, 2024
8b2dde4
release changelogs
ifrit98 Feb 2, 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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python -m venv env/
. env/bin/activate
python -m pip install --upgrade pip
pip install black
pip install black==23.7.0

- save_cache:
name: Save cached black venv
Expand Down Expand Up @@ -239,7 +239,7 @@ workflows:
- check_compatibility:
python_version: "3.11"
name: check-compatibility-3.11

pr-requirements:
jobs:
- black:
Expand Down Expand Up @@ -272,7 +272,7 @@ workflows:
branches:
only:
- /^(release|hotfix)/.*/

release-requirements:
jobs:
- check-version-not-released:
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 6.7.1 / 2024-02-02

## What's Changed
* Release/6.7.0 by @ifrit98 in https://github.com/opentensor/bittensor/pull/1674
* Eighth (final) docstrings formatting PR by @rajkaramchedu in https://github.com/opentensor/bittensor/pull/1678
* Sixth docstrings formatting PR by @rajkaramchedu in https://github.com/opentensor/bittensor/pull/1676
* Seventh docstrings formatting PR by @rajkaramchedu in https://github.com/opentensor/bittensor/pull/1677
* Update README.md by @unconst in https://github.com/opentensor/bittensor/pull/1679
* Update README.md by @unconst in https://github.com/opentensor/bittensor/pull/1680
* black formatting by @ifrit98 in https://github.com/opentensor/bittensor/pull/1685
* burn -> recycle for public facing code by @ifrit98 in https://github.com/opentensor/bittensor/pull/1681
* Expands test coverage and coverts python unittest classes to pure pytest by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1686
* wrap set weights in a ttl multiprocessing call so we don't hang past TTL by @ifrit98 in https://github.com/opentensor/bittensor/pull/1687

## New Contributors
* @gus-opentensor made their first contribution in https://github.com/opentensor/bittensor/pull/1686

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



## 6.7.0 / 2024-01-25

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.7.0
6.7.1
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.0"
__version__ = "6.7.1"

version_split = __version__.split(".")
__version_as_int__ = (
Expand Down
9 changes: 6 additions & 3 deletions bittensor/axon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Create and initialize Axon, which services the forward and backward requests from other neurons.
"""

# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# Copyright © 2022 Opentensor Foundation
Expand Down Expand Up @@ -1207,9 +1208,11 @@ async def verify(self, synapse: bittensor.Synapse):
# We attempt to run the verification function using the synapse instance
# created from the request. If this function runs without throwing an exception,
# it means that the verification was successful.
await verify_fn(synapse) if inspect.iscoroutinefunction(
verify_fn
) else verify_fn(synapse)
(
await verify_fn(synapse)
if inspect.iscoroutinefunction(verify_fn)
else verify_fn(synapse)
)
except Exception as e:
# If there was an exception during the verification process, we log that
# there was a verification exception.
Expand Down
24 changes: 14 additions & 10 deletions bittensor/btlogging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Standardize logging for bittensor
""" Standardized logging for Bittensor.
"""

# The MIT License (MIT)
# Copyright © 2021 Yuma Rao

Expand Down Expand Up @@ -42,7 +43,7 @@ def _remove_loguru_ansi_directive(text: str) -> str:


class logging:
"""Standardize logging for bittensor"""
"""Standardized logging for Bittensor."""

__has_been_inited__: bool = False
__debug_on__: bool = False
Expand All @@ -58,17 +59,18 @@ def __new__(
record_log: bool = None,
logging_dir: str = None,
):
r"""Instantiate bittensor logging system backend.
r"""Instantiate Bittensor logging system backend.

Args:
config (:obj:`bittensor.config`, `optional`):
config (bittensor.config, optional):
bittensor.logging.config()
debug (:obj:`bool`, `optional`):
debug (bool, optional):
Turn on debug.
trace (:obj:`bool`, `optional`):
trace (bool, optional):
Turn on trace.
record_log (:obj:`bool`, `optional`):
record_log (bool, optional):
If true, logs are saved to loggind dir.
logging_dir (:obj:`str`, `optional`):
logging_dir (str, optional):
Directory where logs are sunk.
"""

Expand Down Expand Up @@ -129,8 +131,10 @@ def __new__(

@classmethod
def config(cls):
"""Get config from the argument parser
Return: bittensor.config object
"""Get config from the argument parser.

Return:
bittensor.config object
"""
parser = argparse.ArgumentParser()
logging.add_args(parser)
Expand Down
43 changes: 26 additions & 17 deletions bittensor/chain_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def is_serving(self) -> bool:
return True

def ip_str(self) -> str:
"""Return the whole ip as string"""
"""Return the whole IP as string"""
return net.ip__str__(self.ip_type, self.ip, self.port)

def __eq__(self, other: "AxonInfo"):
Expand Down Expand Up @@ -341,6 +341,7 @@ class NeuronInfo:
r"""
Dataclass for neuron metadata.
"""

hotkey: str
coldkey: str
uid: int
Expand Down Expand Up @@ -419,7 +420,7 @@ def fix_decoded_values(cls, neuron_info_decoded: Any) -> "NeuronInfo":

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> "NeuronInfo":
r"""Returns a NeuronInfo object from a vec_u8."""
r"""Returns a NeuronInfo object from a ``vec_u8``."""
if len(vec_u8) == 0:
return NeuronInfo._null_neuron()

Expand All @@ -433,7 +434,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> "NeuronInfo":

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["NeuronInfo"]:
r"""Returns a list of NeuronInfo objects from a vec_u8."""
r"""Returns a list of NeuronInfo objects from a ``vec_u8``."""

decoded_list = from_scale_encoding(
vec_u8, ChainDataType.NeuronInfo, is_vec=True
Expand Down Expand Up @@ -516,6 +517,7 @@ class NeuronInfoLite:
r"""
Dataclass for neuron metadata, but without the weights and bonds.
"""

hotkey: str
coldkey: str
uid: int
Expand Down Expand Up @@ -589,7 +591,7 @@ def fix_decoded_values(cls, neuron_info_decoded: Any) -> "NeuronInfoLite":

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> "NeuronInfoLite":
r"""Returns a NeuronInfoLite object from a vec_u8."""
r"""Returns a NeuronInfoLite object from a ``vec_u8``."""
if len(vec_u8) == 0:
return NeuronInfoLite._null_neuron()

Expand All @@ -603,7 +605,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> "NeuronInfoLite":

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["NeuronInfoLite"]:
r"""Returns a list of NeuronInfoLite objects from a vec_u8."""
r"""Returns a list of NeuronInfoLite objects from a ``vec_u8``."""

decoded_list = from_scale_encoding(
vec_u8, ChainDataType.NeuronInfoLite, is_vec=True
Expand Down Expand Up @@ -673,6 +675,7 @@ class PrometheusInfo:
r"""
Dataclass for prometheus info.
"""

block: int
version: int
ip: str
Expand All @@ -694,6 +697,7 @@ class DelegateInfo:
r"""
Dataclass for delegate info.
"""

hotkey_ss58: str # Hotkey of delegate
total_stake: Balance # Total stake of the delegate
nominators: List[
Expand Down Expand Up @@ -736,7 +740,7 @@ def fix_decoded_values(cls, decoded: Any) -> "DelegateInfo":

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> Optional["DelegateInfo"]:
r"""Returns a DelegateInfo object from a vec_u8."""
r"""Returns a DelegateInfo object from a ``vec_u8``."""
if len(vec_u8) == 0:
return None

Expand All @@ -751,7 +755,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> Optional["DelegateInfo"]:

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["DelegateInfo"]:
r"""Returns a list of DelegateInfo objects from a vec_u8."""
r"""Returns a list of DelegateInfo objects from a ``vec_u8``."""
decoded = from_scale_encoding(vec_u8, ChainDataType.DelegateInfo, is_vec=True)

if decoded is None:
Expand All @@ -765,7 +769,8 @@ def list_from_vec_u8(cls, vec_u8: List[int]) -> List["DelegateInfo"]:
def delegated_list_from_vec_u8(
cls, vec_u8: List[int]
) -> List[Tuple["DelegateInfo", Balance]]:
r"""Returns a list of Tuples of DelegateInfo objects, and Balance, from a vec_u8.
r"""Returns a list of Tuples of DelegateInfo objects, and Balance, from a ``vec_u8``.

This is the list of delegates that the user has delegated to, and the amount of stake delegated.
"""
decoded = from_scale_encoding(vec_u8, ChainDataType.DelegatedInfo, is_vec=True)
Expand All @@ -786,6 +791,7 @@ class StakeInfo:
r"""
Dataclass for stake info.
"""

hotkey_ss58: str # Hotkey address
coldkey_ss58: str # Coldkey address
stake: Balance # Stake for the hotkey-coldkey pair
Expand All @@ -802,7 +808,7 @@ def fix_decoded_values(cls, decoded: Any) -> "StakeInfo":

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> Optional["StakeInfo"]:
r"""Returns a StakeInfo object from a vec_u8."""
r"""Returns a StakeInfo object from a ``vec_u8``."""
if len(vec_u8) == 0:
return None

Expand All @@ -819,7 +825,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> Optional["StakeInfo"]:
def list_of_tuple_from_vec_u8(
cls, vec_u8: List[int]
) -> Dict[str, List["StakeInfo"]]:
r"""Returns a list of StakeInfo objects from a vec_u8."""
r"""Returns a list of StakeInfo objects from a ``vec_u8``."""
decoded: Optional[
List[Tuple(str, List[object])]
] = from_scale_encoding_using_type_string(
Expand All @@ -840,7 +846,7 @@ def list_of_tuple_from_vec_u8(

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["StakeInfo"]:
r"""Returns a list of StakeInfo objects from a vec_u8."""
r"""Returns a list of StakeInfo objects from a ``vec_u8``."""
decoded = from_scale_encoding(vec_u8, ChainDataType.StakeInfo, is_vec=True)

if decoded is None:
Expand All @@ -856,6 +862,7 @@ class SubnetInfo:
r"""
Dataclass for subnet info.
"""

netuid: int
rho: int
kappa: int
Expand All @@ -878,7 +885,7 @@ class SubnetInfo:

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> Optional["SubnetInfo"]:
r"""Returns a SubnetInfo object from a vec_u8."""
r"""Returns a SubnetInfo object from a ``vec_u8``."""
if len(vec_u8) == 0:
return None

Expand All @@ -891,7 +898,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> Optional["SubnetInfo"]:

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["SubnetInfo"]:
r"""Returns a list of SubnetInfo objects from a vec_u8."""
r"""Returns a list of SubnetInfo objects from a ``vec_u8``."""
decoded = from_scale_encoding(
vec_u8, ChainDataType.SubnetInfo, is_vec=True, is_option=True
)
Expand Down Expand Up @@ -947,6 +954,7 @@ class SubnetHyperparameters:
r"""
Dataclass for subnet hyperparameters.
"""

rho: int
kappa: int
immunity_period: int
Expand All @@ -970,7 +978,7 @@ class SubnetHyperparameters:

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> Optional["SubnetHyperparameters"]:
r"""Returns a SubnetHyperparameters object from a vec_u8."""
r"""Returns a SubnetHyperparameters object from a ``vec_u8``."""
if len(vec_u8) == 0:
return None

Expand All @@ -983,7 +991,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> Optional["SubnetHyperparameters"]:

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["SubnetHyperparameters"]:
r"""Returns a list of SubnetHyperparameters objects from a vec_u8."""
r"""Returns a list of SubnetHyperparameters objects from a ``vec_u8``."""
decoded = from_scale_encoding(
vec_u8, ChainDataType.SubnetHyperparameters, is_vec=True, is_option=True
)
Expand Down Expand Up @@ -1038,6 +1046,7 @@ class IPInfo:
r"""
Dataclass for associated IP Info.
"""

ip: str
ip_type: int
protocol: int
Expand All @@ -1053,7 +1062,7 @@ def encode(self) -> Dict[str, Any]:

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> Optional["IPInfo"]:
r"""Returns a IPInfo object from a vec_u8."""
r"""Returns a IPInfo object from a ``vec_u8``."""
if len(vec_u8) == 0:
return None

Expand All @@ -1066,7 +1075,7 @@ def from_vec_u8(cls, vec_u8: List[int]) -> Optional["IPInfo"]:

@classmethod
def list_from_vec_u8(cls, vec_u8: List[int]) -> List["IPInfo"]:
r"""Returns a list of IPInfo objects from a vec_u8."""
r"""Returns a list of IPInfo objects from a ``vec_u8``."""
decoded = from_scale_encoding(vec_u8, ChainDataType.IPInfo, is_vec=True)

if decoded is None:
Expand Down
2 changes: 1 addition & 1 deletion bittensor/commands/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
),
# f'{delegate.take * 100:.1f}%',s
f"{ delegate[0].total_daily_return.tao * ( 1000 / ( 0.001 + delegate[0].total_stake.tao ) )!s:6.6}",
str(delegate_description)
str(delegate_description),
# f'{delegate_profile.description:140.140}',
)

Expand Down
8 changes: 5 additions & 3 deletions bittensor/commands/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
"*" if metagraph.validator_permit[uid] else "",
str((metagraph.block.item() - metagraph.last_update[uid].item())),
str(metagraph.active[uid].item()),
ep.ip + ":" + str(ep.port)
if ep.is_serving
else "[yellow]none[/yellow]",
(
ep.ip + ":" + str(ep.port)
if ep.is_serving
else "[yellow]none[/yellow]"
),
ep.hotkey[:10],
ep.coldkey[:10],
]
Expand Down
2 changes: 1 addition & 1 deletion bittensor/commands/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
table.add_column("[overline white]MAX_N", style="white", justify="center")
table.add_column("[overline white]EMISSION", style="white", justify="center")
table.add_column("[overline white]TEMPO", style="white", justify="center")
table.add_column("[overline white]BURN", style="white", justify="center")
table.add_column("[overline white]RECYCLE", style="white", justify="center")
table.add_column("[overline white]POW", style="white", justify="center")
table.add_column("[overline white]SUDO", style="white")
for row in rows:
Expand Down
Loading