Skip to content

Commit bdbcbb0

Browse files
authored
Merge branch 'staging' into fix/zyzniewski/unittests_warnings
2 parents 86209dd + fe084d5 commit bdbcbb0

36 files changed

+823
-242
lines changed

.circleci/config.yml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
python -m venv .venv
4040
. .venv/bin/activate
4141
python -m pip install --upgrade uv
42-
uv pip install ruff -c requirements/dev.txt
42+
uv pip install ruff
4343
4444
- save_cache:
4545
name: Save cached ruff venv
@@ -68,9 +68,7 @@ jobs:
6868
name: Install dependencies and Check compatibility
6969
command: |
7070
if [ "$REQUIREMENTS_CHANGED" == "true" ]; then
71-
sudo apt-get update
72-
sudo apt-get install -y jq curl
73-
./scripts/check_compatibility.sh << parameters.python_version >>
71+
python -m pip install ".[dev,cli]" --dry-run --python-version << parameters.python_version >> --no-deps
7472
else
7573
echo "Skipping compatibility checks..."
7674
fi
@@ -87,31 +85,19 @@ jobs:
8785
steps:
8886
- checkout
8987

90-
- restore_cache:
91-
name: Restore cached venv
92-
keys:
93-
- v2-pypi-py<< parameters.python-version >>-{{ checksum "requirements/prod.txt" }}+{{ checksum "requirements/dev.txt" }}
94-
- v2-pypi-py<< parameters.python-version >>
95-
9688
- run:
9789
name: Update & Activate venv
9890
command: |
9991
python -m venv .venv
10092
. .venv/bin/activate
10193
python -m pip install --upgrade uv
102-
uv sync --all-extras --dev
103-
104-
- save_cache:
105-
name: Save cached venv
106-
paths:
107-
- "venv/"
108-
key: v2-pypi-py<< parameters.python-version >>-{{ checksum "requirements/prod.txt" }}+{{ checksum "requirements/dev.txt" }}
94+
uv sync --extra dev --dev
10995
11096
- run:
11197
name: Install Bittensor
11298
command: |
11399
. .venv/bin/activate
114-
uv sync --all-extras --dev
100+
uv sync --extra dev --dev
115101
116102
- run:
117103
name: Instantiate Mock Wallet
@@ -178,32 +164,20 @@ jobs:
178164
steps:
179165
- checkout
180166

181-
- restore_cache:
182-
name: Restore cached venv
183-
keys:
184-
- v2-pypi-py<< parameters.python-version >>-{{ checksum "requirements/prod.txt" }}+{{ checksum "requirements/dev.txt" }}
185-
- v2-pypi-py<< parameters.python-version >>
186-
187167
- run:
188168
name: Update & Activate venv
189169
command: |
190170
python -m venv .venv
191171
. .venv/bin/activate
192172
python -m pip install --upgrade uv
193-
uv sync --all-extras --dev
173+
uv sync --extra dev --dev
194174
uv pip install flake8
195175
196-
- save_cache:
197-
name: Save cached venv
198-
paths:
199-
- "env/"
200-
key: v2-pypi-py<< parameters.python-version >>-{{ checksum "requirements/prod.txt" }}+{{ checksum "requirements/dev.txt" }}
201-
202176
- run:
203177
name: Install Bittensor
204178
command: |
205179
. .venv/bin/activate
206-
uv sync --all-extras --dev
180+
uv sync --extra dev --dev
207181
208182
- run:
209183
name: Lint with flake8
@@ -235,18 +209,6 @@ jobs:
235209
uv pip install --upgrade coveralls
236210
coveralls --finish --rcfile .coveragerc || echo "Failed to upload coverage"
237211
238-
check-version-updated:
239-
docker:
240-
- image: cimg/python:3.10
241-
steps:
242-
- checkout
243-
244-
- run:
245-
name: Version is updated
246-
command: |
247-
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..master | grep bittensor/__init__.py | wc -l) == 1 ]] && echo "bittensor/__init__.py has changed"
248-
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..master | grep VERSION | wc -l) == 1 ]] && echo "VERSION has changed"
249-
250212
check-changelog-updated:
251213
docker:
252214
- image: cimg/python:3.10
@@ -323,11 +285,6 @@ workflows:
323285

324286
release-branches-requirements:
325287
jobs:
326-
- check-version-updated:
327-
filters:
328-
branches:
329-
only:
330-
- /^(release|hotfix)/.*/
331288
- check-changelog-updated:
332289
filters:
333290
branches:

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: "pip"
4-
directory: ""
5-
file: "requirements/prod.txt"
4+
directory: "/"
65
schedule:
76
interval: "daily"
87
open-pull-requests-limit: 0 # Only security updates will be opened as PRs

.github/workflows/e2e-subtensor-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
uses: astral-sh/setup-uv@v4
9292

9393
- name: install dependencies
94-
run: uv sync --all-extras --dev
94+
run: uv sync --extra dev --dev
9595

