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.4.4 #1622

Merged
merged 84 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 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
24b766d
Adds docstrings for CLI for Sphynx documentation (#1579)
ifrit98 Nov 16, 2023
fab2912
Master 630 into staging (#1590)
ifrit98 Nov 27, 2023
25ecbb3
Registry cost 0.1 tao (#1587)
Eugene-hu Nov 27, 2023
2de7bb5
Add swap_hotkey command to wallet (#1580)
ifrit98 Nov 28, 2023
8941ae0
Cuda fix (#1595)
ifrit98 Nov 28, 2023
a2ec954
Feature/local subtensor default (#1591)
ifrit98 Nov 28, 2023
d1f9aff
Boost (#1594)
unconst Nov 28, 2023
5f2d975
avoid aiohttp <3.9.0 potential security issue (#1597)
ifrit98 Nov 28, 2023
f160cf0
update bittensor docstrings (overhaul) (#1592)
ifrit98 Nov 29, 2023
6b44077
Manual staging merge (#1603)
ifrit98 Dec 1, 2023
9c9d3cb
merge commit
Eugene-hu Dec 1, 2023
d65503d
Staging master 6.4.1 fix (#1604)
Eugene-hu Dec 1, 2023
cd5eb5a
Merge branch 'staging' of https://github.com/opentensor/bittensor int…
Eugene-hu Dec 1, 2023
8e68f2e
black
Eugene-hu Dec 1, 2023
1ab5977
add timeout to websock, resolves hanging issue (#1609)
ifrit98 Dec 6, 2023
5bcba6d
add ability to turn off verbose logging for btcli cmds (#1608)
ifrit98 Dec 6, 2023
e03c01b
Add taostats explorer to map (#1607)
ifrit98 Dec 6, 2023
bf8447c
Sudo/hyperparams pallet update (#1612)
Eugene-hu Dec 7, 2023
a5f4037
Merge/master642 staging no-ff (#1615)
ifrit98 Dec 12, 2023
607ba00
print help message on error for subcommands (#1618)
ifrit98 Dec 14, 2023
7f9bf90
Metadata/commitments (#1621)
ifrit98 Dec 14, 2023
289782e
release branch 644
ifrit98 Dec 14, 2023
ada8047
changelog
ifrit98 Dec 14, 2023
c703c48
Merge branch 'master' into release/6.4.4
ifrit98 Dec 14, 2023
e4e11a3
remove set delegate take stuff
ifrit98 Dec 14, 2023
6f2fe71
missed set_delegate_take import
ifrit98 Dec 14, 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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 6.4.4 / 2023-12-14

## What's Changed

* Merge/master642 staging no-ff by @ifrit98 in https://github.com/opentensor/bittensor/pull/1615
* print help message on error for subcommands by @ifrit98 in https://github.com/opentensor/bittensor/pull/1618
* Metadata/commitments by @ifrit98 in https://github.com/opentensor/bittensor/pull/1621

## 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.4.2...v6.4.4


## 6.4.2 / 2023-12-07

## 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.4.2
6.4.4
3 changes: 2 additions & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
nest_asyncio.apply()

# Bittensor code and protocol version.
__version__ = "6.4.2"
__version__ = "6.4.4"

version_split = __version__.split(".")
__version_as_int__ = (
(100 * int(version_split[0]))
Expand Down
16 changes: 15 additions & 1 deletion bittensor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@
}


class CLIErrorParser(argparse.ArgumentParser):
"""
Custom ArgumentParser for better error messages.
"""

def error(self, message):
"""
This method is called when an error occurs. It prints a custom error message.
"""
sys.stderr.write(f"Error: {message}\n")
self.print_help()
sys.exit(2)


class cli:
"""
Implementation of the Command Line Interface (CLI) class for the Bittensor protocol.
Expand Down Expand Up @@ -190,7 +204,7 @@ def __create_parser__() -> "argparse.ArgumentParser":
argparse.ArgumentParser: An argument parser object for Bittensor CLI.
"""
# Define the basic argument parser.
parser = argparse.ArgumentParser(
parser = CLIErrorParser(
description=f"bittensor cli v{bittensor.__version__}",
usage="btcli <command> <command args>",
add_help=True,
Expand Down
5 changes: 5 additions & 0 deletions bittensor/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ class KeyFileError(Exception):
"""Error thrown when the keyfile is corrupt, non-writable, non-readable or the password used to decrypt is invalid."""

pass


class MetadataError(ChainTransactionError):
r"""Error raised when metadata commitment transaction fails."""
pass
87 changes: 87 additions & 0 deletions bittensor/extrinsics/serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from dataclasses import asdict
import bittensor.utils.networking as net
from rich.prompt import Confirm
from ..errors import MetadataError


def serve_extrinsic(
Expand Down Expand Up @@ -203,3 +204,89 @@ def serve_axon_extrinsic(
prompt=prompt,
)
return serve_success


def publish_metadata(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
netuid: int,
type: str,
data: str,
wait_for_inclusion: bool = False,
wait_for_finalization: bool = True,
) -> bool:
"""
Publishes metadata on the bittensor network using the specified wallet and network identifier.

Args:
subtensor (bittensor.subtensor):
The subtensor instance representing the bittensor blockchain connection.
wallet (bittensor.wallet):
The wallet object used for authentication in the transaction.
netuid (int):
Network UID on which the metadata is to be published.
type (str):
The data type of the information being submitted. It should be one of the following:
'Sha256', 'Blake256', 'Keccak256', or 'Raw0-128'. This specifies the format or
hashing algorithm used for the data.
data (str):
The actual metadata content to be published. This should be formatted or hashed
according to the 'type' specified. (Note: max str length of 128 bytes)
wait_for_inclusion (bool, optional):
If True, the function will wait for the extrinsic to be included in a block before returning.
Defaults to False.
wait_for_finalization (bool, optional):
If True, the function will wait for the extrinsic to be finalized on the chain before returning.
Defaults to True.

Returns:
bool:
True if the metadata was successfully published (and finalized if specified). False otherwise.

Raises:
MetadataError:
If there is an error in submitting the extrinsic or if the response from the blockchain indicates failure.
"""

wallet.hotkey

with subtensor.substrate as substrate:
call = substrate.compose_call(
call_module="Commitments",
call_function="set_commitment",
call_params={"netuid": netuid, "info": {"fields": [[{f"{type}": data}]]}},
)

extrinsic = substrate.create_signed_extrinsic(call=call, keypair=wallet.hotkey)
response = substrate.submit_extrinsic(
extrinsic,
wait_for_inclusion=wait_for_inclusion,
wait_for_finalization=wait_for_finalization,
)
# We only wait here if we expect finalization.
if not wait_for_finalization and not wait_for_inclusion:
return True
response.process_events()
if response.is_success:
return True
else:
raise MetadataError(response.error_message)


from retry import retry
from typing import Optional


def get_metadata(self, netuid: int, hotkey: str, block: Optional[int] = None) -> str:
@retry(delay=2, tries=3, backoff=2, max_delay=4)
def make_substrate_call_with_retry():
with self.substrate as substrate:
return substrate.query(
module="Commitments",
storage_function="CommitmentOf",
params=[netuid, hotkey],
block_hash=None if block == None else substrate.get_block_hash(block),
)

commit_data = make_substrate_call_with_retry()
return commit_data.value
18 changes: 17 additions & 1 deletion bittensor/subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@
)
from .extrinsics.staking import add_stake_extrinsic, add_stake_multiple_extrinsic
from .extrinsics.unstaking import unstake_extrinsic, unstake_multiple_extrinsic
from .extrinsics.serving import serve_extrinsic, serve_axon_extrinsic
from .extrinsics.serving import (
serve_extrinsic,
serve_axon_extrinsic,
publish_metadata,
get_metadata,
)
from .extrinsics.registration import (
register_extrinsic,
burned_register_extrinsic,
Expand Down Expand Up @@ -2111,6 +2116,17 @@ def make_substrate_call_with_retry():

return make_substrate_call_with_retry()

""" Make some commitment on-chain about arbitary data """

def commit(self, wallet, netuid: int, data: str):
publish_metadata(self, wallet, netuid, f"Raw{len(data)}", data.encode())

def get_commitment(self, netuid: int, uid: int, block: Optional[int] = None) -> str:
metagraph = self.metagraph(netuid)
hotkey = metagraph.hotkeys[uid]

return get_metadata(self, netuid, hotkey, block)

########################
#### Standard Calls ####
########################
Expand Down