Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
f499c99
add chain data proxy
basfroman Nov 7, 2025
fb35271
add query methods
basfroman Nov 7, 2025
4bcc6e8
update __all__
basfroman Nov 7, 2025
b128c20
add bittensor/core/extrinsics/pallets/proxy.py pallet
basfroman Nov 7, 2025
50be8e0
ruff
basfroman Nov 7, 2025
2c0cd97
add ProxyType
basfroman Nov 7, 2025
53761b5
refactor pallet
basfroman Nov 7, 2025
8161fdf
improve bittensor/core/chain_data/proxy.py
basfroman Nov 7, 2025
1af667c
add sync `proxy` extrinsics
basfroman Nov 7, 2025
bd4f165
clean signatures for pallet methods
basfroman Nov 7, 2025
64d72a6
update extrinsics structure
basfroman Nov 7, 2025
aff680e
add query methods
basfroman Nov 7, 2025
9f957a6
add 2 more calls in pallet
basfroman Nov 8, 2025
1d0cc18
add 2 more extrinsics
basfroman Nov 8, 2025
2a0c18c
ruff
basfroman Nov 8, 2025
1bc0790
update chain data
basfroman Nov 8, 2025
20fefb2
update SubtensorApi (less pain with utils)
basfroman Nov 8, 2025
28fcf40
update chain data
basfroman Nov 8, 2025
ec31ca1
update pallet
basfroman Nov 8, 2025
18ce7ea
update extrinsics
basfroman Nov 8, 2025
ffd6443
types - linter
basfroman Nov 8, 2025
713fc3b
add consistency tests and related workflow
basfroman Nov 9, 2025
d6381f2
add e2e tests
basfroman Nov 9, 2025
4650464
add deprecated type to be able pass consistency test
basfroman Nov 9, 2025
22fb7e5
add e2e test `test_poke_deposit`
basfroman Nov 10, 2025
52508bc
consistency
basfroman Nov 10, 2025
638fdad
correct description
basfroman Nov 10, 2025
b5a1c27
add subtensor methods
basfroman Nov 10, 2025
e18171b
`kill_pure_proxy` has direct call ability now
basfroman Nov 10, 2025
b2e2731
wrong return in docstring
basfroman Nov 10, 2025
c17a0da
unit tests for query methods
basfroman Nov 10, 2025
db5f720
unit tests for extrinsic methods
basfroman Nov 10, 2025
35f83f1
unit tests for extrinsics
basfroman Nov 10, 2025
de355f8
add async extrinsics
basfroman Nov 10, 2025
1ee43c0
import
basfroman Nov 10, 2025
70e375d
add async query methods
basfroman Nov 10, 2025
fea81c6
add async extrinsic call methods
basfroman Nov 10, 2025
e0cb23b
oops async properties
basfroman Nov 10, 2025
18656c3
add async e2e tests
basfroman Nov 10, 2025
3dcb73b
make it easy
basfroman Nov 10, 2025
72d06bb
improve sync tests
basfroman Nov 10, 2025
34ccfe9
add async unit tests
basfroman Nov 10, 2025
1a902d2
extend `poke_deposit` explanation
basfroman Nov 10, 2025
b784959
ruff + docstrings
basfroman Nov 10, 2025
6178947
`ProxyType.Any` for kill proxy
basfroman Nov 10, 2025
03d0de3
fix SubtensorApi unit test
basfroman Nov 10, 2025
fbd5958
wrong `c`
basfroman Nov 10, 2025
326ef1a
matrix.test-file.nodeid
basfroman Nov 10, 2025
bd08bcc
weird run
basfroman Nov 10, 2025
fa5dd28
weird ref
basfroman Nov 10, 2025
fad5984
`CallBuilder.dynamic_function = True` by default
basfroman Nov 10, 2025
5f6eeee
Merge branch 'feat/roman/create-subtensor-callls-logic' into feat/rom…
basfroman Nov 10, 2025
6b6b6d8
apply `0x` to call_hash in announce related extrinsics
basfroman Nov 10, 2025
27fea95
Merge branch 'SDKv10' into feat/roman/proxy
basfroman Nov 10, 2025
5e03f7b
unit tests
basfroman Nov 11, 2025
205b687
improve docstring
basfroman Nov 11, 2025
e24ff69
add `force_proxy_type` parameter to extrinsic calls + improve the doc…
basfroman Nov 11, 2025
87edb03
remove comment
basfroman Nov 11, 2025
2f7fd8f
remove import
basfroman Nov 11, 2025
d6ef42d
add unit tests for async extrinsics
basfroman Nov 11, 2025
35eda5d
improve `kill_pure_proxy` subtensor methods
basfroman Nov 11, 2025
57e8c10
Merge branch 'SDKv10' into feat/roman/proxy
basfroman Nov 11, 2025
e7de598
update unit tests `test_kill_pure_proxy`
basfroman Nov 11, 2025
7774ab2
add warning to `kill_pure_proxy` and `kill_pure_proxy_extrinsic`
basfroman Nov 11, 2025
55c64a2
update Warnings
basfroman Nov 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
221 changes: 221 additions & 0 deletions .github/workflows/subtensor-consistency-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
name: Subtensor Consistency Tests

