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.10.0 #1757

Merged
merged 48 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
77af8c0
Replace wildcard import with bespoke import
brueningf Feb 26, 2024
d2f46fa
Replace wildcard import with bespoke import
brueningf Feb 26, 2024
a9d3c00
Fix undefined parser var for print-completion print
brueningf Feb 28, 2024
b9bb6fe
handle req args by parsing and raising
ifrit98 Mar 5, 2024
25c6e69
Merge branch 'staging' into refactor/wildcard-into-specific-imports
ifrit98 Mar 6, 2024
18aad05
Merge branch 'staging' into feature/handle-required-args-gracefully/phil
ifrit98 Mar 6, 2024
03ec9a6
Merge branch 'staging' into feature/handle-required-args-gracefully/phil
ifrit98 Mar 6, 2024
05a846d
black
ifrit98 Mar 6, 2024
8ec7653
Merge branch 'staging' into refactor/wildcard-into-specific-imports
brueningf Mar 8, 2024
e9de4c1
update documentation for serving rate limit
ifrit98 Mar 20, 2024
ac95103
fix return type for _do_swap_hotkey
ifrit98 Mar 20, 2024
bf90e7d
Merge branch 'staging' into refactor/wildcard-into-specific-imports
ifrit98 Mar 20, 2024
1bc997c
Merge branch 'staging' into feature/handle-required-args-gracefully/phil
ifrit98 Mar 20, 2024
ceb4986
Merge pull request #1733 from opentensor/feature/handle-required-args…
ifrit98 Mar 21, 2024
9d6a3a3
Merge branch 'staging' into refactor/wildcard-into-specific-imports
ifrit98 Mar 21, 2024
5abc751
Merge pull request #1724 from brueningf/refactor/wildcard-into-specif…
ifrit98 Mar 21, 2024
d5348b9
fix: nonce implementation
GentikSolm Mar 21, 2024
4959bf0
First commit for stdout stream with builtin logging module
Mar 13, 2024
953274b
Remove loguru from btlogging.
Mar 14, 2024
9d7bbbe
Replace loguru with builtin logger
Mar 15, 2024
ac91a40
Clean up.
Mar 15, 2024
bc68180
Add support for multiprocessing logging with queue.
Mar 18, 2024
2680590
Refactor LoggingMachine to ingest purely from a queue.
Mar 19, 2024
9fae1c9
Partial implementation of syncronization of logger state and log emis…
Mar 19, 2024
114671c
Use concurrency primitives to synchronize logging and state change.
Mar 20, 2024
3169cf2
Remove commented locks and return idempotency to file logging enablem…
Mar 20, 2024
f16bb1e
Remove concurrency primities, pause QueueListener during state transi…
Mar 20, 2024
bcf5bc6
Add unit tests.
Mar 21, 2024
ef7443d
Update unit test, add function to LoggingMachine for backward compati…
Mar 21, 2024
ab9ad3d
Black fixes.
Mar 21, 2024
913b324
Add support for prefix and sufix args in logging API. Add support for…
Mar 21, 2024
37367bc
Remove unused imports. Black fix.
Mar 22, 2024
02360d9
Fix property check for LoggingMachine
Mar 22, 2024
cf2d021
Return required API for args and config
Mar 22, 2024
6ed44f9
Fix check_config api.
Mar 22, 2024
41f3769
Override __call__ for LoggingMachine object to match previous API
Mar 22, 2024
95fd1f3
Disable 3rd party loggers for now, and separate out toggling to a sep…
Mar 22, 2024
99547f0
Black fix.
Mar 22, 2024
b5f0dce
Update DEBUGGING.md
e-gons Mar 23, 2024
9ec0687
Merge pull request #1751 from opentensor/feature/logging-refactor
ifrit98 Mar 25, 2024
de0567c
Merge branch 'staging' into patch-3
ifrit98 Mar 25, 2024
954709e
Merge branch 'staging' into fix/nonce
ifrit98 Mar 25, 2024
aa131a5
Merge pull request #1755 from e-gons/patch-3
ifrit98 Mar 25, 2024
ddfc62b
fix install.sh display of btlci subcommands
ifrit98 Mar 25, 2024
1c2970a
Merge branch 'staging' into fix/nonce
ifrit98 Mar 25, 2024
de0bd31
Merge pull request #1754 from GentikSolm/fix/nonce
ifrit98 Mar 25, 2024
913083a
add version
ifrit98 Mar 25, 2024
4fed844
add changelog
ifrit98 Mar 25, 2024
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
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 6.10.0 / 2024-03-25

## What's Changed
* handle req args by parsing and raising by @ifrit98 in https://github.com/opentensor/bittensor/pull/1733
* Replace wildcard imports with specific imports by @brueningf in https://github.com/opentensor/bittensor/pull/1724
* Logging Refactor by @sepehr-opentensor in https://github.com/opentensor/bittensor/pull/1751
* Update DEBUGGING.md by @e-gons in https://github.com/opentensor/bittensor/pull/1755
* fix: nonce implementation by @GentikSolm in https://github.com/opentensor/bittensor/pull/1754