9696
- name: Download Cached Docker Image
9797
uses: actions/download-artifact@v4

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## 9.3.1a1 /2025-04-14
4+
5+
## What's Changed
6+
* Release/9.3.0 by @ibraheem-abe in https://github.com/opentensor/bittensor/pull/2805
7+
* Fix for flaky behavior of `test_incentive`, `test_commit_weights` and `test_set_weights` by @basfroman in https://github.com/opentensor/bittensor/pull/2795
8+
* Add `get_next_epoch_start_block` method to Async/Subtensor by @basfroman in https://github.com/opentensor/bittensor/pull/2808
9+
* Adds compatibility for torch 2.6.0+ by @thewhaleking in https://github.com/opentensor/bittensor/pull/2811
10+
* f Update CONTRIBUTING.md by @Hack666r in https://github.com/opentensor/bittensor/pull/2813
11+
* docs: replaced discord link with documentation by @sashaphmn in https://github.com/opentensor/bittensor/pull/2809
12+
* sometimes it's still flaky because the chain returns data with time offset by @basfroman in https://github.com/opentensor/bittensor/pull/2816
13+
* Remove requirements directory by @thewhaleking in https://github.com/opentensor/bittensor/pull/2812
14+
* version in one place by @thewhaleking in https://github.com/opentensor/bittensor/pull/2806
15+
* Update CONTRIBUTING hyperlinks by @thewhaleking in https://github.com/opentensor/bittensor/pull/2820
16+
17+
## New Contributors
18+
* @Hack666r made their first contribution in https://github.com/opentensor/bittensor/pull/2813
19+
20+
**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.3.0...v9.3.1a1
21+
322
## 9.3.0 /2025-04-09
423

524
## What's Changed

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ install:
2121

2222
install-dev:
2323
python3 -m pip install '.[dev]'
24-
25-
install-cubit:
26-
python3 -m pip install '.[cubit]'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Internet-scale Neural Networks <!-- omit in toc -->
1212

13-
[Discord](https://discord.gg/qasY3HA9F9)[Network](https://taostats.io/)[Research](https://bittensor.com/whitepaper)
13+
[Discord](https://discord.gg/qasY3HA9F9)[Network](https://taostats.io/)[Research](https://bittensor.com/whitepaper)[Documentation](https://docs.bittensor.com)
1414

1515
</div>
1616

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

bittensor/core/async_subtensor.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
publish_metadata,
5858
get_metadata,
5959
)
60+
from bittensor.core.extrinsics.asyncex.start_call import start_call_extrinsic
6061
from bittensor.core.extrinsics.asyncex.serving import serve_axon_extrinsic
6162
from bittensor.core.extrinsics.asyncex.staking import (
6263
add_stake_extrinsic,
@@ -3181,7 +3182,7 @@ async def sign_and_send_extrinsic(
31813182
return True, ""
31823183

31833184
if raise_error:
3184-
raise ChainError.from_error(response.error_message)
3185+
raise ChainError.from_error(await response.error_message)
31853186

31863187
return False, format_error_message(await response.error_message)
31873188

@@ -3986,6 +3987,36 @@ async def serve_axon(
39863987
certificate=certificate,
39873988
)
39883989

3990+
async def start_call(
3991+
self,
3992+
wallet: "Wallet",
3993+
netuid: int,
3994+
wait_for_inclusion: bool = True,
3995+
wait_for_finalization: bool = False,
3996+
) -> tuple[bool, str]:
3997+
"""
3998+
Submits a start_call extrinsic to the blockchain, to trigger the start call process for a subnet (used to start a
3999+
new subnet's emission mechanism).
4000+
4001+
Args:
4002+
wallet (Wallet): The wallet used to sign the extrinsic (must be unlocked).
4003+
netuid (int): The UID of the target subnet for which the call is being initiated.
4004+
wait_for_inclusion (bool, optional): Whether to wait for the extrinsic to be included in a block. Defaults to True.
4005+
wait_for_finalization (bool, optional): Whether to wait for finalization of the extrinsic. Defaults to False.
4006+
4007+
Returns:
4008+
Tuple[bool, str]:
4009+
- True and a success message if the extrinsic is successfully submitted or processed.
4010+
- False and an error message if the submission fails or the wallet cannot be unlocked.
4011+
"""
4012+
return await start_call_extrinsic(
4013+
subtensor=self,
4014+
wallet=wallet,
4015+
netuid=netuid,
4016+
wait_for_inclusion=wait_for_inclusion,
4017+
wait_for_finalization=wait_for_finalization,
4018+
)
4019+
39894020
async def swap_stake(
39904021
self,
39914022
wallet: "Wallet",

bittensor/core/chain_data/metagraph_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _chr_str(codes: tuple[int]) -> str:
2525
def process_nested(data: Union[tuple, dict], chr_transform):
2626
"""Processes nested data structures by applying a transformation function to their elements."""
2727
if isinstance(data, (list, tuple)):
28-
if len(data) > 0 and isinstance(data[0], dict):
28+
if len(data) > 0:
2929
return [
3030
{k: chr_transform(v) for k, v in item.items()}
3131
if item is not None

bittensor/core/extrinsics/asyncex/registration.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ async def set_subnet_identity_extrinsic(
498498
},
499499
)
500500

501-
response = await subtensor.substrate.submit_extrinsic(
501+
success, error_message = await subtensor.sign_and_send_extrinsic(
502502
call=call,
503503
wallet=wallet,
504504
wait_for_inclusion=wait_for_inclusion,
@@ -508,14 +508,13 @@ async def set_subnet_identity_extrinsic(
508508
if not wait_for_finalization and not wait_for_inclusion:
509509
return True, f"Identities for subnet {netuid} are sent to the chain."
510510

511-
if await response.is_success:
511+
if success:
512512
logging.success(
513513
f":white_heavy_check_mark: [green]Identities for subnet[/green] [blue]{netuid}[/blue] [green]are set.[/green]"
514514
)
515515
return True, f"Identities for subnet {netuid} are set."
516-
else:
517-
error_message = await response.error_message
518-
logging.error(
519-
f":cross_mark: Failed to set identity for subnet [blue]{netuid}[/blue]: {error_message}"
520-
)
521-
return False, f"Failed to set identity for subnet {netuid}: {error_message}"
516+
517+
logging.error(
518+
f":cross_mark: Failed to set identity for subnet [blue]{netuid}[/blue]: {error_message}"
519+
)
520+
return False, f"Failed to set identity for subnet {netuid}: {error_message}"

0 commit comments

Comments
 (0)