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 3.6.0 #1023

Merged
merged 112 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
782dc3e
[feature] external axon flags (#887)
Sep 5, 2022
4772122
[fix] fixes unstake with max-stake flag (#905)
Sep 6, 2022
a778fb8
Merge remote-tracking branch 'origin/master' into nobunaga
Eugene-hu Sep 6, 2022
0afe907
local train bug fix (#906)
Eugene-hu Sep 7, 2022
4bfb69b
[feature] [CUDA solver] Add multi-GPU and ask for CUDA during btcli r…
Sep 9, 2022
7f9d1f4
[Docs] Update old docs link to new link. Change discord invite to cus…
Sep 14, 2022
c62a81d
Fix for test_neuron.py (#917)
Eugene-hu Sep 14, 2022
f9da8f1
[feature] add --seed option to regen_hotkey (#916)
Sep 15, 2022
816a00c
circle ci version update and fix (#920)
Eugene-hu Sep 20, 2022
f34283c
Add test_phrases_split unit test
opentaco Sep 20, 2022
46b580c
Update unravel_topk_token_phrases with faster implementation
opentaco Sep 20, 2022
d6c3a97
Merge branch 'nobunaga' into feature/BIT-574/deserialization_speed_up_v2
opentaco Sep 20, 2022
cc84c75
Rename test_phrases_split to test_random_topk_token_phrases
opentaco Sep 21, 2022
73256bd
Merge remote-tracking branch 'origin/feature/BIT-574/deserialization_…
opentaco Sep 21, 2022
2415446
Unit tests cleanup (#922)
Eugene-hu Sep 21, 2022
946ac4f
Merge branch 'nobunaga' into feature/BIT-574/deserialization_speed_up_v2
opentaco Sep 22, 2022
e5a41eb
Merge pull request #921 from opentensor/feature/BIT-574/deserializati…
opentaco Sep 22, 2022
e9d8275
Deactivate test_random_topk_token_phrases unit test
opentaco Sep 23, 2022
58adeae
Create topk_tensor on origin device
opentaco Sep 23, 2022
e988cd9
Merge pull request #925 from opentensor/feature/BIT-587/deactivate-un…
opentaco Sep 23, 2022
9b5190f
Merge branch 'nobunaga' into feature/BIT-588/device_unravel_topk_toke…
opentaco Sep 23, 2022
1a2aad9
Merge pull request #926 from opentensor/feature/BIT-588/device_unrave…
opentaco Sep 23, 2022
3990a28
Normalization Update (#909)
Eugene-hu Sep 23, 2022
e9a847d
Adding development workflow documentation and script for bumping the …
eduardogr Sep 23, 2022
00bc477
Revert "Normalization Update (#909)"
Eugene-hu Sep 26, 2022
06b8541
Parachain registration (#912)
shibshib Sep 27, 2022
0cd949f
Bit 583 memory optimization v4 (#929)
isabella618033 Sep 29, 2022
623e1f0
Merge remote-tracking branch 'origin/master' into nobunaga
Eugene-hu Oct 3, 2022
8de2a69
feature/BIT-579/Adding Prometheus (#928)
eduardogr Oct 6, 2022
be033bf
Dendrite Text Generate (#941)
unconst Oct 11, 2022
67839ec
Subtensor and Normalization updates (#936)
Eugene-hu Oct 11, 2022
bd04152
Prometheus bug fix (#942)
Eugene-hu Oct 11, 2022
f09a2f0
[Fix] only reregister if flag is set (#937)
camfairchild Oct 12, 2022
4579ba9
[BIT 584] [feature] btcli register output stats not in place (#923)
camfairchild Oct 12, 2022
c8e6838
[Fix] multi cuda fix (#940)
camfairchild Oct 12, 2022
8741c12
Fix/pin wandb (#945)
camfairchild Oct 12, 2022
ebb0e88
[Fix] change bellagene entrypoint string (#938)
camfairchild Oct 12, 2022
6bc905a
Update dockerfile to current on dockerhub (#934)
camfairchild Oct 12, 2022
286ff26
Minor fixes (#955)
unconst Oct 14, 2022
d8fa7dd
Remove locals from cli and bittensor common (#947)
unconst Oct 18, 2022
f921242
Merge remote-tracking branch 'origin/master' into nobunaga
Eugene-hu Oct 18, 2022
8850a62
[feature] Improve dataloader performance (#950)
joeylegere Oct 18, 2022
2df26db
No set weights (#959)
unconst Oct 21, 2022
1da158c
Bit 590 backward fix (#957)
isabella618033 Oct 25, 2022
e09bace
[Fix] add perpet hash rate and adjust alpha (#960)
camfairchild Oct 26, 2022
151fdfb
[Fix] stake conversion issue (#958)
camfairchild Oct 26, 2022
587d41c
initial commit
Oct 31, 2022
a7b664f
fix manager server no return
Oct 31, 2022
951c47c
Dasyncio (#967)
unconst Oct 31, 2022
1e460bb
Update __init__.py
unconst Oct 31, 2022
9cfe0fa
Merge branch 'nobunaga' of https://github.com/opentensor/bittensor in…
Oct 31, 2022
39bef70
Moving to release
Oct 31, 2022
e692818
Release 3.4.2 (#969)
unconst Oct 31, 2022
530700f
fix failing test_forward_priority_2nd_request_timeout
Oct 31, 2022
32a7d23
Merge branch 'nobunaga' of https://github.com/opentensor/bittensor in…
Oct 31, 2022
18a20ea
Decrease validator moving average window
opentaco Nov 2, 2022
3b4f35b
Release 3.4.2 (#972)
unconst Nov 2, 2022
da406b2
Merge branch 'nobunaga' into feature/BIT-594/decrease_validator_movin…
opentaco Nov 2, 2022
8c8ba07
No version checking (#974)
unconst Nov 7, 2022
521a367
Promo suffix (#977)
unconst Nov 7, 2022
c11ff11
Validator exit (#980)
unconst Nov 7, 2022
ba34f1c
Merge branch 'nobunaga' into feature/BIT-594/decrease_validator_movin…
unconst Nov 8, 2022
58ae9d6
Merge pull request #971 from opentensor/feature/BIT-594/decrease_vali…
opentaco Nov 9, 2022
145e27b
Merge branch 'master' into nobunaga
unconst Nov 9, 2022
1b61d8d
Support arbitrary gRPC request metadata order (#976)
adriansmares Nov 10, 2022
a80f56c
[Fix] Dockerfile: clone the repo to install instead (#984)
camfairchild Nov 10, 2022
2472bb0
Update bittensor version to 3.4.3
opentaco Nov 15, 2022
2f3b17d
Catch precision errors in synapse forward responses
opentaco Nov 15, 2022
5bd09f0
Comment update for tensor size
opentaco Nov 15, 2022
2ae2e6e
Merge pull request #992 from opentensor/hotfix/3.4.3/synapse-security…
opentaco Nov 15, 2022
82d5bae
Merge remote-tracking branch 'origin/master' into nobunaga
Eugene-hu Nov 15, 2022
6b50db2
Fix/allow synapse all (#988)
camfairchild Nov 16, 2022
2f0c948
Mark registration threads as daemons (#998)
adriansmares Nov 17, 2022
5d89528
Add response table to validator debugging
opentaco Nov 17, 2022
a559d97
Add return_ops to parameters
opentaco Nov 17, 2022
a4b2054
Decode context and answer
opentaco Nov 17, 2022
edbdd68
Add validation length parameter
opentaco Nov 17, 2022
6b6419b
Itemize probabilities
opentaco Nov 17, 2022
1f9c330
Add debug prints
opentaco Nov 17, 2022
b7611fe
Change table formatting
opentaco Nov 17, 2022
ef5f369
Add extra tasks to response table
opentaco Nov 17, 2022
4c279b3
Debug add print
opentaco Nov 17, 2022
9ebebbe
Remove batch_size parameter
opentaco Nov 17, 2022
98a1454
Switch modulo order
opentaco Nov 17, 2022
a9e45ea
Modify table format
opentaco Nov 17, 2022
ed472ce
Modify table format
opentaco Nov 17, 2022
d55c98a
Modify table format
opentaco Nov 17, 2022
9d5688b
Modify table format
opentaco Nov 17, 2022
e65a4e9
Try table print to catch rich errors
opentaco Nov 18, 2022
62d2404
Modify table title and caption
opentaco Nov 18, 2022
6f65385
Add shapley_values_nxt column
opentaco Nov 18, 2022
b3f06f6
Refactor response table functions
opentaco Nov 18, 2022
0006d10
Correct responsive count
opentaco Nov 18, 2022
df86916
Format table caption
opentaco Nov 18, 2022
f871314
Merge pull request #999 from opentensor/feature/BIT-598/validator-deb…
opentaco Nov 20, 2022
50dedb9
[BIT-599] Validator weight setting improvements (#1000)
opentaco Nov 23, 2022
30b1fa0
Improve release scripts and adding some labels to dockerfile #1004 …
eduardogr Nov 24, 2022
ecac766
Merging back release/3.5.0 into nobunaga (#1009)
eduardogr Nov 24, 2022
5fc599f
Removal of dendrite multiprocessing (#1017)
Eugene-hu Nov 25, 2022
2ad4fb2
Merging back 3.5.1 fix to nobunaga (#1018)
eduardogr Nov 25, 2022
843a53b
Release/3.5.0 post release (#1010)
eduardogr Nov 25, 2022
704298c
Fixes issue with --neuron.no_set_weights (#1020)
camfairchild Dec 2, 2022
b533959
Removing GitHub workflow push docker (#1011)
eduardogr Dec 6, 2022
b213b9f
[Fix] fix max stake for single (#996)
camfairchild Dec 6, 2022
df54ca9
[Feature] mention balance if not no prompt (#995)
camfairchild Dec 6, 2022
504704a
Add signature v2 format (#983)
adriansmares Dec 7, 2022
a92976f
Improving the way we manage requirements (#1003)
eduardogr Dec 8, 2022
332ba29
[BIT-601] Scaling law on EMA loss (#1022)
opentaco Dec 9, 2022
0d20adf
Updating version to 3.6.0 running './scripts/release/versioning.sh --…
eduardogr Dec 6, 2022
671fd9f
Merge remote-tracking branch 'origin/master' into release/3.6.0
Eugene-hu Dec 9, 2022
db43630
[BIT-602] Update scaling power from subtensor (#1027)
opentaco Dec 10, 2022
844b73d
Fix extras for wheel package
eduardogr Dec 13, 2022
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
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
python: circleci/python@2.0.3
python: circleci/python@2.1.1
# coveralls: coveralls/[email protected]

jobs:
Expand All @@ -20,27 +20,28 @@ jobs:
- restore_cache:
name: Restore cached venv
keys:
- v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements.txt" }}
- v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements/prod.txt" }}
- v1-pypi-py<< parameters.python-version >>

- run:
name: Update & Activate venv
command: |
python -m venv env/
. env/bin/activate
pip install -r requirements.txt
python -m pip install --upgrade pip
pip install '.'

- save_cache:
name: Save cached venv
paths:
- "env/"
key: v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements.txt" }}
key: v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements/prod.txt" }}

- run:
name: Install Bittensor
command: |
. env/bin/activate
pip install -e .
pip install -e '.'

- run:
name: Instantiate Mock Wallet & Protos
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/docker_image_push.yml

This file was deleted.

38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 3.5.1 / 2022-11-24

## What's Changed
* [hotfix] pin scalecodec lower by @camfairchild in https://github.com/opentensor/bittensor/pull/1013


**Full Changelog**: https://github.com/opentensor/bittensor/compare/v3.5.0...v3.5.1

## 3.5.0 / 2022-11-24

## What's Changed

- [Fix] allow synapse all (https://github.com/opentensor/bittensor/pull/988)
- 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

- [Feature] Validator debug response table (https://github.com/opentensor/bittensor/pull/999)
- Add response table to validator debugging

- [Feature] Validator weight setting improvements (https://github.com/opentensor/bittensor/pull/1000)
- Remove responsive prioritization from validator weight calculation
- Move metagraph_sync just before weight setting
- Add metagraph register to validator
- Update validator epoch conditions
- Log epoch while condition details
- Consume validator nucleus UID queue fully
- Increase synergy table display precision
- Round before casting to int in phrase_cross_entropy
- small fix for changelog and version by @Eugene-hu in https://github.com/opentensor/bittensor/pull/993
- release/3.5.0 by @eduardogr in https://github.com/opentensor/bittensor/pull/1006

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v3.4.3...v3.5.0


## 3.4.3 / 2022-11-15

## What's Changed
Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SHELL:=/bin/bash

init-venv:
python3 -m venv venv && source ./venv/bin/activate

clean-venv:
source ./venv/bin/activate && \
pip freeze > make_venv_to_uninstall.txt && \
pip uninstall -r make_venv_to_uninstall.txt && \
rm make_venv_to_uninstall.txt

clean:
rm -rf dist/ && \
rm -rf build/ && \
rm -rf bittensor.egg-info/ && \
rm -rf .pytest_cache/ && \
rm -rf lib/

install:
python3 -m pip install .

install-dev:
python3 -m pip install '.[dev]'

install-cubit:
python3 -m pip install '.[cubit]'
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.1
3.6.0
3 changes: 2 additions & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
nest_asyncio.apply()

# Bittensor code and protocol version.
__version__ = '3.5.1'
__version__ = '3.6.0'
version_split = __version__.split(".")
__version_as_int__ = (100 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))

__new_signature_version__ = 360

# Turn off rich console locals trace.
from rich.traceback import install
Expand Down
101 changes: 65 additions & 36 deletions bittensor/_axon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ def __new__(
if thread_pool == None:
thread_pool = futures.ThreadPoolExecutor( max_workers = config.axon.max_workers )
if server == None:
receiver_hotkey = wallet.hotkey.ss58_address
server = grpc.server( thread_pool,
interceptors=(AuthInterceptor(blacklist=blacklist),),
interceptors=(AuthInterceptor(receiver_hotkey=receiver_hotkey, blacklist=blacklist),),
maximum_concurrent_rpcs = config.axon.maximum_concurrent_rpcs,
options = [('grpc.keepalive_time_ms', 100000),
('grpc.keepalive_timeout_ms', 500000)]
Expand Down Expand Up @@ -341,22 +342,26 @@ def check_forward_callback( forward_callback:Callable, synapses:list = []):
class AuthInterceptor(grpc.ServerInterceptor):
"""Creates a new server interceptor that authenticates incoming messages from passed arguments."""

def __init__(self, key: str = "Bittensor", blacklist: List = []):
def __init__(
self,
receiver_hotkey: str,
blacklist: Callable = None,
):
r"""Creates a new server interceptor that authenticates incoming messages from passed arguments.
Args:
key (str, `optional`):
key for authentication header in the metadata (default = Bittensor)
receiver_hotkey(str):
the SS58 address of the hotkey which should be targeted by RPCs
black_list (Function, `optional`):
black list function that prevents certain pubkeys from sending messages
"""
super().__init__()
self.auth_header_value = key
self.nonces = {}
self.blacklist = blacklist
self.receiver_hotkey = receiver_hotkey

def parse_legacy_signature(
self, signature: str
) -> Union[Tuple[int, str, str, str], None]:
) -> Union[Tuple[int, str, str, str, int], None]:
r"""Attempts to parse a signature using the legacy format, using `bitxx` as a separator"""
parts = signature.split("bitxx")
if len(parts) < 4:
Expand All @@ -367,52 +372,71 @@ def parse_legacy_signature(
except ValueError:
return None
receptor_uuid, parts = parts[-1], parts[:-1]
message, parts = parts[-1], parts[:-1]
pubkey = "".join(parts)
return (nonce, pubkey, message, receptor_uuid)
signature, parts = parts[-1], parts[:-1]
sender_hotkey = "".join(parts)
return (nonce, sender_hotkey, signature, receptor_uuid, 1)

def parse_signature(self, metadata: Dict[str, str]) -> Tuple[int, str, str, str]:
def parse_signature_v2(
self, signature: str
) -> Union[Tuple[int, str, str, str, int], None]:
r"""Attempts to parse a signature using the v2 format"""
parts = signature.split(".")
if len(parts) != 4:
return None
try:
nonce = int(parts[0])
except ValueError:
return None
sender_hotkey = parts[1]
signature = parts[2]
receptor_uuid = parts[3]
return (nonce, sender_hotkey, signature, receptor_uuid, 2)

def parse_signature(
self, metadata: Dict[str, str]
) -> Tuple[int, str, str, str, int]:
r"""Attempts to parse a signature from the metadata"""
signature = metadata.get("bittensor-signature")
if signature is None:
raise Exception("Request signature missing")
parts = self.parse_legacy_signature(signature)
if parts is not None:
return parts
for parser in [self.parse_signature_v2, self.parse_legacy_signature]:
parts = parser(signature)
if parts is not None:
return parts
raise Exception("Unknown signature format")

def check_signature(
self, nonce: int, pubkey: str, signature: str, receptor_uuid: str
self,
nonce: int,
sender_hotkey: str,
signature: str,
receptor_uuid: str,
format: int,
):
r"""verification of signature in metadata. Uses the pubkey and nonce"""
keypair = Keypair(ss58_address=pubkey)
keypair = Keypair(ss58_address=sender_hotkey)
# Build the expected message which was used to build the signature.
message = f"{nonce}{pubkey}{receptor_uuid}"
if format == 2:
message = f"{nonce}.{sender_hotkey}.{self.receiver_hotkey}.{receptor_uuid}"
elif format == 1:
message = f"{nonce}{sender_hotkey}{receptor_uuid}"
else:
raise Exception("Invalid signature version")
# Build the key which uniquely identifies the endpoint that has signed
# the message.
endpoint_key = f"{pubkey}:{receptor_uuid}"
endpoint_key = f"{sender_hotkey}:{receptor_uuid}"

if endpoint_key in self.nonces.keys():
previous_nonce = self.nonces[endpoint_key]
# Nonces must be strictly monotonic over time.
if nonce - previous_nonce <= -10:
if nonce <= previous_nonce:
raise Exception("Nonce is too small")
if not keypair.verify(message, signature):
raise Exception("Signature mismatch")
self.nonces[endpoint_key] = nonce
return

if not keypair.verify(message, signature):
raise Exception("Signature mismatch")
self.nonces[endpoint_key] = nonce

def version_checking(self, metadata: Dict[str, str]):
r"""Checks the header and version in the metadata"""
provided_value = metadata.get("rpc-auth-header")
if provided_value is None or provided_value != self.auth_header_value:
raise Exception("Unexpected caller metadata")

def black_list_checking(self, pubkey: str, method: str):
def black_list_checking(self, hotkey: str, method: str):
r"""Tries to call to blacklist function in the miner and checks if it should blacklist the pubkey"""
if self.blacklist == None:
return
Expand All @@ -424,7 +448,7 @@ def black_list_checking(self, pubkey: str, method: str):
if request_type is None:
raise Exception("Unknown request type")

if self.blacklist(pubkey, request_type):
if self.blacklist(hotkey, request_type):
raise Exception("Request type is blacklisted")

def intercept_service(self, continuation, handler_call_details):
Expand All @@ -433,16 +457,21 @@ def intercept_service(self, continuation, handler_call_details):
metadata = dict(handler_call_details.invocation_metadata)

try:
# version checking
self.version_checking(metadata)

(nonce, pubkey, signature, receptor_uuid) = self.parse_signature(metadata)
(
nonce,
sender_hotkey,
signature,
receptor_uuid,
signature_format,
) = self.parse_signature(metadata)

# signature checking
self.check_signature(nonce, pubkey, signature, receptor_uuid)
self.check_signature(
nonce, sender_hotkey, signature, receptor_uuid, signature_format
)

# blacklist checking
self.black_list_checking(pubkey, method)
self.black_list_checking(sender_hotkey, method)

return continuation(handler_call_details)

Expand Down
24 changes: 18 additions & 6 deletions bittensor/_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,27 @@ def check_transfer_config( config: 'bittensor.Config'):
sys.exit()
else:
config.dest = str(dest)

# Get current balance and print to user.
if not config.no_prompt:
wallet = bittensor.wallet( config )
subtensor = bittensor.subtensor( config )
with bittensor.__console__.status(":satellite: Checking Balance..."):
account_balance = subtensor.get_balance( wallet.coldkeypub.ss58_address )
bittensor.__console__.print("Balance: [green]{}[/green]".format(account_balance))

# Get amount.
if not config.get('amount'):
amount = Prompt.ask("Enter Tao amount to transfer")
try:
config.amount = float(amount)
except ValueError:
console.print(":cross_mark:[red] Invalid Tao amount[/red] [bold white]{}[/bold white]".format(amount))
sys.exit()
if not config.no_prompt:
amount = Prompt.ask("Enter TAO amount to transfer")
try:
config.amount = float(amount)
except ValueError:
console.print(":cross_mark:[red] Invalid TAO amount[/red] [bold white]{}[/bold white]".format(amount))
sys.exit()
else:
console.print(":cross_mark:[red] Invalid TAO amount[/red] [bold white]{}[/bold white]".format(amount))
sys.exit(1)

def check_unstake_config( config: 'bittensor.Config' ):
if config.subtensor.get('network') == bittensor.defaults.subtensor.network and not config.no_prompt:
Expand Down
Loading