Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
323 commits
Select commit Hold shift + click to select a range
4666407
fix: $BASH_ENV loading issue
defitricks Apr 27, 2025
543bff3
Merge branch 'staging' into patch-1
basfroman Apr 28, 2025
0402682
Merge branch 'staging' into master
basfroman Apr 28, 2025
c691fa0
Merge pull request #2848 from leopardracer/master
basfroman Apr 28, 2025
689ec43
Merge branch 'staging' into patch-1
basfroman Apr 28, 2025
979e3d9
Merge branch 'staging' into master
basfroman Apr 28, 2025
f4f9181
Merge branch 'staging' into feat/roman/bittensor-drand
basfroman Apr 28, 2025
456acd4
let users use `int` indexes, not only enum
Apr 28, 2025
27f9c4e
add SelectiveMetagraphIndexes into easy_imports
Apr 28, 2025
0a2c41a
improve tests
Apr 28, 2025
1e5e6cb
Merge pull request #2835 from opentensor/feat/roman/bittensor-drand
basfroman Apr 28, 2025
a754b3b
Merge branch 'staging' into feat/roman/extend-selective-metagraph-logic
basfroman Apr 28, 2025
fe6029c
Merge pull request #2852 from opentensor/feat/roman/extend-selective-…
basfroman Apr 28, 2025
4d908cc
Merge branch 'staging' into patch-1
thewhaleking Apr 29, 2025
f3af414
Merge pull request #2851 from defitricks/patch-1
thewhaleking Apr 29, 2025
90844df
Merge branch 'staging' into master
thewhaleking Apr 29, 2025
43226b5
Merge pull request #2850 from PixelPil0t1/master
thewhaleking Apr 29, 2025
b0cf115
add new methods to subtensor
Apr 29, 2025
8403fd9
add new methods to async subtensor
Apr 29, 2025
97c522e
add tests for subtensor
Apr 29, 2025
7288c8f
add tests for async subtensor
Apr 29, 2025
62b2aa7
Merge pull request #2854 from opentensor/feat/roman/add-methods
basfroman Apr 29, 2025
59d52ff
cleanup `bittensor/core/extrinsics/utils.py`
May 1, 2025
7206524
improve `bittensor.utils.format_error_message`
May 1, 2025
9861b11
remove unnecessary tests and add new ones
May 1, 2025
7fbfe8f
fix tests
May 1, 2025
6dbf118
refactoring in subtensors
May 1, 2025
43ffc7a
improve `async/subtensor.sign_and_send_extrinsic`
May 1, 2025
4d2450b
add extrinsics helper function `convert_and_normalize_weights_and_uids`
May 1, 2025
463dd2a
use `convert_and_normalize_weights_and_uids` in set_weights.py
May 1, 2025
58f3f15
use `convert_and_normalize_weights_and_uids` in weights.py
May 1, 2025
e1543db
update commit_reveal extrinsics
May 1, 2025
dbc23e3
update `bittensor.core.subtensor.Subtensor.set_weights` call
May 1, 2025
c88822f
update test related with `bittensor.core.subtensor.Subtensor.set_weig…
May 1, 2025
1b98ea0
increase set_weights' period until 16 to avoid flaky behavior
May 1, 2025
b0e5238
fix tests
May 1, 2025
e32638c
fix commit reveal unit tests
May 1, 2025
71842ec
set default period as None. Better to control this argument via each …
May 1, 2025
7225ddc
Add logic to control running localnet mode (non-/fast-blocks) to run …
May 1, 2025
6aeadae
update `commit_weights` extrinsics calls
May 1, 2025
fa9139b
update `commit_weights` extrinsics
May 1, 2025
cf2a8cc
fix fast_blocks logic in conftest.py
May 1, 2025
1751d48
fix wait_for_block logic in subtensors
May 1, 2025
e8ab07b
update docstrings
May 1, 2025
0213d03
keep fast-blocks mode by default
May 1, 2025
73e9fb2
update `reveal_weights_extrinsic` for both subtensors
May 1, 2025
c8e7e99
update `Subtensor.reveal_weights` extrinsic call
May 1, 2025
422eddf
fix related unit tests
May 1, 2025
662767c
fmt
May 1, 2025
84e7108
bittensor.core.extrinsics.move_stake.transfer_stake_extrinsic
May 1, 2025
81a5669
bittensor.core.subtensor.Subtensor.transfer_stake
May 1, 2025
6dc3e0e
bittensor.core.extrinsics.move_stake.swap_stake_extrinsic
May 1, 2025
5ab22df
bittensor.core.subtensor.Subtensor.swap_stake
May 1, 2025
9050c20
fix related tests
May 1, 2025
0f56efc
bittensor.core.extrinsics.move_stake.move_stake_extrinsic
May 1, 2025
474b2ee
bittensor.core.subtensor.Subtensor.move_stake
May 1, 2025
d549aa2
bittensor/core/extrinsics/asyncex/move_stake.py
May 1, 2025
adeda3f
related changes in bittensor/core/async_subtensor.py
May 1, 2025
c73c4ac
Update bittensor/utils/__init__.py
basfroman May 1, 2025
080e418
Merge pull request #2856 from opentensor/feat/roman/cleanup
basfroman May 1, 2025
cdb8bb8
Merge branch 'staging' into feat/roman/add-validity-period-to-extrins…
May 1, 2025
c0eebe0
update `bittensor/core/extrinsics/registration.py`
May 1, 2025
54e0261
update `bittensor/core/extrinsics/asyncex/registration.py`
May 1, 2025
04cc497
update `bittensor/core/async_subtensor.py`
May 1, 2025
f131a7c
update `bittensor/core/subtensor.py`
May 1, 2025
0e743f7
fix related tests
May 1, 2025
904b4cd
optimize imports in utils
May 1, 2025
f813b9c
update `bittensor/core/extrinsics/root.py`
May 1, 2025
7fe6084
update `bittensor/core/extrinsics/asyncex/root.py`
May 1, 2025
1aed640
refactoring related with `bittensor.utils.weight_utils.convert_and_no…
May 1, 2025
fb050f8
update extrinsics related calls
May 1, 2025
d7b156f
fix related tests
May 1, 2025
dba73aa
update `bittensor/core/extrinsics/serving.py`
May 2, 2025
904f9b2
update `bittensor/core/extrinsics/asyncex/serving.py`
May 2, 2025
9a27b6a
related subtensors updates
May 2, 2025
e5d2264
fix tests
May 2, 2025
a36ecb1
update `bittensor/core/extrinsics/asyncex/weights.py`
May 2, 2025
a2418b1
update `bittensor/core/extrinsics/set_weights.py`
May 2, 2025
cc5344c
rename `convert_uids_and_weights`
May 2, 2025
ca92a81
refactoring
May 2, 2025
3ee11a6
improve `sign_and_send_extrinsic` calls
May 2, 2025
f34befd
fix tests
May 2, 2025
42341a1
opps with set_weights (fixed) + tests
May 2, 2025
45d4bec
refactor
May 2, 2025
7d508c6
update `bittensor/core/extrinsics/asyncex/staking.py`
May 2, 2025
3e9db46
update `bittensor/core/extrinsics/staking.py`
May 2, 2025
93c051e
update `bittensor.core.extrinsics.staking.add_stake_multiple_extrinsic`
May 2, 2025
76e8907
update `bittensor.core.extrinsics.asyncex.staking.add_stake_multiple_…
May 2, 2025
268f95c
fix tests
May 2, 2025
6a872d3
update subtensor calls
May 2, 2025
eff87f2
refactoring
May 2, 2025
838c9bc
update start_call extrinsics
May 2, 2025
179b3dd
update subtensors start_call extrinsics
May 2, 2025
76384c9
fix tests
May 2, 2025
30953e1
extrinsics `increase_take_extrinsic` and `decrease_take_extrinsic`
May 2, 2025
9563c04
related subtensors calls
May 2, 2025
363ba28
refactoring
May 2, 2025
d1f0a90
transfer extrinsics
May 2, 2025
ac9685c
transfer extrinsics calls in subtensors
May 2, 2025
770a50a
fixed tests
May 2, 2025
8896702
replace error + formatting error for staking
May 2, 2025
de076c9
update unstaking extrinsics
May 2, 2025
1bd2e4e
update subtensor unstaking calls
May 2, 2025
ef80b8b
fix related tests
May 2, 2025
bf7c9bb
del unused imports
May 2, 2025
d7a6ef1
fix a bunch of unit test's inner calls
May 2, 2025
e915a3f
oops with `set_children` -> fixed
May 2, 2025
7fef30f
ruff + mypy + flake8
May 2, 2025
caf8c70
optimization + period for test
May 2, 2025
a752e50
Update bittensor/core/async_subtensor.py
thewhaleking May 2, 2025
6bb8954
Update bittensor/core/async_subtensor.py
thewhaleking May 2, 2025
1fc275a
Update bittensor/core/async_subtensor.py
thewhaleking May 2, 2025
12323dc
Update bittensor/core/async_subtensor.py
thewhaleking May 2, 2025
00f0b69
Update bittensor/utils/weight_utils.py
thewhaleking May 2, 2025
2235197
Update bittensor/utils/weight_utils.py
thewhaleking May 2, 2025
4c032d2
Update tests/e2e_tests/test_commit_weights.py
thewhaleking May 2, 2025
cb7b4d0
Update tests/e2e_tests/test_commit_weights.py
thewhaleking May 2, 2025
eb4d3d6
Update tests/e2e_tests/conftest.py
thewhaleking May 2, 2025
3f0b2e0
Update bittensor/core/async_subtensor.py
thewhaleking May 2, 2025
a2cc42b
Update bittensor/core/extrinsics/asyncex/weights.py
thewhaleking May 2, 2025
a31eca7
Update bittensor/core/extrinsics/root.py
thewhaleking May 2, 2025
81b7575
Update bittensor/core/extrinsics/root.py
thewhaleking May 2, 2025
8000b16
initial
May 2, 2025
65e4f12
Update bittensor/core/extrinsics/staking.py
thewhaleking May 2, 2025
f02cd52
Update bittensor/core/extrinsics/take.py
thewhaleking May 2, 2025
caba14a
Update bittensor/core/subtensor.py
thewhaleking May 2, 2025
aefb385
Update bittensor/core/subtensor.py
thewhaleking May 2, 2025
72ac8a4
Update bittensor/core/subtensor.py
thewhaleking May 2, 2025
ce0d97f
Update bittensor/core/subtensor.py
thewhaleking May 2, 2025
a6a6a13
Update bittensor/core/subtensor.py
thewhaleking May 2, 2025
05e0fc5
add TODO
May 2, 2025
f1e00ba
add cron run
May 2, 2025
d50d470
PST
May 2, 2025
c754b68
Merge pull request #2857 from opentensor/feat/roman/add-period-to-ext…
basfroman May 2, 2025
f2da2be
Merge branch 'staging' into feat/roman/add-nightly-e2e-tests-run
basfroman May 2, 2025
0f4db69
Merge pull request #2858 from opentensor/feat/roman/add-nightly-e2e-t…
basfroman May 2, 2025
090a165
Merge branch 'staging' into fix/zyzniewski/unittests_warnings
basfroman May 2, 2025
cbf3173
period=16 for fast blocks test
May 2, 2025
4251e3e
ruff :)
May 2, 2025
570b982
proper test
May 2, 2025
16caf75
Merge branch 'refs/heads/staging' into feat/roman/subtensor-api
May 2, 2025
8621ede
add sub-package
May 2, 2025
36c447f
add sub-classes
May 2, 2025
0068f2a
add `utils.add_classic_fields`
May 2, 2025
66ccb7d
ruff
May 2, 2025
f46a249
to be consistent
May 2, 2025
745a126
to be consistent + setter
May 2, 2025
6595299
initialize for async instance
May 2, 2025
62ebe3a
add compatability tests
May 2, 2025
23a862f
one more compatability test
May 2, 2025
8f9623e
fix async instance `initialize`
May 2, 2025
73554af
Merge pull request #2859 from opentensor/fix/roman/increase-period-fo…
basfroman May 2, 2025
ef86d13
Merge branch 'staging' into fix/zyzniewski/unittests_warnings
basfroman May 2, 2025
ff0ddf5
rename argument
May 2, 2025
d08bcf7
add `build-patched-image` and `cron-e2e-test-with-non-fast-block`
May 3, 2025
d9da5c8
improve logic
May 3, 2025
624fa59
add `NFB` prefix to non-fast-blocks based tests
May 3, 2025
de3b8ce
test
May 3, 2025
2c86707
one more
May 3, 2025
4748ede
real test
May 3, 2025
ac174d1
Merge pull request #2774 from opentensor/fix/zyzniewski/unittests_war…
basfroman May 5, 2025
68c3472
rename argument legacy_methods
May 5, 2025
ad63f95
update workflow
May 5, 2025
f42b945
update conftest
May 5, 2025
a63d38a
add is_fast_block() method
May 5, 2025
a654105
ruff
May 5, 2025
b93cffa
Update README.md
gap-editor May 5, 2025
1fc420c
improve `tests.e2e_tests.utils.e2e_test_utils.wait_to_start_call`
May 5, 2025
ae3c886
Update tests to be compatible with non-/fast-blocks localnet nodes
May 5, 2025
88e86d0
Merge branch 'staging' into feat/roman/add-non-fast-block-tests-each-…
May 5, 2025
f067275
fix FAST_BLOCKS=0 for non-fast-blocks docker image
May 5, 2025
a9e4da2
ruff + fix typos
May 5, 2025
448ba63
temporary python-version ["3.12"] only + fix bugs
May 5, 2025
9f11505
fix
May 5, 2025
dbf506a
ruff
May 5, 2025
1adaa20
all python-version back
May 5, 2025
370e0a0
add logging to wait_to_start_call
May 6, 2025
6667aec
make `test_delegates` compatible with both modes
May 6, 2025
6b4dbf4
update `test_hotkeys.py`
May 6, 2025
2f4a019
Merge branch 'staging' into patch-1
basfroman May 6, 2025
8f01580
Merge pull request #2861 from gap-editor/patch-1
thewhaleking May 6, 2025
a39f63a
Merge branch 'staging' into feat/roman/add-non-fast-block-tests-each-…
basfroman May 6, 2025
e85e269
improve subtensors
May 6, 2025
b3c7159
Update SubtensorApi
May 6, 2025
329ce85
fix tests
May 6, 2025
b470d78
update docstrings, fix bug
May 6, 2025
04d4c42
move add_args
May 6, 2025
58a8700
Merge branch 'staging' into feat/roman/subtensor-api
basfroman May 6, 2025
2093abf
fix docstrings
May 6, 2025
bc9ec3e
Merge remote-tracking branch 'origin/feat/roman/subtensor-api' into f…
May 6, 2025
32c94a5
trigger
May 7, 2025
a6c301a
temp run 2 tests for debug
May 7, 2025
45d62db
add logging after tests
May 7, 2025
6b442a2
add logging after tests
May 7, 2025
af4be54
fix
May 7, 2025
5b05f4d
Update bittensor/core/subtensor.py
basfroman May 7, 2025
d0243e4
Update bittensor/core/subtensor_api/__init__.py
basfroman May 7, 2025
6a255d7
Update bittensor/core/async_subtensor.py
basfroman May 7, 2025
4ad2552
Adds `__all__` to easy_imports.py to get rid of all the #noqa stuff
thewhaleking May 7, 2025
0e1ccbf
fix
May 7, 2025
afb5f3d
bumping version
May 7, 2025
ff9c533
checker
May 7, 2025
b83945d
Missed some
thewhaleking May 7, 2025
fd22870
Merge pull request #2862 from opentensor/feat/roman/subtensor-api
basfroman May 7, 2025
a41aad7
Merge branch 'staging' into fix/thewhaleking/add-all-easy-imports
basfroman May 7, 2025
0bb6682
Added test
thewhaleking May 7, 2025
3cb9908
Merge remote-tracking branch 'origin/fix/thewhaleking/add-all-easy-im…
thewhaleking May 7, 2025
db58ca2
Removed items.
thewhaleking May 7, 2025
69b55ec
Removed more items.
thewhaleking May 7, 2025
b9ca6d6
rename class
May 7, 2025
480045e
rename import
May 7, 2025
1c93f16
fix tests
May 7, 2025
d0197d8
Merge pull request #2863 from opentensor/fix/thewhaleking/add-all-eas…
basfroman May 7, 2025
bf018e6
Merge branch 'staging' into fix/roman/stakes-to-staking
basfroman May 7, 2025
0e55d3a
Merge pull request #2864 from opentensor/fix/roman/stakes-to-staking
basfroman May 7, 2025
405236b
Merge branch 'staging' into feat/roman/add-non-fast-block-tests-each-…
May 7, 2025
3e7ea6b
improve get_next_epoch_start_block
May 8, 2025
29736b0
fix test
May 8, 2025
3d17182
fix dead link
GarmashAlex May 9, 2025
1d6b9db
Merge branch 'staging' into hpp1
basfroman May 9, 2025
f6aa766
Merge pull request #2865 from opentensor/fix/roman/get_next_epoch_sta…
basfroman May 9, 2025
2d04c39
Update contrib/CONTRIBUTING.md
GarmashAlex May 9, 2025
de54dea
Update contrib/CONTRIBUTING.md
GarmashAlex May 9, 2025
c663cf1
Merge branch 'staging' into hpp1
basfroman May 9, 2025
55ab373
Merge pull request #2866 from GarmashAlex/hpp1
basfroman May 9, 2025
a82606b
fix `tests/e2e_tests/test_hotkeys.py`
May 9, 2025
ab5e594
fix `tests.e2e_tests.test_staking.test_single_operation`
May 9, 2025
6d49fa3
fix unit tests
May 9, 2025
58a41b7
adapted `tests.e2e_tests.test_staking.test_transfer_stake` for both mods
May 9, 2025
e26d787
adapted `tests.e2e_tests.test_staking.test_transfer_stake` for both mods
May 11, 2025
b774b41
Merge branch 'staging' into feat/roman/add-non-fast-block-tests-each-…
May 11, 2025
c6f4c58
restore workflow to run all tests
May 11, 2025
c075065
add all supported wallets for tests
May 11, 2025
299ed91
run all tests without cron
May 11, 2025
6669060
run all tests without cron
May 11, 2025
f899c20
add condition
May 11, 2025
ef2edcf
add step `Check if today is Saturday`
May 11, 2025
3835390
Merge pull request #2860 from opentensor/feat/roman/add-non-fast-bloc…
basfroman May 12, 2025
e35013c
add forgotten field for legacy_methods
May 12, 2025
af3eafd
update subtensor usage in e2e tests
May 12, 2025
20c1ca1
improve README.md
May 12, 2025
b62cb6d
update get_metagraph_info
May 12, 2025
6c9355c
ruff
May 12, 2025
547dbcb
Temporarily return the previous implementation of get_metagraph_info …
May 12, 2025
850170b
comment selective metagraph related tests
May 12, 2025
920a1e7
Merge pull request #2870 from opentensor/fix/roman/selective-metagraph
basfroman May 12, 2025
8dd99a9
Merge branch 'staging' into feat/roman/use-subtensor_api-interface-fo…
May 12, 2025
f0a7001
Merge pull request #2869 from opentensor/feat/roman/use-subtensor_api…
basfroman May 12, 2025
0852953
Updates changelog and version
ibraheem-abe May 12, 2025
1acc9d8
Merge pull request #2871 from opentensor/changelog/950
ibraheem-abe May 12, 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
4 changes: 2 additions & 2 deletions .github/workflows/docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install cosign
uses: sigstore/cosign-installer@v3
Expand Down Expand Up @@ -48,4 +48,4 @@ jobs:
DIGEST: ${{ steps.build.outputs.digest }}
TAGS: ${{ steps.build.outputs.tags }}
run: |
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
88 changes: 82 additions & 6 deletions .github/workflows/e2e-subtensor-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
branches: [master, development, staging]
types: [ opened, synchronize, reopened, ready_for_review ]

schedule:
- cron: '0 9 * * *' # Run every night at 2:00 PST

workflow_dispatch:
inputs:
verbose:
Expand Down Expand Up @@ -40,7 +43,7 @@ jobs:
run: |
test_files=$(find tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
# keep it here for future debug
# test_files=$(find tests/e2e_tests -type f -name "test*.py" | grep -E 'test_(incentive|commit_weights|set_weights)\.py$' | jq -R -s -c 'split("\n") | map(select(. != ""))')
# test_files=$(find tests/e2e_tests -type f -name "test*.py" | grep -E 'test_(hotkeys|staking)\.py$' | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "test-files=$test_files" >> "$GITHUB_OUTPUT"
shell: bash

Expand All @@ -63,8 +66,8 @@ jobs:
path: subtensor-localnet.tar

# Job to run tests in parallel
run-e2e-test:
name: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}
run-fast-blocks-e2e-test:
name: "FB: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}"
needs:
- find-tests
- pull-docker-image
Expand Down Expand Up @@ -107,7 +110,80 @@ jobs:
- name: Run tests with retry
run: |
set +e
for i in 1 2; do
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
uv run pytest ${{ matrix.test-file }} -s
status=$?
if [ $status -eq 0 ]; then
echo "✅ Tests passed on attempt $i"
break
else
echo "❌ Tests failed on attempt $i"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
exit 1
fi
echo "Retrying..."
sleep 5
fi
done


cron-run-non-fast-blocks-e2e-test:
if: github.event_name == 'schedule'
name: "NFB: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}"
needs:
- find-tests
- pull-docker-image
runs-on: ubuntu-latest
timeout-minutes: 1440

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)
matrix:
os:
- ubuntu-latest
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- name: Check if today is Saturday
run: |
day=$(date -u +%u)
echo "Today is weekday $day"
if [ "$day" -ne 6 ]; then
echo "⏭️ Skipping: not Saturday"
exit 78
fi
- name: Check-out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: install dependencies
run: uv sync --extra dev --dev

- name: Download Cached Docker Image
uses: actions/download-artifact@v4
with:
name: subtensor-localnet

- name: Load Docker Image
run: docker load -i subtensor-localnet.tar

- name: Run patched E2E tests
env:
FAST_BLOCKS: "0"
run: |
set +e
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
uv run pytest ${{ matrix.test-file }} -s
status=$?
Expand All @@ -116,8 +192,8 @@ jobs:
break
else
echo "❌ Tests failed on attempt $i"
if [ $i -eq 2 ]; then
echo "Tests failed after 2 attempts"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
exit 1
fi
echo "Retrying..."
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/monitor_requirements_size_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This workflow measures the disk size of a virtual environment
# after installing the Bittensor SDK across multiple Python versions.
# It runs only when a new pull request targets the master branch,
# and posts a comment with the results.
name: Monitor SDK Requirements Size

on:
pull_request:
types: [opened]
branches: [master]

permissions:
pull-requests: write
contents: read

jobs:
measure-venv:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
outputs:
py39: ${{ steps.set-output.outputs.py39 }}
py310: ${{ steps.set-output.outputs.py310 }}
py311: ${{ steps.set-output.outputs.py311 }}
py312: ${{ steps.set-output.outputs.py312 }}
py313: ${{ steps.set-output.outputs.py313 }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Create virtualenv and install
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install .

- name: Measure venv size
id: set-output
run: |
SIZE=$(du -sm venv | cut -f1)
VERSION=${{ matrix.python-version }}
echo "Detected size: $SIZE MB for Python $VERSION"
case "$VERSION" in
3.9) echo "py39=$SIZE" >> $GITHUB_OUTPUT ;;
3.10) echo "py310=$SIZE" >> $GITHUB_OUTPUT ;;
3.11) echo "py311=$SIZE" >> $GITHUB_OUTPUT ;;
3.12) echo "py312=$SIZE" >> $GITHUB_OUTPUT ;;
3.13) echo "py313=$SIZE" >> $GITHUB_OUTPUT ;;
esac

comment-on-pr:
if: github.event_name == 'pull_request' && github.base_ref == 'master'
needs: measure-venv
runs-on: ubuntu-latest
steps:
- name: Post venv size summary to PR
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const sizes = {
"3.9": "${{ needs.measure-venv.outputs.py39 || 'N/A' }}",
"3.10": "${{ needs.measure-venv.outputs.py310 || 'N/A' }}",
"3.11": "${{ needs.measure-venv.outputs.py311 || 'N/A' }}",
"3.12": "${{ needs.measure-venv.outputs.py312 || 'N/A' }}",
"3.13": "${{ needs.measure-venv.outputs.py313 || 'N/A' }}",
};

const body = [
'**Bittensor SDK virtual environment sizes by Python version:**',
'',
'```'
]
.concat(Object.entries(sizes).map(([v, s]) => `Python ${v}: ${s} MB`))
.concat(['```'])
.join('\n');

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Build Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -69,4 +69,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
print-hash: true
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Changelog

