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

Boost #1594

Merged
merged 10 commits into from
Nov 28, 2023
Merged

Boost #1594

Show file tree
Hide file tree
Changes from 4 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
101 changes: 101 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,106 @@
# 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
* (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

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

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


## 6.1.0 / 2023-10-17

## What's Changed
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Bittensor is a mining network, similar to Bitcoin, that includes built-in incentives designed to encourage computers to provide access to machine learning models in an efficient and censorship-resistant manner. These models can be queried by users seeking outputs from the network, for instance; generating text, audio, and images, or for extracting numerical representations of these input types. Under the hood, Bittensor’s *economic market*, is facilitated by a blockchain token mechanism, through which producers (***miners***) and the verification of the work done by those miners (***validators***) are rewarded. Miners host, train or otherwise procure machine learning systems into the network as a means of fulfilling the verification problems defined by the validators, like the ability to generate responses from prompts i.e. “What is the capital of Texas?.

The token based mechanism under which the miners are incentivized ensures that they are constantly driven to make their knowledge output more useful, in terms of speed, intelligence and diversity. The value generated by the network is distributed directly to the individuals producing that value, without intermediarias. Anyone can participate in this endeavour, extract value from the network, and govern Bittensor. The network is open to all participants, and no individual or group has full control over what is learned, who can profit from it, or who can access it.
The token based mechanism under which the miners are incentivized ensures that they are constantly driven to make their knowledge output more useful, in terms of speed, intelligence and diversity. The value generated by the network is distributed directly to the individuals producing that value, without intermediaries. Anyone can participate in this endeavour, extract value from the network, and govern Bittensor. The network is open to all participants, and no individual or group has full control over what is learned, who can profit from it, or who can access it.

To learn more about Bittensor, please read our [paper](https://bittensor.com/whitepaper).

Expand Down Expand Up @@ -70,7 +70,7 @@ print (wallet)
$ btcli wallet new_coldkey
Enter wallet name (default):

IMPORTANT: Store this mnemonic in a secure (preferably offline place), as anyone who has possesion of this mnemonic can use it to regenerate the key and access your tokens.
IMPORTANT: Store this mnemonic in a secure (preferably offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.
The mnemonic to the new coldkey is:
**** *** **** **** ***** **** *** **** **** **** ***** *****
You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
Expand All @@ -80,7 +80,7 @@ $ btcli wallet new_hotkey
Enter wallet name (default): d1
Enter hotkey name (default):

IMPORTANT: Store this mnemonic in a secure (preferably offline place), as anyone who has possesion of this mnemonic can use it to regenerate the key and access your tokens.
IMPORTANT: Store this mnemonic in a secure (preferably offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.
The mnemonic to the new hotkey is:
**** *** **** **** ***** **** *** **** **** **** ***** *****
You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
Expand All @@ -95,7 +95,7 @@ $ tree ~/.bittensor/
coldkey # You encrypted coldkey.
coldkeypub.txt # Your coldkey public address
hotkeys/ # The folder containing all of your hotkeys.
default # You unencrypeted hotkey information.
default # You unencrypted hotkey information.
```
Your default wallet ```Wallet (default, default, ~/.bittensor/wallets/)``` is always used unless you specify otherwise. Be sure to store your mnemonics safely. If you lose your password to your wallet, or the access to the machine where the wallet is stored, you can always regenerate the coldkey using the mnemonic you saved from above.
```bash
Expand Down Expand Up @@ -183,18 +183,18 @@ For example:
```bash
btcli subnets --help

usage: btcli <command> <command args> subnets [-h] {list,metagraph,lock_cost,create,register,recycle_register,hyperparameters} ...
usage: btcli <command> <command args> subnets [-h] {list,metagraph,lock_cost,create,register,pow_register,hyperparameters} ...

positional arguments:
{list,metagraph,lock_cost,create,register,recycle_register,hyperparameters}
{list,metagraph,lock_cost,create,register,pow_register,hyperparameters}
Commands for managing and viewing subnetworks.
list List all subnets on the network
list List all subnets on the network.
metagraph View a subnet metagraph information.
lock_cost Return the lock cost to register a subnet
lock_cost Return the lock cost to register a subnet.
create Create a new bittensor subnetwork on this chain.
register Register a wallet to a network.
recycle_register Register a wallet to a network.
hyperparameters View subnet hyperparameters
register Register a wallet to a network using PoW.
hyperparameters View subnet hyperparameters.

options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -251,7 +251,7 @@ metagraph.save()
metagraph.load()
```

Synapse: Responsible for defining the protocol definition betwee axon servers and dendrite clients
Synapse: Responsible for defining the protocol definition between axon servers and dendrite clients
```python
class Topk( bittensor.Synapse ):
topk: int = 2 # Number of "top" elements to select
Expand Down Expand Up @@ -289,12 +289,12 @@ def verify_my_synapse( synapse: MySyanpse ):
# Apply custom verification logic to synapse
# Optionally raise Exception

# Define a custom request blacklist fucntion
# Define a custom request blacklist function
def blacklist_my_synapse( synapse: MySyanpse ) -> bool:
# Apply custom blacklist
# return False ( if non blacklisted ) or True ( if blacklisted )

# Define a custom request priority fucntion
# Define a custom request priority function
def prioritize_my_synape( synapse: MySyanpse ) -> float:
# Apply custom priority
return 1.0
Expand All @@ -312,7 +312,7 @@ my_axon.attach(
```

Dendrite: Inheriting from PyTorch's Module class, represents the abstracted implementation of a network client module designed
to send requests to those endpoint to recieve inputs.
to send requests to those endpoints to receive inputs.
Example:
```python
dendrite_obj = dendrite( wallet = bittensor.wallet() )
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.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.1.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"]
__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))
Loading