Skip to content

Commit

Permalink
Merge pull request #1899 from opentensor/release/7.0.0
Browse files Browse the repository at this point in the history
Release/7.0.0
  • Loading branch information
garrett-opentensor committed May 29, 2024
2 parents 41412c2 + 1c1f57c commit 116cb8a
Show file tree
Hide file tree
Showing 78 changed files with 5,945 additions and 1,453 deletions.
7 changes: 2 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ jobs:
workflows:
compatibility_checks:
jobs:
- check_compatibility:
python_version: "3.8"
name: check-compatibility-3.8
- check_compatibility:
python_version: "3.9"
name: check-compatibility-3.9
Expand All @@ -294,7 +291,7 @@ workflows:
pr-requirements:
jobs:
- black:
python-version: "3.8.12"
python-version: "3.9.13"
- build-and-test:
matrix:
parameters:
Expand All @@ -305,7 +302,7 @@ workflows:
- lint-and-type-check:
matrix:
parameters:
python-version: ["3.8.12", "3.9.13", "3.10.6"]
python-version: ["3.9.13", "3.10.6", "3.11.4"]
requires:
- build-and-test
#- coveralls:
Expand Down
81 changes: 67 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Changelog

## 7.0.0 / 2024-05-29

## What's Changed
* replace torch with numpy by @andreea-popescu-reef in https://github.com/opentensor/bittensor/pull/1777
* Fix broken link in contrib/RELEASE_GUIDELINES #1821 by @thewhaleking in https://github.com/opentensor/bittensor/pull/1823
* Tests: Added coverage for set_weights by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1825
* Remove irrelevant call to get_delegates method. by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1826
* Support for string mnemonic thru cli when regenerating coldkeys by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1815
* Logging: Added _primary_loggers by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1797
* Add in check for minimum stake for unstaking by @thewhaleking in https://github.com/opentensor/bittensor/pull/1832
* Cache get_decoder_class by @thewhaleking in https://github.com/opentensor/bittensor/pull/1834
* Warmfix/change decoder cacheing by @thewhaleking in https://github.com/opentensor/bittensor/pull/1842
* Fix typo in warmfix by @thewhaleking in https://github.com/opentensor/bittensor/pull/1844
* Add the command btcli root list_delegates_lite to handle the Delegate… by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1840
* Change: console.error => console.print by @thewhaleking in https://github.com/opentensor/bittensor/pull/1849
* Small fix with receiving delegates based on a 4-hour archive block by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1854
* Replace torch with numpy by @sepehr-opentensor in https://github.com/opentensor/bittensor/pull/1786
* Versioning: Enforcement for eth-utils by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1852
* Versioning: Dependencies for FastAPI for Apple M's by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1855
* Retrieving error types from the metadata of the Substrate palette SubtensorModule for the btcli console (logic) by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1862
* Add version check caching, fix version comparison by @olzhasar-reef in https://github.com/opentensor/bittensor/pull/1835
* Tests: Added coverage for root.py by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1877
* Tests: Added coverage for network.py by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1879
* Tests: extends coverage for overview cmd part 1 by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1873
* Tests: Added coverage for Unstaking by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1878
* Tests: Added coverage for staking by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1837
* Tests: Added coverage for Delegation by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1874
* Updated error message and a test typo. by @thewhaleking in https://github.com/opentensor/bittensor/pull/1871
* fix: deprecated usage of `Balances::transfer` method by @orriin in https://github.com/opentensor/bittensor/pull/1886
* Fix Type Annotation by @opendansor in https://github.com/opentensor/bittensor/pull/1895
* Docstrings updates for list delegate lite feature by @rajkaramchedu in https://github.com/opentensor/bittensor/pull/1890
* Add Pre-commit Checker in scripts. Helps reduce CI calls. by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1893
* fix get_coldkey_password_from_environment resolving wrong password by @mjurbanski-reef in https://github.com/opentensor/bittensor/pull/1843
* Drop python 3.8 support by @mjurbanski-reef in https://github.com/opentensor/bittensor/pull/1892
* feat: Refactor phase 2 overview cmd & add test cov. Adds factories by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1887
* Add setting delegate take by @gztensor in https://github.com/opentensor/bittensor/pull/1903
* E2E Test Patterns by @orriin in https://github.com/opentensor/bittensor/pull/1885
* chore: correct method types by @distributedstatemachine in https://github.com/opentensor/bittensor/pull/1907
* bittensor.btlogging refactoring by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1896
* Part 1 for refactoring bittensor/subtensor.py by @RomanCh-OT in https://github.com/opentensor/bittensor/pull/1911
* Update: Pydantic V2 by @opendansor in https://github.com/opentensor/bittensor/pull/1889
* Add back compatibility with torch by @thewhaleking in https://github.com/opentensor/bittensor/pull/1904
* Release/6.12.2 by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1910
* Chore: Updated dev requirements by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/1946

