Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
a7338fc
chore: fix typo
socialsister Jul 15, 2025
0bf124f
update `WeightCommitInfo` with `CRV3WeightCommitsV2` (subtensor struct)
Jul 18, 2025
fff4989
improve `get_current_weight_commit_info` calls
Jul 18, 2025
9fa3164
fix e2e test
Jul 18, 2025
0f87b15
fix unit test test
Jul 18, 2025
ae3b8a3
ruff
Jul 18, 2025
9801676
[WIP] Optimisations
thewhaleking Jul 18, 2025
0761f0d
Fixes liquidity_list abysmal performance
thewhaleking Jul 18, 2025
295bdde
Debug
thewhaleking Jul 18, 2025
8c558d1
Flake
thewhaleking Jul 18, 2025
b5ccbef
Fixed unit tests
thewhaleking Jul 18, 2025
01cc4ef
add legacy methods
Jul 18, 2025
b5e16de
fix SubtensorApi
Jul 18, 2025
58746d7
make 2 methods, fix tests
Jul 18, 2025
b16a56a
Fixes (relies on https://github.com/opentensor/async-substrate-interf…
thewhaleking Jul 18, 2025
5cb6623
Apply to async aswell
thewhaleking Jul 18, 2025
a3502ba
Remove unnecessary .value call
thewhaleking Jul 18, 2025
0bb4d19
add `deprecated_message` to `get_current_weight_commit_info` method
Jul 18, 2025
8f687b8
Will rely on changes in 1.4.2
thewhaleking Jul 18, 2025
ccb83cb
add `get_stake_weight`
Jul 18, 2025
29fc311
add unit tests
Jul 18, 2025
e75bbe1
ruff
Jul 18, 2025
5a50b1a
fix SubtensorApi
Jul 18, 2025
0aa4e76
Merge pull request #2978 from opentensor/fix/roman/fix-crv3-tests-aft…
basfroman Jul 18, 2025
0178fbb
Merge branch 'staging' into feat/roman/add-get-stake-weight
Jul 18, 2025
2e09cfe
add trigger
Jul 18, 2025
33ac62b
make test broken
Jul 18, 2025
18a8b33
add username
Jul 18, 2025
70fa483
fix
Jul 18, 2025
612bb66
improve nightly workflow
Jul 18, 2025
3e60e80
fix test ⚒️
Jul 18, 2025
48edce7
bumping `tj-actions/changed-files` version
Jul 18, 2025
d642ed1
add `workflow_dispatch` checker
Jul 18, 2025
b9ca769
Merge pull request #2987 from opentensor/feat/roman/add-webhook-for-f…
basfroman Jul 18, 2025
32ba782
add `workflow_dispatch` checker
Jul 19, 2025
75f6180
Merge pull request #2988 from opentensor/fix/roman/fix-liquidity-e2e-…
basfroman Jul 19, 2025
345342b
improve logic
Jul 19, 2025
4fcdfd9
Merge pull request #2989 from opentensor/tests/roman/improve-nightly
basfroman Jul 19, 2025
16fd715
fix id for job step
Jul 19, 2025
d27edf8
Merge pull request #2990 from opentensor/test/roman/improve-nightly-2
basfroman Jul 19, 2025
e0cb255
Merge pull request #2985 from opentensor/feat/roman/add-get-stake-weight
basfroman Jul 21, 2025
dda1af5
Two errors can actually be raised for the price fetching: SubstrateRe…
thewhaleking Jul 22, 2025
eb7dd6c
Merge pull request #2991 from opentensor/fix/thewhaleking/exception-h…
thewhaleking Jul 22, 2025
6e76b64
Merge pull request #2969 from socialsister/staging
basfroman Jul 22, 2025
7f80ab0
Merge branch 'staging' into fix/thewhaleking/optimisations
thewhaleking Jul 23, 2025
4974adf
Fix test
thewhaleking Jul 23, 2025
a71cf44
Merge pull request #2980 from opentensor/fix/thewhaleking/optimisations
basfroman Jul 24, 2025
aa1cf11
Transfers.
thewhaleking Jul 24, 2025
c27082e
Missed kwarg
thewhaleking Jul 24, 2025
c60c486
Missed kwarg
thewhaleking Jul 24, 2025
e6e987f
Oepsie
thewhaleking Jul 24, 2025
c81c030
Tests
thewhaleking Jul 24, 2025
b3eba69
Updated arg order
thewhaleking Jul 25, 2025
0e93f2a
Added e2e tests
thewhaleking Jul 25, 2025
f404ea5
Mypy
thewhaleking Jul 25, 2025
10ab0d5
Helper function
thewhaleking Jul 25, 2025
79e6639
Merge pull request #2993 from opentensor/fix/thewhaleking/transfers
thewhaleking Jul 25, 2025
3c15308
remove ownership check
Jul 28, 2025
9a8c06b
remove test
Jul 28, 2025
c40da87
Merge pull request #2996 from opentensor/fix/roman/remove-ownership-c…
basfroman Jul 28, 2025
4d103b3
add hotkey in CRV3
Jul 30, 2025
7ee70b0
fix unit tests
Jul 30, 2025
3e2f098
Missed await
thewhaleking Aug 4, 2025
b028bc4
Change order to avoid making a call twice.
thewhaleking Aug 4, 2025
85d2959
Merge pull request #3002 from opentensor/fix/thewhaleking/missed-await
thewhaleking Aug 4, 2025
63995b1
chore: fix typo
thewhaleking Jul 18, 2025
12848aa
Merge pull request #3001 from lechpzn/1
thewhaleking Aug 5, 2025
9cf66f8
Adds note for installing on macOS
thewhaleking Aug 5, 2025
58a8161
Added bit about bittensor certifi
thewhaleking Aug 5, 2025
bd3f57b
Merge pull request #3004 from opentensor/feat/thewhaleking/note-for-m…
thewhaleking Aug 5, 2025
0c65756
Merge branch 'staging' into feat/roman/add-new-crv3-logic
Aug 6, 2025
701ebff
update SubtensorApi
Aug 7, 2025
c059e0b
update sync extrinsic
Aug 7, 2025
1ab7491
update async extrinsic
Aug 7, 2025
d3ed298
update e2e test
Aug 7, 2025
e90c412
fix unit tests
Aug 7, 2025
e30dbc5
update requirements
Aug 7, 2025
fc47323
Bump bittensor-wallet version so people are less likely to install th…
thewhaleking Aug 7, 2025
198d5ab
Improves the error formatter for instances where the docs are a strin…
thewhaleking Aug 7, 2025
0e4ef47
Merge pull request #3005 from opentensor/chore/thewhaleking/bump-bt-w…
thewhaleking Aug 7, 2025
e51ad47
Merge pull request #3006 from opentensor/fix/thewhaleking/error-forma…
thewhaleking Aug 7, 2025
c5b5e41
Merge branch 'staging' into feat/roman/add-new-crv3-logic
basfroman Aug 8, 2025
4a14322
`LoggingMachine` initialization updated to explicitly call both paren…
Aug 8, 2025
639cb66
fix uv version
Aug 8, 2025
1ed62d3
Merge pull request #3008 from opentensor/fix/roman/add-correct-parren…
basfroman Aug 9, 2025
ec65276
Fixed moving_price conversion from I96F32 to float
mcjkula Aug 10, 2025
11df0e8
Merge pull request #3010 from mcjkula/fix/moving-price-decoding-in-dy…
thewhaleking Aug 11, 2025
81af4fd
uv is broken for 0.8 < python 3.10 until 0.8.8 (see https://github.co…
thewhaleking Aug 11, 2025
ee0f422
Merge pull request #2999 from opentensor/feat/roman/add-new-crv3-logic
thewhaleking Aug 11, 2025
35a2779
Merge branch 'staging' into fix/thewhaleking/fix-test-breakages
thewhaleking Aug 11, 2025
38e0943
Merge pull request #3011 from opentensor/fix/thewhaleking/fix-test-br…
thewhaleking Aug 11, 2025
437a9b8
Update changelog + version
thewhaleking Aug 11, 2025
a605448
Merge pull request #3012 from opentensor/changelog/9.9.0
thewhaleking Aug 11, 2025
6843a1f
Major version locks drand
thewhaleking Aug 11, 2025
245c64c
Merge pull request #3014 from opentensor/fix/thewhaleking/drand-major…
thewhaleking Aug 11, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/changelog-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v42
- uses: tj-actions/changed-files@v46
id: changed
- name: Ensure CHANGELOG.md updated
if: contains(steps.changed.outputs.all_changed_files, 'CHANGELOG.md') == false
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/flake8-and-mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install uv
# needed for Python 3.9 compatibility
python -m pip install uv>=0.8.8
python -m uv sync --extra dev --active

- name: Flake8
Expand Down
92 changes: 74 additions & 18 deletions .github/workflows/nightly-e2e-tests-subtensor-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,29 @@ jobs:
with:
name: subtensor-localnet-devnet-ready
path: subtensor-localnet-devnet-ready.tar

# Determine the day for non-fast-blocks run
check-if-saturday:
check-if-non-fast-blocks-run:
runs-on: ubuntu-latest
outputs:
is-saturday: ${{ steps.check.outputs.is-saturday }}
non-fast-blocks-run: ${{ steps.check.outputs.non-fast-blocks-run }}
steps:
- id: check
run: |
day=$(date -u +%u)
echo "Today is weekday $day"
if [ "$day" -ne 6 ]; then
echo "⏭️ Skipping: not Saturday"
echo "is-saturday=false" >> "$GITHUB_OUTPUT"
exit 0
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "🔁 Manual trigger detected. Forcing non-fast-blocks-run=true"
echo "non-fast-blocks-run=true" >> "$GITHUB_OUTPUT"
else
day=$(date -u +%u)
echo "Today is weekday $day"
if [ "$day" -ne 6 ]; then
echo "⏭️ Skipping: not Saturday"
echo "non-fast-blocks-run=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "✅ It is Saturday"
echo "non-fast-blocks-run=true" >> "$GITHUB_OUTPUT"
fi
echo "is-saturday=true"
echo "is-saturday=true" >> "$GITHUB_OUTPUT"

# Daily run of fast-blocks tests from `bittensor:master` based on `subtensor:main docker` image
run-fast-blocks-e2e-test-master:
Expand All @@ -102,6 +108,9 @@ jobs:
- pull-docker-images
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
failed: ${{ steps.test-failed.outputs.failed }}

strategy:
fail-fast: false # Allow other matrix jobs to run even if this job fails
max-parallel: 32 # Set the maximum number of parallel jobs (same as we have cores in ubuntu-latest runner)
Expand Down Expand Up @@ -136,22 +145,27 @@ jobs:
run: docker load -i subtensor-localnet-main.tar

- name: Run tests with retry
id: test-failed
env:
FAST_BLOCKS: "1"
LOCALNET_IMAGE_NAME: "ghcr.io/opentensor/subtensor-localnet:main"
run: |
set +e
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
echo "::group::🔁 Test attempt $i"
uv run pytest ${{ matrix.test-file }} -s
status=$?
if [ $status -eq 0 ]; then
echo "✅ Tests passed on attempt $i"
echo "::endgroup::"
echo "failed=false" >> "$GITHUB_OUTPUT"
break
else
echo "❌ Tests failed on attempt $i"
echo "::endgroup::"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
echo "failed=true" >> "$GITHUB_OUTPUT"
exit 1
fi
echo "Retrying..."
Expand All @@ -167,6 +181,9 @@ jobs:
- pull-docker-images
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
failed: ${{ steps.test-failed.outputs.failed }}

strategy:
fail-fast: false # Allow other matrix jobs to run even if this job fails
max-parallel: 32 # Set the maximum number of parallel jobs (same as we have cores in ubuntu-latest runner)
Expand Down Expand Up @@ -201,22 +218,27 @@ jobs:
run: docker load -i subtensor-localnet-devnet-ready.tar

- name: Run tests with retry
id: test-failed
env:
FAST_BLOCKS: "1"
LOCALNET_IMAGE_NAME: "ghcr.io/opentensor/subtensor-localnet:devnet-ready"
run: |
set +e
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
echo "::group::🔁 Test attempt $i"
uv run pytest ${{ matrix.test-file }} -s
status=$?
if [ $status -eq 0 ]; then
echo "✅ Tests passed on attempt $i"
echo "::endgroup::"
echo "failed=false" >> "$GITHUB_OUTPUT"
break
else
echo "❌ Tests failed on attempt $i"
echo "::endgroup::"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
echo "failed=true" >> "$GITHUB_OUTPUT"
exit 1
fi
echo "Retrying..."
Expand All @@ -226,14 +248,16 @@ jobs:

# Saturday run of non-fast-blocks tests from `bittensor:master` based on `subtensor:main` docker image
run-non-fast-blocks-e2e-test-master:
if: needs.check-if-saturday.outputs.is-saturday == 'true'
if: needs.check-if-non-fast-blocks-run.outputs.non-fast-blocks-run == 'true'
name: "NFB master: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}"
needs:
- check-if-saturday
- check-if-non-fast-blocks-run
- find-tests
- pull-docker-images
runs-on: ubuntu-latest
timeout-minutes: 1440
outputs:
failed: ${{ steps.test-failed.outputs.failed }}

strategy:
fail-fast: false # Allow other matrix jobs to run even if this job fails
Expand Down Expand Up @@ -270,22 +294,27 @@ jobs:
run: docker load -i subtensor-localnet-main.tar

- name: Run patched E2E tests
id: test-failed
env:
FAST_BLOCKS: "0"
LOCALNET_IMAGE_NAME: "ghcr.io/opentensor/subtensor-localnet:main"
run: |
set +e
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
echo "::group::🔁 Test attempt $i"
uv run pytest ${{ matrix.test-file }} -s
status=$?
if [ $status -eq 0 ]; then
echo "✅ Tests passed on attempt $i"
echo "::endgroup::"
echo "failed=false" >> "$GITHUB_OUTPUT"
break
else
echo "❌ Tests failed on attempt $i"
echo "::endgroup::"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
echo "failed=true" >> "$GITHUB_OUTPUT"
exit 1
fi
echo "Retrying..."
Expand All @@ -295,14 +324,16 @@ jobs:

# Saturday run of non-fast-blocks tests from `bittensor:staging` based on `subtensor:devnet-ready` docker image
run-non-fast-blocks-e2e-test-staging:
if: needs.check-if-saturday.outputs.is-saturday == 'true'
if: needs.check-if-non-fast-blocks-run.outputs.non-fast-blocks-run == 'true'
name: "NFB staging: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}"
needs:
- check-if-saturday
- check-if-non-fast-blocks-run
- find-tests
- pull-docker-images
runs-on: ubuntu-latest
timeout-minutes: 1440
outputs:
failed: ${{ steps.test-failed.outputs.failed }}

strategy:
fail-fast: false # Allow other matrix jobs to run even if this job fails
Expand Down Expand Up @@ -339,25 +370,50 @@ jobs:
run: docker load -i subtensor-localnet-devnet-ready.tar

- name: Run patched E2E tests
id: test-failed
env:
FAST_BLOCKS: "0"
LOCALNET_IMAGE_NAME: "ghcr.io/opentensor/subtensor-localnet:devnet-ready"
run: |
set +e
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
echo "::group::🔁 Test attempt $i"
uv run pytest ${{ matrix.test-file }} -s
status=$?
if [ $status -eq 0 ]; then
echo "✅ Tests passed on attempt $i"
echo "::endgroup::"
echo "failed=false" >> "$GITHUB_OUTPUT"
break
else
echo "❌ Tests failed on attempt $i"
echo "::endgroup::"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
echo "failed=true" >> "$GITHUB_OUTPUT"
exit 1
fi
echo "Retrying..."
sleep 5
fi
done

# Send centralized Discord failure notification
notify-on-failure:
needs:
- run-fast-blocks-e2e-test-master
- run-fast-blocks-e2e-test-staging
- run-non-fast-blocks-e2e-test-master
- run-non-fast-blocks-e2e-test-staging
if: |
needs.run-fast-blocks-e2e-test-master.outputs.failed == 'true' ||
needs.run-fast-blocks-e2e-test-staging.outputs.failed == 'true' ||
needs.run-non-fast-blocks-e2e-test-master.outputs.failed == 'true' ||
needs.run-non-fast-blocks-e2e-test-staging.outputs.failed == 'true'
runs-on: ubuntu-latest
steps:
- name: Send centralized Discord failure notification
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"username\": \"Nightly CI\", \"content\": \"❌ Nightly E2E tests failed. Check run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>\"}" \
"${{ secrets.NIGHTLY_WEBHOOK_URL }}"
3 changes: 2 additions & 1 deletion .github/workflows/unit-and-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install uv
# needed for Python 3.9 compatibility
python -m pip install uv>=0.8.8
python -m uv sync --extra dev --active

- name: Unit tests
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 9.9.0 /2025-08-11

## What's Changed
* Fix crv3 tests after devnet-ready get `CRV3WeightCommitsV2` by @basfroman in https://github.com/opentensor/bittensor/pull/2978
* Add webhook for failed nightly tests by @basfroman in https://github.com/opentensor/bittensor/pull/2987
* Fix liquidity test (non-fast-blocks node) by @basfroman in https://github.com/opentensor/bittensor/pull/2988
* improve nightly logic by @basfroman in https://github.com/opentensor/bittensor/pull/2989
* improve nightly 2 by @basfroman in https://github.com/opentensor/bittensor/pull/2990
* Add `get_stake_weight` methods by @basfroman in https://github.com/opentensor/bittensor/pull/2985
* Handles both exceptions for Swap pallet fetching by @thewhaleking in https://github.com/opentensor/bittensor/pull/2991
* chore: fix typo by @socialsister in https://github.com/opentensor/bittensor/pull/2969
* optimisations mostly related to liquidity_list by @thewhaleking in https://github.com/opentensor/bittensor/pull/2980
* Transfers improvements by @thewhaleking in https://github.com/opentensor/bittensor/pull/2993
* Remove ownership check in `transfer_stake_extrinsic` and `swap_stake_extrinsic` by @basfroman in https://github.com/opentensor/bittensor/pull/2996
* Missed await by @thewhaleking in https://github.com/opentensor/bittensor/pull/3002
* chore: fix typo by @lechpzn in https://github.com/opentensor/bittensor/pull/3001
* Adds note for installing on macOS by @thewhaleking in https://github.com/opentensor/bittensor/pull/3004
* Bump bittensor-wallet version by @thewhaleking in https://github.com/opentensor/bittensor/pull/3005
* Format Error with string docs by @thewhaleking in https://github.com/opentensor/bittensor/pull/3006
* `LoggingMachine` initialization updated to explicitly call both parent constructors by @basfroman in https://github.com/opentensor/bittensor/pull/3008
* Fixed `moving_price` conversion from `I96F32` to float by @mcjkula in https://github.com/opentensor/bittensor/pull/3010
* Add new CRv4 logic by @basfroman in https://github.com/opentensor/bittensor/pull/2999
* UV Fix by @thewhaleking in https://github.com/opentensor/bittensor/pull/3011

## New Contributors
* @socialsister made their first contribution in https://github.com/opentensor/bittensor/pull/2969
* @lechpzn made their first contribution in https://github.com/opentensor/bittensor/pull/3001
* @mcjkula made their first contribution in https://github.com/opentensor/bittensor/pull/3010

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.8.3...v9.9.0

## 9.8.3 /2025-07-18
* improve make file by @basfroman in https://github.com/opentensor/bittensor/pull/2965
* Move all workflows from `app.circleci.com` to `GH actions` by @basfroman in https://github.com/opentensor/bittensor/pull/2970
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ python3 -m pip install --upgrade bittensor

## Install on macOS and Linux

### Note for macOS users
The macOS preinstalled CPython installation is compiled with LibreSSL instead of OpenSSL. There are a number
of issues with LibreSSL, and as such is not fully supported by the libraries used by bittensor. Thus we highly recommend, if
you are using a Mac, to first install Python from [Homebrew](https://brew.sh/). Additionally, the Rust FFI bindings
[if installing from precompiled wheels (default)] require the Homebrew-installed OpenSSL pacakge. If you choose to use
the preinstalled Python version from macOS, things may not work completely.

### Installation
You can install Bittensor SDK on your local machine in either of the following ways. **Make sure you verify your installation after you install**:
- [Install using a Bash command](#install-using-a-bash-command).
- [Install using `pip3 install`](#install-using-pip3-install)
Expand Down Expand Up @@ -158,6 +166,13 @@ You can install using any of the below options:
1. Install `cubit` first. See the [Install](https://github.com/opentensor/cubit?tab=readme-ov-file#install) section. **Only Python 3.9 and 3.10 versions are supported**.
2. Then install SDK with `pip install bittensor`.


### Troubleshooting
#### SSL: CERTIFICATE_VERIFY_FAILED

If you are encountering a `[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate`
error, use the command `python -m bittensor certifi` which will update your local SSL certificates.

---

## Install on Windows
Expand Down
Loading
Loading