Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f3cca53
(un)Staking multiple avoid tx limit (#1244)
camfairchild Mar 29, 2023
d989163
additional logging for prometheus
Eugene-hu Mar 30, 2023
660f63e
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu Mar 31, 2023
1857eff
additional logging for prometheus (#1246)
Eugene-hu Apr 3, 2023
9a3d8ee
Dataset fix (#1249)
isabella618033 Apr 3, 2023
6cf0380
Grab delegates details from GitHub (#1245)
camfairchild Apr 4, 2023
5ce8ff2
Add raw spec for local test and new bins (#1243)
camfairchild Apr 6, 2023
1cb9bed
Fix list_delegates on non-archive nodes (#1232)
camfairchild Apr 6, 2023
4741f62
Blacklist fixes + depreciation of old signatures (#1240)
Eugene-hu Apr 12, 2023
691607b
Improve development workflow documentation
Apr 13, 2023
5039d88
[BIT-636] Change u16 weight normalization to max-upscaling (#1241)
opentaco Apr 14, 2023
a28fdc3
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu Apr 14, 2023
92d6bac
remove duplicate command #1228 (#1231)
camfairchild Apr 18, 2023
b8661dc
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu Apr 18, 2023
9e876fb
test_forward_priority_2nd_request_timeout fix (#1276)
isabella618033 Apr 19, 2023
065de16
Remove btcli query and btcli set_weights (#1144)
camfairchild Apr 19, 2023
3b57662
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu Apr 20, 2023
3de56cc
Merge releases 4.0.0 and 4.0.1 back to staging (#1306)
camfairchild Apr 27, 2023
d283d39
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu May 19, 2023
55fa419
Merge branch 'staging' into dev/techdebt_pathes_quac
ifrit98 May 23, 2023
b4b7681
Update DEVELOPMENT_WORKFLOW.md
ifrit98 May 23, 2023
d411536
Merge pull request #1262 from opentensor/dev/techdebt_pathes_quac
ifrit98 May 24, 2023
eab306a
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu Oct 5, 2023
c23f9e6
Merge remote-tracking branch 'origin/master' into staging
Eugene-hu Oct 5, 2023
303b4fd
final fixes
Eugene-hu Oct 5, 2023
ff57031
staging updates and fixes (#1540)
ifrit98 Oct 5, 2023
b661f79
Add root get_weights command to btcli (#1536)
Oct 5, 2023
d80c057
Fix typo (#1543)
steffencruz Oct 10, 2023
6b69d96
remove duplicated debug message in dendrite (#1544)
ifrit98 Oct 10, 2023
30e5fd3
Cli fix (#1541)
ifrit98 Oct 10, 2023
ff40702
update faucet helpstr (#1542)
ifrit98 Oct 10, 2023
e6c02b6
Added mechanism to sum all delegated tao (#1547)
shibshib Oct 17, 2023
de71c4a
Dict hash fix (#1548)
ifrit98 Oct 17, 2023
ae0c999
Merge master (#1552)
ifrit98 Oct 18, 2023
7dbd447
Streaming fix (#1551)
ifrit98 Oct 19, 2023
1fa8a5e
Fix typos (#1553)
omahs Oct 20, 2023
5e79729
Normalize weights in r get weights table (#1556)
camfairchild Oct 25, 2023
42397d3
Dendrite & Synapse updates and fixes (#1555)
ifrit98 Oct 26, 2023
bd3307d
rm root flag in metagraph (#1558)
ifrit98 Oct 27, 2023
292b6a9
Max Faucet Runs == 3 (#1560)
ifrit98 Oct 27, 2023
75ba873
replace unknown wallet params (chain mismatch) with key values (#1559)
ifrit98 Oct 27, 2023
11cf279
Remove PoW registration cli and associated extrinsic (#1557)
ifrit98 Oct 27, 2023
78dcd87
Merge branch 'master' into staging
Eugene-hu Oct 30, 2023
dfb3120
Add btcli wallet balance (#1564)
ifrit98 Oct 30, 2023
0b79db6
Dendrite fixes (#1561)
ifrit98 Oct 30, 2023
add8325
Master into staging (#1570)
ifrit98 Oct 31, 2023
04a8de9
adding logging.exception (#1569)
surcyf123 Oct 31, 2023
aaf4366
Update network.py (#1568)
wildcommunist Nov 1, 2023
c21579f
Subtensor Registry (#1562)
Eugene-hu Nov 1, 2023
d79a129
add instructions for upgrading bittensor with outdated version check …
ifrit98 Nov 2, 2023
ec4ee91
Add identity commands to btcli (#1566)
ifrit98 Nov 3, 2023
2a3f6f6
Add set_delegate_take command to btcli (#1563)
Nov 6, 2023
9ee678a
Subtensor archive (#1575)
ifrit98 Nov 10, 2023
b33b08e
Bugfix/list delegates (#1577)
ifrit98 Nov 14, 2023
911fbc6
don't return result twice in query() (#1574)
ifrit98 Nov 14, 2023
a9389ed
rename logging.py so doesn't circ import (#1572)
ifrit98 Nov 14, 2023
91449d7
add AxonInfo.<to|from>_string() (#1565)
ifrit98 Nov 15, 2023
8133a07
don't print __is_set for recursive objects (#1573)
ifrit98 Nov 15, 2023
c980810
Merge branch 'master' into release/6.3.0
ifrit98 Nov 16, 2023
3bc1e9f
fix merge duplication in dendrite, config print error
ifrit98 Nov 16, 2023
7551407
update version
ifrit98 Nov 16, 2023
de965f2
update changelog
ifrit98 Nov 16, 2023
e371466
Adds docstrings for CLI for Sphynx documentation (#1579)
ifrit98 Nov 16, 2023
3af1d92
Revert "Add set_delegate_take command to btcli (#1563)"
ifrit98 Nov 20, 2023
8722bdb
Axon fix (#1586)
ifrit98 Nov 20, 2023
c72e0c3
update conda install yml and readme to latest bittensor reqs (#1584)
ifrit98 Nov 20, 2023
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
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# Changelog

## 6.3.0 / 2023-11-16

## What's Changed
* (un)Staking multiple avoid tx limit by @camfairchild in https://github.com/opentensor/bittensor/pull/1244
* additional logging for prometheus by @Eugene-hu in https://github.com/opentensor/bittensor/pull/1246
* Dataset fix by @isabella618033 in https://github.com/opentensor/bittensor/pull/1249
* Grab delegates details from GitHub by @camfairchild in https://github.com/opentensor/bittensor/pull/1245
* Add raw spec for local test and new bins by @camfairchild in https://github.com/opentensor/bittensor/pull/1243
* Fix list_delegates on non-archive nodes by @camfairchild in https://github.com/opentensor/bittensor/pull/1232
* Blacklist fixes + depreciation of old signatures by @Eugene-hu in https://github.com/opentensor/bittensor/pull/1240
* [BIT-636] Change u16 weight normalization to max-upscaling by @opentaco in https://github.com/opentensor/bittensor/pull/1241
* remove duplicate command #1228 by @camfairchild in https://github.com/opentensor/bittensor/pull/1231
* test_forward_priority_2nd_request_timeout fix by @isabella618033 in https://github.com/opentensor/bittensor/pull/1276
* Remove btcli query and btcli set_weights by @camfairchild in https://github.com/opentensor/bittensor/pull/1144
* Merge releases 4.0.0 and 4.0.1 back to staging by @camfairchild in https://github.com/opentensor/bittensor/pull/1306
* Improve development workflow documentation by @quac88 in https://github.com/opentensor/bittensor/pull/1262
* staging updates and fixes by @ifrit98 in https://github.com/opentensor/bittensor/pull/1540
* Add root get_weights command to btcli by @Rubberbandits in https://github.com/opentensor/bittensor/pull/1536
* Fix typo by @steffencruz in https://github.com/opentensor/bittensor/pull/1543
* remove duplicated debug message in dendrite by @ifrit98 in https://github.com/opentensor/bittensor/pull/1544
* Cli fix by @ifrit98 in https://github.com/opentensor/bittensor/pull/1541
* update faucet helpstr by @ifrit98 in https://github.com/opentensor/bittensor/pull/1542
* Added mechanism to sum all delegated tao by @shibshib in https://github.com/opentensor/bittensor/pull/1547
* Dict hash fix by @ifrit98 in https://github.com/opentensor/bittensor/pull/1548
* Release/6.1.0 by @ifrit98 in https://github.com/opentensor/bittensor/pull/1550
* Merge master by @ifrit98 in https://github.com/opentensor/bittensor/pull/1552
* Streaming fix by @ifrit98 in https://github.com/opentensor/bittensor/pull/1551
* Fix typos by @omahs in https://github.com/opentensor/bittensor/pull/1553
* Normalize weights in r get weights table by @camfairchild in https://github.com/opentensor/bittensor/pull/1556
* Dendrite & Synapse updates and fixes by @ifrit98 in https://github.com/opentensor/bittensor/pull/1555
* rm root flag in metagraph by @ifrit98 in https://github.com/opentensor/bittensor/pull/1558
* Max Faucet Runs == 3 by @ifrit98 in https://github.com/opentensor/bittensor/pull/1560
* replace unknown wallet params (chain mismatch) with key values by @ifrit98 in https://github.com/opentensor/bittensor/pull/1559
* Remove PoW registration cli and associated extrinsic by @ifrit98 in https://github.com/opentensor/bittensor/pull/1557
* Add btcli wallet balance by @ifrit98 in https://github.com/opentensor/bittensor/pull/1564
* Dendrite fixes by @ifrit98 in https://github.com/opentensor/bittensor/pull/1561
* Release/6.2.0 by @ifrit98 in https://github.com/opentensor/bittensor/pull/1567
* Master into staging by @ifrit98 in https://github.com/opentensor/bittensor/pull/1570
* adding logging.exception by @surcyf123 in https://github.com/opentensor/bittensor/pull/1569
* Update network.py by @wildcommunist in https://github.com/opentensor/bittensor/pull/1568
* Subtensor Registry by @Eugene-hu in https://github.com/opentensor/bittensor/pull/1562
* add instructions for upgrading bittensor with outdated version check by @ifrit98 in https://github.com/opentensor/bittensor/pull/1571
* Add identity commands to btcli by @ifrit98 in https://github.com/opentensor/bittensor/pull/1566
* Add set_delegate_take command to btcli by @Rubberbandits in https://github.com/opentensor/bittensor/pull/1563
* Subtensor archive by @ifrit98 in https://github.com/opentensor/bittensor/pull/1575
* Bugfix/list delegates by @ifrit98 in https://github.com/opentensor/bittensor/pull/1577
* don't return result twice in query() by @ifrit98 in https://github.com/opentensor/bittensor/pull/1574
* rename logging.py so doesn't circ import by @ifrit98 in https://github.com/opentensor/bittensor/pull/1572
* add AxonInfo.<to|from>_string() by @ifrit98 in https://github.com/opentensor/bittensor/pull/1565
* don't print __is_set for recursive objects by @ifrit98 in https://github.com/opentensor/bittensor/pull/1573

## New Contributors
* @omahs made their first contribution in https://github.com/opentensor/bittensor/pull/1553
* @surcyf123 made their first contribution in https://github.com/opentensor/bittensor/pull/1569

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v6.0.1...v6.3.0


## 6.2.0 / 2023-10-30

## 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.2.0
6.3.0
8 changes: 5 additions & 3 deletions 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.2.0"
__version__ = "6.3.0"
version_split = __version__.split(".")
__version_as_int__ = (
(100 * int(version_split[0]))
Expand Down Expand Up @@ -87,12 +87,14 @@ def debug(on: bool = True):
# Wallet ss58 address length
__ss58_address_length__ = 48

__networks__ = ["local", "finney", "test"]
__networks__ = ["local", "finney", "test", "archive"]

__finney_entrypoint__ = "wss://entrypoint-finney.opentensor.ai:443"

__finney_test_entrypoint__ = "wss://test.finney.opentensor.ai:443/"

__archive_entrypoint__ = "wss://archive.chain.opentensor.ai:443/"

# Needs to use wss://
__bellagene_entrypoint__ = "wss://parachain.opentensor.ai:443"

Expand Down Expand Up @@ -208,7 +210,7 @@ def debug(on: bool = True):
from .chain_data import *
from .subtensor import subtensor as subtensor
from .cli import cli as cli, COMMANDS as ALL_COMMANDS
from .logging import logging as logging
from .btlogging import logging as logging
from .metagraph import metagraph as metagraph
from .threadpool import PriorityThreadPoolExecutor as PriorityThreadPoolExecutor

Expand Down
25 changes: 25 additions & 0 deletions bittensor/axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,12 @@ def check_config(cls, config: "bittensor.config"):
config.axon.external_port > 1024 and config.axon.external_port < 65535
), "External port must be in range [1024, 65535]"

def to_string(self):
"""
Provides a human-readable representation of the AxonInfo for this Axon.
"""
return self.info().to_string()

def __str__(self) -> str:
"""
Provides a human-readable representation of the Axon instance.
Expand Down Expand Up @@ -729,9 +735,28 @@ async def dispatch(
# Call the postprocess function
response = await self.postprocess(synapse, response, start_time)

# Catch the error case where axon is not configured to handle the request.
except KeyError:
# Log key error.
bittensor.logging.error(
f"Key Error: Synapse name {request_name} not found."
)

# Create a synapse instance with status code 404 (not found) and status message.
synapse: bittensor.Synapse = bittensor.Synapse()
synapse.axon.status_code = "404"
synapse.axon.status_message = f"Synapse name {request_name} not found."

# Create a JSON response with a status code of 404 (not found error),
# synapse headers, and an empty content.
response = JSONResponse(
status_code=404, headers=synapse.to_headers(), content={}
)

# Start of catching all exceptions, updating the status message, and processing time.
except Exception as e:
# Log the exception for debugging purposes.
bittensor.logging.error(f"Exception: {str(e)}")
bittensor.logging.trace(f"Forward exception: {traceback.format_exc()}")

# Set the status message of the synapse to the string representation of the exception.
Expand Down
7 changes: 7 additions & 0 deletions bittensor/logging.py → bittensor/btlogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,10 @@ def trace(cls, prefix: object, sufix: object = None):
if not cls.__has_been_inited__:
cls()
logger.trace(cls._format(prefix, sufix))

@classmethod
def exception(cls, prefix: object, sufix: object = None):
"""Exception logging with traceback"""
if not cls.__has_been_inited__:
cls()
logger.exception(cls._format(prefix, sufix))
26 changes: 24 additions & 2 deletions bittensor/chain_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
# 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.

import torch
import bittensor

import json
from enum import Enum
from dataclasses import dataclass
from dataclasses import dataclass, asdict
from scalecodec.types import GenericCall
from typing import List, Tuple, Dict, Optional, Any, TypedDict, Union
from scalecodec.base import RuntimeConfiguration, ScaleBytes
Expand Down Expand Up @@ -227,6 +227,28 @@ def __str__(self):
def __repr__(self):
return self.__str__()

def to_string(self) -> str:
"""Converts the AxonInfo object to a string representation using JSON."""
try:
return json.dumps(asdict(self))
except (TypeError, ValueError) as e:
bittensor.logging.error(f"Error converting AxonInfo to string: {e}")
return AxonInfo(0, "", 0, 0, "", "").to_string()

@classmethod
def from_string(cls, s: str) -> "AxonInfo":
"""Creates an AxonInfo object from its string representation using JSON."""
try:
data = json.loads(s)
return cls(**data)
except json.JSONDecodeError as e:
bittensor.logging.error(f"Error decoding JSON: {e}")
except TypeError as e:
bittensor.logging.error(f"Type error: {e}")
except ValueError as e:
bittensor.logging.error(f"Value error: {e}")
return AxonInfo(0, "", 0, 0, "", "")

@classmethod
def from_neuron_info(cls, neuron_info: dict) -> "AxonInfo":
"""Converts a dictionary to an axon_info object."""
Expand Down
3 changes: 3 additions & 0 deletions bittensor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"weights": RootSetWeightsCommand,
"get_weights": RootGetWeightsCommand,
"senate_vote": VoteCommand,
"senate": SenateCommand,
"register": RootRegisterCommand,
"proposals": ProposalsCommand,
"delegate": DelegateStakeCommand,
Expand Down Expand Up @@ -94,6 +95,8 @@
"regen_hotkey": RegenHotkeyCommand,
"faucet": RunFaucetCommand,
"update": UpdateWalletCommand,
"set_identity": SetIdentityCommand,
"get_identity": GetIdentityCommand,
},
},
"stake": {
Expand Down
3 changes: 2 additions & 1 deletion bittensor/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
from .inspect import InspectCommand
from .metagraph import MetagraphCommand
from .list import ListCommand
from .misc import UpdateCommand, ListSubnetsCommand
from .misc import UpdateCommand
from .senate import (
SenateCommand,
ProposalsCommand,
Expand All @@ -110,3 +110,4 @@
RootSetWeightsCommand,
RootGetWeightsCommand,
)
from .identity import GetIdentityCommand, SetIdentityCommand
Loading