## New Contributors
* @andreea-popescu-reef made their first contribution in https://github.com/opentensor/bittensor/pull/1777
* @thewhaleking made their first contribution in https://github.com/opentensor/bittensor/pull/1823
* @RomanCh-OT made their first contribution in https://github.com/opentensor/bittensor/pull/1826
* @olzhasar-reef made their first contribution in https://github.com/opentensor/bittensor/pull/1835
* @orriin made their first contribution in https://github.com/opentensor/bittensor/pull/1886
* @opendansor made their first contribution in https://github.com/opentensor/bittensor/pull/1895

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v6.12.2...v7.0.0

## 6.12.2 / 2024-05-20

## What's Changed
Expand Down Expand Up @@ -70,8 +125,6 @@

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v6.9.3...v6.10.0



## 6.9.3 / 2024-03-12

## What's Changed
Expand Down Expand Up @@ -111,8 +164,8 @@
* Expands type checking to subtensor by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1731
* Feature: Synapse passing type check by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1725
* bump req for security vulnerability in crpytography by @ifrit98 in https://github.com/opentensor/bittensor/pull/1718
* Fix: proper association with wallet dir and coldkey addr #1739 by @gus-opentensor & @sepehr-opentensor
* Fixed event lookup on new network added #1741 by @shibshib
* Fix: proper association with wallet dir and coldkey addr #1739 by @gus-opentensor & @sepehr-opentensor
* Fixed event lookup on new network added #1741 by @shibshib

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v6.8.2...v6.9.0

Expand Down Expand Up @@ -144,11 +197,11 @@
* logging off switch by @ifrit98 in https://github.com/opentensor/bittensor/pull/1704
* Extrinsic update by @ifrit98 in https://github.com/opentensor/bittensor/pull/1703
* Bittensor shared request layer by @ifrit98 in https://github.com/opentensor/bittensor/pull/1698
* Add no_prompt argument to help printout in https://github.com/opentensor/bittensor/pull/1707
* Adds mypi typechecking to circleci by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1705
* Add no_prompt argument to help printout in https://github.com/opentensor/bittensor/pull/1707
* Adds mypi typechecking to circleci by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1705
* Remove set weights ttl now that we have a better extrinsic method by @ifrit98
* Bug fix in overview command for dereg stake with outdated `stake_info` object fields by @ifrit98 in https://github.com/opentensor/bittensor/pull/1712
* Moves mock wallet creation to temp dir by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1711
* Bug fix in overview command for dereg stake with outdated `stake_info` object fields by @ifrit98 in https://github.com/opentensor/bittensor/pull/1712
* Moves mock wallet creation to temp dir by @gus-opentensor in https://github.com/opentensor/bittensor/pull/1711


**Full Changelog**: https://github.com/opentensor/bittensor/compare/v6.7.2...v6.8.0
Expand Down Expand Up @@ -711,7 +764,7 @@
- allow set synapse All using flag
- add test
- use dot get