## 9.5.0 /2025-05-12

## What's Changed
* Release/9.4.0 by @ibraheem-abe in https://github.com/opentensor/bittensor/pull/2837
* Update subnet units by @thewhaleking in https://github.com/opentensor/bittensor/pull/2838
* Add `force_register_neuron` into MockSubtensor by @basfroman in https://github.com/opentensor/bittensor/pull/2839
* Add `Monitor-Requirements-Size` workflow by @basfroman in https://github.com/opentensor/bittensor/pull/2842
* Add `SelectiveMetagraph` interface into SDK by @basfroman in https://github.com/opentensor/bittensor/pull/2846
* Update docs for unstake amount by @thewhaleking in https://github.com/opentensor/bittensor/pull/2845
* Add one more attempt to e2e tests by @basfroman in https://github.com/opentensor/bittensor/pull/2849
* Fix typos in test documentation and docstrings by @leopardracer in https://github.com/opentensor/bittensor/pull/2848
* Add bittensor-drand==0.5.0 by @basfroman in https://github.com/opentensor/bittensor/pull/2835
* Extend selective metagraph logic by @basfroman in https://github.com/opentensor/bittensor/pull/2852
* fix: $BASH_ENV loading issue by @defitricks in https://github.com/opentensor/bittensor/pull/2851
* Update github actions versions due to deprecation by @PixelPil0t1 in https://github.com/opentensor/bittensor/pull/2850
* Add methods to Async/Subtensor class by @basfroman in https://github.com/opentensor/bittensor/pull/2854
* Cleanup, refactoring, small fix, improvement by @basfroman in https://github.com/opentensor/bittensor/pull/2856
* Add `period` argument to extrinsics calls by @basfroman in https://github.com/opentensor/bittensor/pull/2857
* Add nightly run of e2e tests by @basfroman in https://github.com/opentensor/bittensor/pull/2858
* `period=16` for fast blocks test by @basfroman in https://github.com/opentensor/bittensor/pull/2859
* Fix some unittests warnings by @zyzniewski-reef in https://github.com/opentensor/bittensor/pull/2774
* docs: fix typos in `README.md` by @gap-editor in https://github.com/opentensor/bittensor/pull/2861
* Introduce `SubtensorApi` interface for SDK by @basfroman in https://github.com/opentensor/bittensor/pull/2862
* Adds `__all__` to easy_imports.py to get rid of all the #noqa stuff by @thewhaleking in https://github.com/opentensor/bittensor/pull/2863
* `🥩s` to `staking` by @basfroman in https://github.com/opentensor/bittensor/pull/2864
* Fix `get_next_epoch_start_block` by @basfroman in https://github.com/opentensor/bittensor/pull/2865
* docs: fix dead link by @GarmashAlex in https://github.com/opentensor/bittensor/pull/2866
* Add `non-fast-blocks` e2e tests each Saturday by @basfroman in https://github.com/opentensor/bittensor/pull/2860
* Selective-metagraph -> MetagraphInfo by @basfroman in https://github.com/opentensor/bittensor/pull/2870
* Improve e2e tests and fix bug in SubtensorApi by @basfroman in https://github.com/opentensor/bittensor/pull/2869