## New Contributors
* @sepehr-opentensor made their first contribution in https://github.com/opentensor/bittensor/pull/1751
* @e-gons made their first contribution in https://github.com/opentensor/bittensor/pull/1755
* @GentikSolm made their first contribution in https://github.com/opentensor/bittensor/pull/1754

**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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.9.3
6.10.0
93 changes: 81 additions & 12 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.9.3"
__version__ = "6.10.0"

version_split = __version__.split(".")
__version_as_int__: int = (
Expand Down Expand Up @@ -206,25 +206,94 @@ def debug(on: bool = True):
},
}

from .errors import *
from .errors import (
BlacklistedException,
ChainConnectionError,
ChainError,
ChainQueryError,
ChainTransactionError,
IdentityError,
InternalServerError,
InvalidRequestNameError,
KeyFileError,
MetadataError,
NominationError,
NotDelegateError,
NotRegisteredError,
NotVerifiedException,
PostProcessException,
PriorityException,
RegistrationError,
RunException,
StakeError,
SynapseDendriteNoneException,
SynapseParsingError,
TransferError,
UnknownSynapseError,
UnstakeError,
)

from substrateinterface import Keypair as Keypair
from .config import *
from .keyfile import *
from .wallet import *
from .config import InvalidConfigFile, DefaultConfig, config, T
from .keyfile import (
serialized_keypair_to_keyfile_data,
deserialize_keypair_from_keyfile_data,
validate_password,
ask_password_to_encrypt,
keyfile_data_is_encrypted_nacl,
keyfile_data_is_encrypted_ansible,
keyfile_data_is_encrypted_legacy,
keyfile_data_is_encrypted,
keyfile_data_encryption_method,
legacy_encrypt_keyfile_data,
encrypt_keyfile_data,
get_coldkey_password_from_environment,
decrypt_keyfile_data,
keyfile,
Mockkeyfile,
)
from .wallet import display_mnemonic_msg, wallet

from .utils import (
ss58_to_vec_u8,
unbiased_topk,
version_checking,
strtobool,
strtobool_with_default,
get_explorer_root_url_by_network_from_map,
get_explorer_root_url_by_network_from_map,
get_explorer_url_for_network,
ss58_address_to_bytes,
U16_NORMALIZED_FLOAT,
U64_NORMALIZED_FLOAT,
u8_key_to_ss58,
hash,
wallet_utils,
)

from .utils import *
from .utils.balance import Balance as Balance
from .chain_data import *
from .chain_data import (
AxonInfo,
NeuronInfo,
NeuronInfoLite,
PrometheusInfo,
DelegateInfo,
StakeInfo,
SubnetInfo,
SubnetHyperparameters,
IPInfo,
ProposalCallData,
ProposalVoteData,
)
from .subtensor import subtensor as subtensor
from .cli import cli as cli, COMMANDS as ALL_COMMANDS
from .btlogging import logging as logging
from .btlogging import logging
from .metagraph import metagraph as metagraph
from .threadpool import PriorityThreadPoolExecutor as PriorityThreadPoolExecutor

from .synapse import *
from .stream import *
from .tensor import *
from .synapse import TerminalInfo, Synapse
from .stream import StreamingSynapse
from .tensor import tensor, Tensor
from .axon import axon as axon
from .dendrite import dendrite as dendrite

Expand All @@ -239,6 +308,6 @@ def debug(on: bool = True):
subtensor.config(),
PriorityThreadPoolExecutor.config(),
wallet.config(),
logging.config(),
logging.get_config(),
]
defaults = config.merge_all(configs)
23 changes: 17 additions & 6 deletions bittensor/axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,14 +914,25 @@ async def default_verify(self, synapse: bittensor.Synapse):
# Build the unique endpoint key.
endpoint_key = f"{synapse.dendrite.hotkey}:{synapse.dendrite.uuid}"

# Check the nonce from the endpoint key.
# Check the nonce from the endpoint key with 4 second delta
allowedDelta = 4000000000

# Requests must have nonces to be safe from replays
if synapse.dendrite.nonce is None:
raise Exception("Missing Nonce")

# If we don't have a nonce stored, ensure that the nonce falls within
# a reasonable delta.
if (
self.nonces.get(endpoint_key) is None
and synapse.dendrite.nonce <= time.time_ns() - allowedDelta
):
raise Exception("Nonce is too old")
if (
endpoint_key in self.nonces.keys()
and self.nonces[endpoint_key] is not None
and synapse.dendrite.nonce is not None
self.nonces.get(endpoint_key) is not None
and synapse.dendrite.nonce <= self.nonces[endpoint_key]
):
raise Exception("Nonce is too small")
raise Exception("Nonce is too old")

if not keypair.verify(message, synapse.dendrite.signature):
raise Exception(
Expand Down Expand Up @@ -1190,7 +1201,7 @@ async def preprocess(self, request: Request) -> bittensor.Synapse:
{
"version": str(bittensor.__version_as_int__),
"uuid": str(self.axon.uuid),
"nonce": f"{time.monotonic_ns()}",
"nonce": f"{time.time_ns()}",
"status_message": "Success",
"status_code": "100",
}
Expand Down
Loading