- [Feature] Mark registration threads as daemons (https://github.com/opentensor/bittensor/pull/998)
- make solver processes daemons

Expand Down Expand Up @@ -761,9 +814,9 @@
## 3.4.0 / 2022-10-13

## What's Changed
* Parameters update by @Eugene-hu #936
* Bittensor Generate by @unconst #941
* Prometheus by @unconst #928
* Parameters update by @Eugene-hu #936
* Bittensor Generate by @unconst #941
* Prometheus by @unconst #928
* [Tooling][Release] Adding release script by @eduardogr in https://github.com/opentensor/bittensor/pull/948


Expand Down Expand Up @@ -822,7 +875,7 @@
## 3.3.0 / 2022-08-16

### CUDA registration
This release adds the ability to complete the registration using a CUDA-capable device.
This release adds the ability to complete the registration using a CUDA-capable device.
See https://github.com/opentensor/cubit/releases/tag/v1.0.5 for the required `cubit` v1.0.5 release

Also a few bug fixes for the CLI
Expand Down Expand Up @@ -855,5 +908,5 @@ This release refactors the registration code for CPU registration to improve sol

### Synapse update

##
##

10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
FROM python:3.11.8-bookworm

LABEL bittensor.image.authors="bittensor.com" \
bittensor.image.vendor="Bittensor" \
Expand All @@ -9,19 +9,13 @@ LABEL bittensor.image.authors="bittensor.com" \
bittensor.image.revision="${VCS_REF}" \
bittensor.image.created="${BUILD_DATE}" \
bittensor.image.documentation="https://app.gitbook.com/@opentensor/s/bittensor/"
LABEL bittensor.dependencies.versions.torch="2.0.1"
LABEL bittensor.dependencies.versions.cuda="11.7"
ARG DEBIAN_FRONTEND=noninteractive

#nvidia key migration
RUN apt-key del 7fa2af80
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub
# Update the base image
RUN apt update && apt upgrade -y
# Install bittensor
## Install dependencies
RUN apt install -y curl sudo nano git htop netcat wget unzip tmux apt-utils cmake build-essential
RUN apt install -y curl sudo nano git htop netcat-openbsd wget unzip tmux apt-utils cmake build-essential
## Upgrade pip
RUN pip3 install --upgrade pip

Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ source ~/.bashrc # Reload Bash configuration to take effect
# The Bittensor Package
The bittensor package contains data structures for interacting with the bittensor ecosystem, writing miners, validators and querying the network. Additionally, it provides many utilities for efficient serialization of Tensors over the wire, performing data analysis of the network, and other useful utilities.
In the 7.0.0 release, we have removed `torch` by default. However, you can still use `torch` by setting the environment variable
`USE_TORCH=1` and making sure that you have installed the `torch` library.
You can install `torch` by running `pip install bittensor[torch]` (if installing via PyPI), or by running `pip install -e ".[torch]"` (if installing from source).
We will not be adding any new functionality based on torch.
Wallet: Interface over locally stored bittensor hot + coldkey styled wallets.
```python
import bittensor
Expand Down Expand Up @@ -273,7 +278,7 @@ Synapse: Responsible for defining the protocol definition between axon servers a
```python
class Topk( bittensor.Synapse ):
topk: int = 2 # Number of "top" elements to select
input: bittensor.Tensor = pydantic.Field(..., allow_mutation=False) # Ensure that input cannot be set on the server side.
input: bittensor.Tensor = pydantic.Field(..., frozen=True) # Ensure that input cannot be set on the server side.
v: bittensor.Tensor = None
i: bittensor.Tensor = None
Expand Down Expand Up @@ -329,8 +334,8 @@ my_axon.attach(
).start()
```

Dendrite: Inheriting from PyTorch's Module class, represents the abstracted implementation of a network client module designed
to send requests to those endpoints to receive inputs.
Dendrite: Represents the abstracted implementation of a network client module
designed to send requests to those endpoints to receive inputs.

Example:
```python
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.12.2
7.0.0
5 changes: 3 additions & 2 deletions bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
nest_asyncio.apply()

# Bittensor code and protocol version.

__version__ = "6.12.2"
__version__ = "7.0.0"

version_split = __version__.split(".")
__version_as_int__: int = (
Expand Down Expand Up @@ -286,6 +285,8 @@ def debug(on: bool = True):
ProposalCallData,
ProposalVoteData,
)

from . import subtensor as subtensor_module
from .subtensor import subtensor as subtensor
from .cli import cli as cli, COMMANDS as ALL_COMMANDS
from .btlogging import logging
Expand Down
32 changes: 16 additions & 16 deletions bittensor/axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

import os
import uuid
import argparse
import asyncio
import contextlib
import copy
import inspect
import json
import os
import threading
import time
import asyncio
import inspect
import uvicorn
import argparse
import traceback
import threading
import bittensor
import contextlib

import uuid
from inspect import signature, Signature, Parameter
from typing import List, Optional, Tuple, Callable, Any, Dict

import uvicorn
from fastapi import FastAPI, APIRouter, Depends
from fastapi.responses import JSONResponse
from substrateinterface import Keypair
from fastapi import FastAPI, APIRouter, Request, Response, Depends
from starlette.responses import Response
from starlette.requests import Request
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from typing import List, Optional, Tuple, Callable, Any, Dict
from starlette.requests import Request
from starlette.responses import Response
from substrateinterface import Keypair

import bittensor
from bittensor.errors import (
InvalidRequestNameError,
SynapseDendriteNoneException,
Expand Down Expand Up @@ -567,7 +567,7 @@ def verify_custom(synapse: MyCustomSynapse):
self.forward_fns[request_name] = forward_fn

# Parse required hash fields from the forward function protocol defaults
required_hash_fields = request_class.__dict__["__fields__"][
required_hash_fields = request_class.__dict__["model_fields"][
"required_hash_fields"
].default
self.required_hash_fields[request_name] = required_hash_fields
Expand Down
13 changes: 6 additions & 7 deletions bittensor/btlogging/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
"""
Standardized logging for Bittensor.
"""

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

Expand All @@ -19,10 +15,13 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

import os
import argparse
"""
btlogging sub-package standardized logging for Bittensor.
This module provides logging functionality for the Bittensor package. It includes custom loggers, handlers, and
formatters to ensure consistent logging throughout the project.
"""

import bittensor.config
from bittensor.btlogging.loggingmachine import LoggingMachine


Expand Down
19 changes: 19 additions & 0 deletions bittensor/btlogging/defines.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# The MIT License (MIT)
# Copyright © 2023 OpenTensor Foundation

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all copies or substantial portions of
# the Software.

# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

"""Btlogging constant definition module."""

BASE_LOG_FORMAT = "%(asctime)s | %(levelname)s | %(message)s"
TRACE_LOG_FORMAT = (
f"%(asctime)s | %(levelname)s | %(name)s:%(filename)s:%(lineno)s | %(message)s"
Expand Down
Loading

0 comments on commit 116cb8a

Please sign in to comment.