## New Contributors
* @defitricks made their first contribution in https://github.com/opentensor/bittensor/pull/2851
* @PixelPil0t1 made their first contribution in https://github.com/opentensor/bittensor/pull/2850
* @gap-editor made their first contribution in https://github.com/opentensor/bittensor/pull/2861
* @GarmashAlex made their first contribution in https://github.com/opentensor/bittensor/pull/2866

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.4.0...v9.5.0

## 9.4.0 /2025-04-17

## What's Changed
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,29 @@ pytest tests/unit_tests
- using a compiler based on the substrait code
- using an already built docker image (docker runner)

#### Local environment variables:
- `LOCALNET_SH_PATH` - path to `localnet.sh` script in cloned subtensor repository (for legacy runner);
- `BUILD_BINARY` - (`=0` or `=1`) - used with `LOCALNET_SH_PATH` for build or not before start localnet node (for legacy runner);
- `USE_DOCKER` - (`=0` or `=1`) - used if you want to use specific runner to run e2e tests (for docker runner);
- `FAST_BLOCKS` - (`=0` or `=1`) - allows you to run a localnet node in fast or non-fast blocks mode (for both types of runers).

#### Using `docker runner` (default for now):
- E2E tests with docker image do not require preliminary compilation
- are executed very quickly
- require docker installed in OS

Ho to use:
How to use:
```bash
pytest tests/e2e_tests
```

#### TUsing `legacy runner`:
#### Using `legacy runner`:
- Will start compilation of the collected code in your subtensor repository
- you must provide the `LOCALNET_SH_PATH` variable in the local environment with the path to the file `/scripts/localnet.sh` in the cloned repository within your OS
- you can use the `BUILD_BINARY=0` variable, this will skip the copy step for each test.
- you can use the `USE_DOCKER=0` variable, this will run tests using the "legacy runner", even if docker is installed in your OS

#### Ho to use:
#### How to use:
Regular e2e tests run
```bash
LOCALNET_SH_PATH=/path/to/your/localnet.sh pytest tests/e2e_tests
Expand Down
Loading
Loading