concurrency:
group: consistency-subtensor-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- '**'
types: [ opened, synchronize, reopened, ready_for_review ]

workflow_dispatch:
inputs:
verbose:
description: "Output more information when triggered manually"
required: false
default: ""

# job to run tests in parallel
jobs:
# Looking for e2e tests
find-tests:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
outputs:
test-files: ${{ steps.get-tests.outputs.test-files }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: false
cache-dependency-glob: '**/pyproject.toml'
ignore-nothing-to-cache: true

- name: Cache uv and venv
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: uv-${{ runner.os }}-py3.10-${{ hashFiles('pyproject.toml') }}
restore-keys: uv-${{ runner.os }}-py3.10-

- name: Install dependencies (faster if cache hit)
run: uv sync --extra dev --dev

- name: Find test files
id: get-tests
shell: bash
run: |
set -euo pipefail
test_matrix=$(
uv run pytest -q --collect-only tests/consistency \
| sed -n '/^consistency\//p' \
| sed 's|^|tests/|' \
| jq -R -s -c '
split("\n")
| map(select(. != ""))
| map({nodeid: ., label: (sub("^tests/consistency/"; ""))})
'
)
echo "Found tests: $test_matrix"
echo "test-files=$test_matrix" >> "$GITHUB_OUTPUT"

# Pull docker image
pull-docker-image:
runs-on: ubuntu-latest
outputs:
image-name: ${{ steps.set-image.outputs.image }}
steps:
- name: Set Docker image tag based on label or branch
id: set-image
run: |
echo "Event: $GITHUB_EVENT_NAME"
echo "Branch: $GITHUB_REF_NAME"

echo "Reading labels ..."
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH")
else
labels=""
fi

image=""

for label in $labels; do
echo "Found label: $label"
case "$label" in
"subtensor-localnet:main")
image="ghcr.io/opentensor/subtensor-localnet:main"
break
;;
"subtensor-localnet:testnet")
image="ghcr.io/opentensor/subtensor-localnet:testnet"
break
;;
"subtensor-localnet:devnet")
image="ghcr.io/opentensor/subtensor-localnet:devnet"
break
;;
esac
done

if [[ -z "$image" ]]; then
# fallback to default based on branch
if [[ "${GITHUB_REF_NAME}" == "master" ]]; then
image="ghcr.io/opentensor/subtensor-localnet:main"
else
image="ghcr.io/opentensor/subtensor-localnet:devnet-ready"
fi
fi

echo "✅ Final selected image: $image"
echo "image=$image" >> "$GITHUB_OUTPUT"

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

- name: Pull Docker Image
run: docker pull ${{ steps.set-image.outputs.image }}

- name: Save Docker Image to Cache
run: docker save -o subtensor-localnet.tar ${{ steps.set-image.outputs.image }}

- name: Upload Docker Image as Artifact
uses: actions/upload-artifact@v4
with:
name: subtensor-localnet
path: subtensor-localnet.tar
compression-level: 0

# Job to run tests in parallel
# Since GH Actions matrix has a limit of 256 jobs, we need to split the tests into multiple jobs with different
# Python versions. To reduce DRY we use reusable workflow.

consistency-tests:
name: "Consistency test: ${{ matrix.test-file.label }}"
needs:
- find-tests
- pull-docker-image
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)
matrix:
os:
- ubuntu-latest
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
steps:
- name: Check-out repository
uses: actions/checkout@v4

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

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

- name: Cache uv and venv
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: uv-${{ runner.os }}-py3.10-${{ hashFiles('pyproject.toml') }}
restore-keys: uv-${{ runner.os }}-py3.10-

- 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 tests with retry
id: test-failed
env:
FAST_BLOCKS: "1"
LOCALNET_IMAGE_NAME: ${{ needs.pull-docker-image.outputs.image-name }}
run: |
set +e
for i in 1 2 3; do
echo "::group::🔁 Test attempt $i"
uv run pytest ${{ matrix.test-file.nodeid }} -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
Loading
Loading