diff --git a/.github/scripts/cleanup-localnet-ci-images.sh b/.github/scripts/cleanup-localnet-ci-images.sh new file mode 100755 index 0000000000..4ab597c4d5 --- /dev/null +++ b/.github/scripts/cleanup-localnet-ci-images.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +set -euo pipefail + +select_candidates() { + local versions_file="$1" + local cutoff="$2" + + jq -c --arg cutoff "$cutoff" ' + .[] + | select(.created_at < $cutoff) + | select( + (.metadata.container.tags | length) == 0 + or all(.metadata.container.tags[]; test("^ci-[0-9a-f]{40}$")) + ) + ' "$versions_file" +} + +cleanup_package() { + : "${PACKAGE_OWNER:?PACKAGE_OWNER is required}" + : "${GH_TOKEN:?GH_TOKEN is required}" + + local package_name="subtensor-localnet-ci" + local retention_days="${RETENTION_DAYS:-30}" + local temp_dir="${RUNNER_TEMP:-/tmp}" + local versions candidates cutoff deleted version id tags created_at + + [[ "$retention_days" =~ ^[0-9]+$ ]] || { + echo "RETENTION_DAYS must be a non-negative integer: $retention_days" >&2 + return 1 + } + + versions="$(mktemp "$temp_dir/localnet-ci-versions.XXXXXX")" + candidates="$(mktemp "$temp_dir/localnet-ci-candidates.XXXXXX")" + trap "rm -f '$versions' '$candidates'" EXIT + cutoff="$(date -u -d "$retention_days days ago" +%Y-%m-%dT%H:%M:%SZ)" + + gh api --paginate \ + "/orgs/$PACKAGE_OWNER/packages/container/$package_name/versions?per_page=100" \ + | jq -s 'add // []' >"$versions" + select_candidates "$versions" "$cutoff" >"$candidates" + + deleted=0 + while IFS= read -r version; do + id="$(jq -r '.id' <<<"$version")" + tags="$(jq -r '.metadata.container.tags | join(",")' <<<"$version")" + created_at="$(jq -r '.created_at' <<<"$version")" + echo "Deleting version $id (tags=${tags:-untagged}, created=$created_at)" + gh api --method DELETE \ + "/orgs/$PACKAGE_OWNER/packages/container/$package_name/versions/$id" + deleted=$((deleted + 1)) + done <"$candidates" + + echo "Deleted $deleted expired $package_name image version(s)." +} + +case "${1:-cleanup}" in + select) + [[ $# -eq 3 ]] || { + echo "usage: $0 select VERSIONS_FILE CUTOFF" >&2 + exit 2 + } + select_candidates "$2" "$3" + ;; + cleanup) + [[ $# -eq 0 || $# -eq 1 ]] || { + echo "usage: $0 [cleanup]" >&2 + exit 2 + } + cleanup_package + ;; + *) + echo "usage: $0 [cleanup] | select VERSIONS_FILE CUTOFF" >&2 + exit 2 + ;; +esac diff --git a/.github/scripts/publish-localnet-manifest.sh b/.github/scripts/publish-localnet-manifest.sh new file mode 100755 index 0000000000..1b0b827b8c --- /dev/null +++ b/.github/scripts/publish-localnet-manifest.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +set -euo pipefail + +: "${IMAGE:?IMAGE is required}" +: "${TAG:?TAG is required}" +: "${SHA:?SHA is required}" +: "${PUBLISH_LATEST:?PUBLISH_LATEST is required}" + +descriptor_dir="${1:-image-descriptors}" + +[[ "$SHA" =~ ^[0-9a-f]{40}$ ]] || { + echo "SHA must be a full lowercase commit SHA: $SHA" >&2 + exit 1 +} + +read_source() { + local arch="$1" + local descriptor="$descriptor_dir/$arch.txt" + local source digest + + [[ -s "$descriptor" ]] || { + echo "missing $arch image descriptor: $descriptor" >&2 + return 1 + } + + IFS= read -r source < "$descriptor" + digest="${source#"$IMAGE@"}" + [[ "$source" == "$IMAGE@$digest" && "$digest" =~ ^sha256:[0-9a-f]{64}$ ]] || { + echo "invalid $arch image descriptor: $source" >&2 + return 1 + } + + printf '%s' "$source" +} + +amd64_source="$(read_source amd64)" +arm64_source="$(read_source arm64)" + +tags=( + --tag "$IMAGE:$TAG" + --tag "$IMAGE:sha-$SHA" +) +case "$PUBLISH_LATEST" in + true) + tags+=(--tag "$IMAGE:latest") + ;; + false) + ;; + *) + echo "PUBLISH_LATEST must be true or false: $PUBLISH_LATEST" >&2 + exit 1 + ;; +esac + +docker buildx imagetools create \ + "${tags[@]}" \ + --annotation "index:org.opencontainers.image.description=Subtensor local development network for CI and local testing" \ + --annotation "index:org.opencontainers.image.source=https://github.com/RaoFoundation/subtensor" \ + --annotation "index:org.opencontainers.image.licenses=Apache-2.0" \ + "$amd64_source" \ + "$arm64_source" diff --git a/.github/scripts/resolve-localnet-image.sh b/.github/scripts/resolve-localnet-image.sh new file mode 100755 index 0000000000..a0eba5e95e --- /dev/null +++ b/.github/scripts/resolve-localnet-image.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -euo pipefail + +output_file="${1:-${GITHUB_OUTPUT:-}}" +: "${output_file:?pass an output file or set GITHUB_OUTPUT}" +: "${EVENT_NAME:?EVENT_NAME is required}" +: "${REF_NAME:?REF_NAME is required}" +: "${EVENT_SHA:?EVENT_SHA is required}" + +branch_or_tag="${BRANCH_OR_TAG:-}" +pr_number="${PR_NUMBER:-}" +pr_head_sha="${PR_HEAD_SHA:-}" +pr_head_ref="${PR_HEAD_REF:-}" + +sanitize_tag() { + local value="$1" + value="${value//[^a-zA-Z0-9._-]/-}" + if [[ ! "$value" =~ ^[a-zA-Z0-9_] ]]; then + value="ref-${value}" + fi + printf '%.128s' "$value" +} + +if [[ -n "$pr_number" ]]; then + [[ "$pr_number" =~ ^[0-9]+$ ]] || { + echo "PR_NUMBER must contain digits only: $pr_number" >&2 + exit 1 + } + tag="pr-${pr_number}" + ref="${pr_head_sha:-${pr_head_ref:-${branch_or_tag:-main}}}" + latest_tag=false +else + source_tag="${branch_or_tag:-$REF_NAME}" + tag="$(sanitize_tag "$source_tag")" + ref="${branch_or_tag:-$EVENT_SHA}" + if [[ "$tag" == main ]]; then + latest_tag=true + else + latest_tag=false + fi +fi + +{ + echo "tag=$tag" + echo "ref=$ref" + echo "latest_tag=$latest_tag" +} >>"$output_file" diff --git a/.github/scripts/test-cleanup-localnet-ci-images.sh b/.github/scripts/test-cleanup-localnet-ci-images.sh new file mode 100755 index 0000000000..c994b270be --- /dev/null +++ b/.github/scripts/test-cleanup-localnet-ci-images.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +cleanup_script="$repo_root/.github/scripts/cleanup-localnet-ci-images.sh" +fixture="$(mktemp)" +trap 'rm -f "$fixture"' EXIT + +cat >"$fixture" <<'JSON' +[ + {"id":1,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":[]}}}, + {"id":2,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":["ci-1111111111111111111111111111111111111111"]}}}, + {"id":3,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":["ci-2222222222222222222222222222222222222222","ci-3333333333333333333333333333333333333333"]}}}, + {"id":4,"created_at":"2026-06-16T00:00:00Z","metadata":{"container":{"tags":["ci-4444444444444444444444444444444444444444"]}}}, + {"id":5,"created_at":"2026-07-01T00:00:00Z","metadata":{"container":{"tags":["ci-5555555555555555555555555555555555555555"]}}}, + {"id":6,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":["ci-short"]}}}, + {"id":7,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":["ci-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"]}}}, + {"id":8,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":["ci-8888888888888888888888888888888888888888","main"]}}}, + {"id":9,"created_at":"2026-06-01T00:00:00Z","metadata":{"container":{"tags":["main"]}}} +] +JSON + +actual="$($cleanup_script select "$fixture" 2026-06-16T00:00:00Z | jq -r '.id' | paste -sd, -)" +expected="1,2,3" +[[ "$actual" == "$expected" ]] || { + echo "unexpected cleanup candidates: expected=$expected actual=$actual" >&2 + exit 1 +} + +echo "localnet CI image cleanup policy tests passed" diff --git a/.github/scripts/test-localnet-image.sh b/.github/scripts/test-localnet-image.sh new file mode 100755 index 0000000000..31c65502e8 --- /dev/null +++ b/.github/scripts/test-localnet-image.sh @@ -0,0 +1,158 @@ +#!/usr/bin/env bash + +set -euo pipefail + +image="${1:?usage: test-localnet-image.sh IMAGE}" +suffix="${GITHUB_RUN_ID:-local}-$$" +fast_container="subtensor-localnet-fast-${suffix}" +standard_container="subtensor-localnet-standard-${suffix}" +persistent_container="subtensor-localnet-persistent-${suffix}" +failure_container="subtensor-localnet-failure-${suffix}" +state_volume="subtensor-localnet-state-${suffix}" + +cleanup() { + docker rm -f "$fast_container" "$standard_container" "$persistent_container" \ + "$failure_container" \ + >/dev/null 2>&1 || true + docker volume rm -f "$state_volume" >/dev/null 2>&1 || true +} +trap cleanup EXIT + +show_failure() { + local container="$1" + echo "--- $container logs ---" >&2 + docker logs "$container" >&2 || true + echo "--- $container inspect ---" >&2 + docker inspect "$container" >&2 || true +} + +wait_healthy() { + local container="$1" + local attempts="${2:-90}" + + for ((attempt = 1; attempt <= attempts; attempt++)); do + local running health + running="$(docker inspect --format '{{.State.Running}}' "$container")" + health="$(docker inspect --format '{{.State.Health.Status}}' "$container")" + if [[ "$running" != true ]]; then + show_failure "$container" + return 1 + fi + if [[ "$health" == healthy ]]; then + return 0 + fi + if [[ "$health" == unhealthy ]]; then + show_failure "$container" + return 1 + fi + sleep 2 + done + + show_failure "$container" + return 1 +} + +assert_rpc() { + local container="$1" + local port="$2" + docker exec "$container" /scripts/localnet_healthcheck.sh "$port" +} + +block_number() { + local container="$1" + local response hex + response="$( + docker exec "$container" curl --fail --silent --max-time 2 \ + -H 'content-type: application/json' \ + --data '{"id":1,"jsonrpc":"2.0","method":"chain_getHeader","params":[]}' \ + http://127.0.0.1:9944 + )" + hex="$(sed -n 's/.*"number":"0x\([0-9a-fA-F]*\)".*/\1/p' <<<"$response")" + [[ -n "$hex" ]] || { + echo "could not parse block number from: $response" >&2 + return 1 + } + printf '%d\n' "$((16#$hex))" +} + +block_hash() { + local container="$1" + local number="$2" + local response hash + response="$( + docker exec "$container" curl --fail --silent --max-time 2 \ + -H 'content-type: application/json' \ + --data "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"chain_getBlockHash\",\"params\":[$number]}" \ + http://127.0.0.1:9944 + )" + hash="$(sed -n 's/.*"result":"\(0x[0-9a-fA-F]*\)".*/\1/p' <<<"$response")" + [[ -n "$hash" ]] || { + echo "could not parse block hash from: $response" >&2 + return 1 + } + printf '%s\n' "$hash" +} + +docker run --rm --entrypoint /target/fast-runtime/release/node-subtensor \ + "$image" --help >/dev/null +docker run --rm --entrypoint /target/non-fast-runtime/release/node-subtensor \ + "$image" --help >/dev/null + +docker run -d --name "$fast_container" "$image" True >/dev/null +wait_healthy "$fast_container" +assert_rpc "$fast_container" 9944 +assert_rpc "$fast_container" 9945 +docker stop --time 40 "$fast_container" >/dev/null + +docker run -d --name "$standard_container" "$image" False >/dev/null +wait_healthy "$standard_container" +assert_rpc "$standard_container" 9944 +assert_rpc "$standard_container" 9945 +docker stop --time 40 "$standard_container" >/dev/null + +# The entrypoint supervises all three authorities. Kill the newest process +# (authority three), proving supervision is not accidentally limited to the +# first child. +docker run -d --name "$failure_container" "$image" True >/dev/null +wait_healthy "$failure_container" +docker exec "$failure_container" pkill -TERM -n node-subtensor +for _ in {1..30}; do + if [[ "$(docker inspect --format '{{.State.Running}}' "$failure_container")" == false ]]; then + break + fi + sleep 1 +done +if [[ "$(docker inspect --format '{{.State.Running}}' "$failure_container")" != false ]]; then + show_failure "$failure_container" + exit 1 +fi +if [[ "$(docker inspect --format '{{.State.ExitCode}}' "$failure_container")" == 0 ]]; then + echo "localnet container succeeded after an authority exited" >&2 + exit 1 +fi + +docker volume create "$state_volume" >/dev/null +docker run -d --name "$persistent_container" -v "$state_volume:/tmp" \ + "$image" True >/dev/null +wait_healthy "$persistent_container" +before_restart="$(block_number "$persistent_container")" +before_hash="$(block_hash "$persistent_container" "$before_restart")" +docker stop --time 40 "$persistent_container" >/dev/null +docker rm "$persistent_container" >/dev/null + +docker run -d --name "$persistent_container" -v "$state_volume:/tmp" \ + "$image" True --no-purge >/dev/null +wait_healthy "$persistent_container" +after_restart="$(block_number "$persistent_container")" +if ((after_restart < before_restart)); then + echo "--no-purge lost chain state: before=$before_restart after=$after_restart" >&2 + exit 1 +fi +after_hash="$(block_hash "$persistent_container" "$before_restart")" +if [[ "$after_hash" != "$before_hash" ]]; then + echo "--no-purge changed block $before_restart: before=$before_hash after=$after_hash" >&2 + exit 1 +fi + +docker stop --time 40 "$persistent_container" >/dev/null +echo "localnet image compatibility smoke tests passed" diff --git a/.github/scripts/test-publish-localnet-manifest.sh b/.github/scripts/test-publish-localnet-manifest.sh new file mode 100755 index 0000000000..1a63e287d1 --- /dev/null +++ b/.github/scripts/test-publish-localnet-manifest.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +publisher="$repo_root/.github/scripts/publish-localnet-manifest.sh" +workdir="$(mktemp -d)" +trap 'rm -rf "$workdir"' EXIT + +image="ghcr.io/raofoundation/subtensor-localnet" +sha="0123456789abcdef0123456789abcdef01234567" +descriptor_dir="$workdir/descriptors" +fake_docker="$workdir/docker" +args_file="$workdir/docker-args" +mkdir -p "$descriptor_dir" + +printf '%s@sha256:%064d\n' "$image" 0 > "$descriptor_dir/amd64.txt" +printf '%s@sha256:%064d\n' "$image" 1 > "$descriptor_dir/arm64.txt" + +cat > "$fake_docker" <<'SCRIPT' +#!/usr/bin/env bash +set -euo pipefail +printf '%s\n' "$@" > "$DOCKER_ARGS_FILE" +SCRIPT +chmod +x "$fake_docker" + +assert_case() { + local publish_latest="$1" + local argument index + local -a expected actual + + expected=( + buildx imagetools create + --tag "$image:pr-2928" + --tag "$image:sha-$sha" + ) + if [[ "$publish_latest" == true ]]; then + expected+=(--tag "$image:latest") + fi + expected+=( + --annotation "index:org.opencontainers.image.description=Subtensor local development network for CI and local testing" + --annotation "index:org.opencontainers.image.source=https://github.com/RaoFoundation/subtensor" + --annotation "index:org.opencontainers.image.licenses=Apache-2.0" + "$image@sha256:0000000000000000000000000000000000000000000000000000000000000000" + "$image@sha256:0000000000000000000000000000000000000000000000000000000000000001" + ) + + IMAGE="$image" TAG=pr-2928 SHA="$sha" PUBLISH_LATEST="$publish_latest" \ + PATH="$workdir:$PATH" DOCKER_ARGS_FILE="$args_file" \ + "$publisher" "$descriptor_dir" + + actual=() + while IFS= read -r argument; do + actual+=("$argument") + done < "$args_file" + [[ "${#actual[@]}" -eq "${#expected[@]}" ]] || { + echo "unexpected argument count for latest=$publish_latest" >&2 + exit 1 + } + for index in "${!expected[@]}"; do + [[ "${actual[$index]}" == "${expected[$index]}" ]] || { + echo "argument $index mismatch for latest=$publish_latest" >&2 + echo "expected: ${expected[$index]}" >&2 + echo "actual: ${actual[$index]}" >&2 + exit 1 + } + done +} + +assert_case false +assert_case true + +if IMAGE="$image" TAG=pr-2928 SHA="$sha" PUBLISH_LATEST=invalid \ + PATH="$workdir:$PATH" DOCKER_ARGS_FILE="$args_file" \ + "$publisher" "$descriptor_dir" >/dev/null 2>&1; then + echo "invalid latest policy unexpectedly succeeded" >&2 + exit 1 +fi + +printf '%s\n' "$image:not-a-digest" > "$descriptor_dir/amd64.txt" +if IMAGE="$image" TAG=pr-2928 SHA="$sha" PUBLISH_LATEST=false \ + PATH="$workdir:$PATH" DOCKER_ARGS_FILE="$args_file" \ + "$publisher" "$descriptor_dir" >/dev/null 2>&1; then + echo "invalid image descriptor unexpectedly succeeded" >&2 + exit 1 +fi + +echo "localnet manifest publication contract tests passed" diff --git a/.github/scripts/test-resolve-localnet-image.sh b/.github/scripts/test-resolve-localnet-image.sh new file mode 100755 index 0000000000..d8d60e80ca --- /dev/null +++ b/.github/scripts/test-resolve-localnet-image.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +resolver="$repo_root/.github/scripts/resolve-localnet-image.sh" + +assert_case() { + local description="$1" + local expected_tag="$2" + local expected_ref="$3" + local expected_latest="$4" + shift 4 + + local output + output="$(mktemp)" + env -i PATH="$PATH" HOME="${HOME:-/tmp}" "$@" "$resolver" "$output" + + grep -qxF "tag=$expected_tag" "$output" || { + echo "$description: unexpected tag" >&2 + sed -n '1,20p' "$output" >&2 + exit 1 + } + grep -qxF "ref=$expected_ref" "$output" || { + echo "$description: unexpected ref" >&2 + sed -n '1,20p' "$output" >&2 + exit 1 + } + grep -qxF "latest_tag=$expected_latest" "$output" || { + echo "$description: unexpected latest policy" >&2 + sed -n '1,20p' "$output" >&2 + exit 1 + } + rm -f "$output" +} + +common=(EVENT_SHA=0123456789abcdef REF_NAME=main) + +assert_case "main push" main 0123456789abcdef true \ + env EVENT_NAME=push "${common[@]}" +assert_case "devnet push" devnet 0123456789abcdef false \ + env EVENT_NAME=push EVENT_SHA=0123456789abcdef REF_NAME=devnet +assert_case "testnet push" testnet 0123456789abcdef false \ + env EVENT_NAME=push EVENT_SHA=0123456789abcdef REF_NAME=testnet +assert_case "release" v431 0123456789abcdef false \ + env EVENT_NAME=release EVENT_SHA=0123456789abcdef REF_NAME=v431 +assert_case "manual feature ref" feat-docker feat/docker false \ + env EVENT_NAME=workflow_dispatch "${common[@]}" BRANCH_OR_TAG=feat/docker +assert_case "manual invalid-leading ref" ref--candidate-x -candidate/x false \ + env EVENT_NAME=workflow_dispatch "${common[@]}" BRANCH_OR_TAG=-candidate/x +assert_case "manual main" main main true \ + env EVENT_NAME=workflow_dispatch "${common[@]}" BRANCH_OR_TAG=main +assert_case "PR build" pr-2898 fedcba9876543210 false \ + env EVENT_NAME=workflow_dispatch "${common[@]}" PR_NUMBER=2898 \ + PR_HEAD_SHA=fedcba9876543210 PR_HEAD_REF=feature/example + +if env -i PATH="$PATH" HOME="${HOME:-/tmp}" EVENT_NAME=workflow_dispatch \ + EVENT_SHA=0123456789abcdef REF_NAME=main PR_NUMBER=not-a-number \ + "$resolver" "$(mktemp)" >/dev/null 2>&1; then + echo "invalid PR number unexpectedly succeeded" >&2 + exit 1 +fi + +echo "localnet image tag policy tests passed" diff --git a/.github/workflows/check-bittensor-e2e-tests.yml b/.github/workflows/check-bittensor-e2e-tests.yml index ef54b75e17..0fcfa2de74 100644 --- a/.github/workflows/check-bittensor-e2e-tests.yml +++ b/.github/workflows/check-bittensor-e2e-tests.yml @@ -3,8 +3,9 @@ name: Bittensor E2E Test permissions: pull-requests: write contents: read - # Push/pull the per-PR localnet image on GHCR. Fork PRs never reach the - # image jobs (they need the trusted-pr gate), so this is non-fork only. + # Push/pull the per-PR localnet image through a separate, CI-only GHCR package. + # Fork PRs never reach the image jobs (they need the trusted-pr gate), so + # this is non-fork only. packages: write concurrency: @@ -50,12 +51,13 @@ on: env: CARGO_TERM_COLOR: always VERBOSE: ${{ github.event.inputs.verbose }} - # The Rust SDK e2e harness reads LOCALNET_IMAGE from the environment. + # The Rust SDK e2e harness reads LOCALNET_IMAGE from the environment. Test + # jobs retag the CI image to this compatibility name locally; it is + # never pushed. LOCALNET_IMAGE: ghcr.io/raofoundation/subtensor-localnet:ci - # Per-commit tag on GHCR: built once, pulled by every test job. Registry - # pulls beat the old artifact-tarball + docker-load path (~1-2 min/job) - # because layers download compressed and in parallel. - LOCALNET_IMAGE_CI: ghcr.io/raofoundation/subtensor-localnet:ci-${{ github.event.pull_request.head.sha || github.sha }} + # Per-commit tag in the CI-only package: built once, pulled by every test + # job. Keep these transport artifacts out of the public release package. + LOCALNET_IMAGE_CI: ghcr.io/raofoundation/subtensor-localnet-ci:ci-${{ github.event.pull_request.head.sha || github.sha }} jobs: trusted-pr: @@ -304,7 +306,23 @@ jobs: docker info | grep "Docker Root Dir" - name: Build Docker Image - run: docker build -f sdk/bittensor-core/tests/Dockerfile.localnet-fast -t "$LOCALNET_IMAGE_CI" . + env: + SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: | + docker build \ + -f sdk/bittensor-core/tests/Dockerfile.localnet-fast \ + --label "org.opencontainers.image.revision=$SOURCE_SHA" \ + --label "org.opencontainers.image.version=ci-$SOURCE_SHA" \ + -t "$LOCALNET_IMAGE_CI" \ + . + + - name: Verify CI image isolation and metadata + run: | + [[ "$LOCALNET_IMAGE_CI" == ghcr.io/raofoundation/subtensor-localnet-ci:ci-* ]] + test "$(docker image inspect "$LOCALNET_IMAGE_CI" --format '{{index .Config.Labels "org.opencontainers.image.title"}}')" = "Subtensor Localnet CI" + test "$(docker image inspect "$LOCALNET_IMAGE_CI" --format '{{index .Config.Labels "org.opencontainers.image.description"}}')" = "PR-specific Subtensor localnet image for repository E2E tests" + test "$(docker image inspect "$LOCALNET_IMAGE_CI" --format '{{index .Config.Labels "org.opencontainers.image.source"}}')" = "https://github.com/RaoFoundation/subtensor" + test "$(docker image inspect "$LOCALNET_IMAGE_CI" --format '{{index .Config.Labels "org.opencontainers.image.licenses"}}')" = "Apache-2.0" - name: Login to GHCR uses: docker/login-action@v3 diff --git a/.github/workflows/check-localnet-publication.yml b/.github/workflows/check-localnet-publication.yml new file mode 100644 index 0000000000..d4cc78d233 --- /dev/null +++ b/.github/workflows/check-localnet-publication.yml @@ -0,0 +1,30 @@ +name: Localnet Publication Contract + +on: + pull_request: + paths: + - ".github/workflows/docker-localnet.yml" + - ".github/workflows/check-localnet-publication.yml" + - ".github/scripts/resolve-localnet-image.sh" + - ".github/scripts/test-resolve-localnet-image.sh" + - ".github/scripts/publish-localnet-manifest.sh" + - ".github/scripts/test-publish-localnet-manifest.sh" + +concurrency: + group: check-localnet-publication-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + contract: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Test image tag policy + run: ./.github/scripts/test-resolve-localnet-image.sh + + - name: Test immutable manifest publication + run: ./.github/scripts/test-publish-localnet-manifest.sh diff --git a/.github/workflows/cleanup-localnet-ci-images.yml b/.github/workflows/cleanup-localnet-ci-images.yml new file mode 100644 index 0000000000..38d3803422 --- /dev/null +++ b/.github/workflows/cleanup-localnet-ci-images.yml @@ -0,0 +1,35 @@ +name: Cleanup Localnet CI Images + +# PR-specific images are retained long enough for GitHub's workflow rerun +# window, then removed from the CI-only package. Public release images live +# in subtensor-localnet and are deliberately outside this workflow's scope. +on: + schedule: + - cron: "17 3 * * *" + workflow_dispatch: + +permissions: + contents: read + packages: write + +concurrency: + group: cleanup-localnet-ci-images + cancel-in-progress: false + +jobs: + cleanup: + runs-on: ubuntu-latest + env: + RETENTION_DAYS: 30 + steps: + - name: Check out cleanup policy + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: Validate cleanup policy + run: ./.github/scripts/test-cleanup-localnet-ci-images.sh + + - name: Delete expired CI image versions + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PACKAGE_OWNER: ${{ github.repository_owner }} + run: ./.github/scripts/cleanup-localnet-ci-images.sh diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index 629ed229c6..86a762ee91 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -1,17 +1,17 @@ name: Publish Localnet Docker Image -# Localnet images are the chain-in-a-box used by the SDK/btcli e2e harnesses. -# Every push to main refreshes :main and :latest; releases publish the -# version tag (dispatched by watch-mainnet-release.yml, since its -# GITHUB_TOKEN-created releases never emit `release: published`); dispatch -# with pr-number builds a throwaway :pr-N image for testing downstream -# tooling against an open PR. +# Localnet images are the chain-in-a-box used by SDK/btcli e2e harnesses. +# The release train force-moves the devnet/testnet mirror branch only after +# that exact commit is verified on the corresponding live network; the mirror +# push is therefore the publication hook for those tags. Main publishes its +# candidate tag directly and is the only branch that advances :latest. Manual +# PR builds publish :pr-N without moving a branch tag or :latest. on: release: types: [published] push: - branches: [main] + branches: [main, devnet, testnet] workflow_dispatch: inputs: branch-or-tag: @@ -39,8 +39,21 @@ jobs: tag: ${{ steps.vars.outputs.tag }} ref: ${{ steps.vars.outputs.ref }} latest_tag: ${{ steps.vars.outputs.latest_tag }} + sha: ${{ steps.source.outputs.sha }} + image: ${{ steps.image.outputs.image }} + repository: ${{ steps.image.outputs.repository }} + publication_id: ${{ steps.image.outputs.publication_id }} steps: - - name: Get PR branch (if pr-number is specified) + - name: Check out workflow scripts + uses: actions/checkout@v4 + + - name: Validate image tag policy + run: ./.github/scripts/test-resolve-localnet-image.sh + + - name: Validate image publication contract + run: ./.github/scripts/test-publish-localnet-manifest.sh + + - name: Get PR source (if pr-number is specified) id: pr-info if: ${{ github.event.inputs.pr-number != '' }} uses: actions/github-script@v7 @@ -49,55 +62,73 @@ jobs: with: script: | const prNumber = process.env.PR_NUMBER; + if (!/^\d+$/.test(prNumber)) { + core.setFailed(`Invalid PR number: ${prNumber}`); + return; + } const { data: pr } = await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, - pull_number: parseInt(prNumber) + pull_number: Number(prNumber) }); + if (pr.head.repo.full_name !== `${context.repo.owner}/${context.repo.repo}`) { + core.setFailed('Fork PRs cannot run on the localnet publishing runners.'); + return; + } core.setOutput('head_ref', pr.head.ref); + core.setOutput('head_sha', pr.head.sha); - - name: Determine Docker tag and ref + - name: Determine Docker tag and source ref id: vars env: + EVENT_NAME: ${{ github.event_name }} + EVENT_SHA: ${{ github.sha }} PR_NUMBER: ${{ github.event.inputs.pr-number }} PR_HEAD_REF: ${{ steps.pr-info.outputs.head_ref }} + PR_HEAD_SHA: ${{ steps.pr-info.outputs.head_sha }} BRANCH_OR_TAG: ${{ github.event.inputs.branch-or-tag }} REF_NAME: ${{ github.ref_name }} + run: ./.github/scripts/resolve-localnet-image.sh + + - name: Determine image identity + id: image run: | - if [[ -n "$PR_NUMBER" ]]; then - echo "tag=pr-${PR_NUMBER}" >> $GITHUB_OUTPUT - echo "ref=${PR_HEAD_REF:-${BRANCH_OR_TAG:-main}}" >> $GITHUB_OUTPUT - echo "latest_tag=false" >> $GITHUB_OUTPUT - else - ref="${BRANCH_OR_TAG:-$REF_NAME}" - # Docker tags cannot contain '/', so sanitize the ref into a valid - # tag while still checking out the real ref (e.g. `feat/x`). - tag="${ref//[^a-zA-Z0-9._-]/-}" - echo "tag=$tag" >> $GITHUB_OUTPUT - echo "ref=$ref" >> $GITHUB_OUTPUT - echo "latest_tag=true" >> $GITHUB_OUTPUT - fi + repository="${GITHUB_REPOSITORY,,}-localnet" + echo "image=ghcr.io/$repository" >> "$GITHUB_OUTPUT" + echo "repository=$repository" >> "$GITHUB_OUTPUT" + echo "publication_id=$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT" >> "$GITHUB_OUTPUT" + + - name: Check out immutable source revision + uses: actions/checkout@v4 + with: + ref: ${{ steps.vars.outputs.ref }} + + - name: Record source commit + id: source + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" # Build node binaries for both runtimes on both architectures. artifacts: name: Node • ${{ matrix.runtime }} • ${{ matrix.platform.arch }} needs: setup + timeout-minutes: 90 strategy: + fail-fast: false matrix: platform: - # triple names used in scripts/install_prebuilt_binaries.sh + # Triple names are also used by scripts/install_prebuilt_binaries.sh. - runner: [self-hosted, fireactions-turbo-8] triple: x86_64-unknown-linux-gnu arch: amd64 - runner: [ubuntu-24.04-arm] triple: aarch64-unknown-linux-gnu arch: arm64 - runtime: ["fast-runtime", "non-fast-runtime"] + runtime: [fast-runtime, non-fast-runtime] runs-on: ${{ matrix.platform.runner }} steps: - uses: actions/checkout@v4 with: - ref: ${{ needs.setup.outputs.ref }} + ref: ${{ needs.setup.outputs.sha }} - name: Install Rust + dependencies run: | @@ -124,7 +155,7 @@ jobs: ./scripts/localnet.sh False --build-only fi - # Use `ci_target` because .dockerignore excludes `target`. + # Use ci_target because .dockerignore excludes target. - name: Prepare artifacts for upload run: | RUNTIME="${{ matrix.runtime }}" @@ -142,28 +173,71 @@ jobs: path: build/ if-no-files-found: error - # Collect all binaries and publish the multi-arch image. - docker: + # Package and test each native architecture before pushing that exact image. + # The amd64 runner also exercises the public compatibility contract: + # True/False, both RPC ports, graceful stop, health, and --no-purge + # persistence. + validate-image: + name: Image smoke test • ${{ matrix.platform.arch }} needs: [setup, artifacts] - runs-on: [self-hosted, fireactions-turbo-8] + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + platform: + - runner: [self-hosted, fireactions-turbo-8] + triple: x86_64-unknown-linux-gnu + arch: amd64 + - runner: [ubuntu-24.04-arm] + triple: aarch64-unknown-linux-gnu + arch: arm64 + runs-on: ${{ matrix.platform.runner }} steps: - uses: actions/checkout@v4 with: - ref: ${{ needs.setup.outputs.ref }} + ref: ${{ needs.setup.outputs.sha }} - - name: Download all binary artifacts + - name: Download architecture artifacts uses: actions/download-artifact@v5 with: - pattern: binaries-* + pattern: binaries-${{ matrix.platform.triple }}-* path: build/ merge-multiple: true - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Build native image + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile-localnet + target: subtensor-localnet-prebuilt + platforms: linux/${{ matrix.platform.arch }} + load: true + # Run-scoped tags retain the platform manifests in GHCR. Only the + # immutable digests recorded below are used for final publication. + tags: ${{ needs.setup.outputs.image }}:build-${{ needs.setup.outputs.publication_id }}-${{ matrix.platform.arch }} + labels: | + org.opencontainers.image.revision=${{ needs.setup.outputs.sha }} + org.opencontainers.image.version=${{ needs.setup.outputs.tag }} + + - name: Verify architecture and bundled binaries + env: + PLATFORM_IMAGE: ${{ needs.setup.outputs.image }}:build-${{ needs.setup.outputs.publication_id }}-${{ matrix.platform.arch }} + run: | + test "$(docker image inspect "$PLATFORM_IMAGE" --format '{{.Architecture}}')" = "${{ matrix.platform.arch }}" + test "$(docker image inspect "$PLATFORM_IMAGE" --format '{{index .Config.Labels "org.opencontainers.image.title"}}')" = "Subtensor Localnet" + test "$(docker image inspect "$PLATFORM_IMAGE" --format '{{index .Config.Labels "org.opencontainers.image.description"}}')" = "Subtensor local development network for CI and local testing" + test "$(docker image inspect "$PLATFORM_IMAGE" --format '{{index .Config.Labels "org.opencontainers.image.source"}}')" = "https://github.com/RaoFoundation/subtensor" + test "$(docker image inspect "$PLATFORM_IMAGE" --format '{{index .Config.Labels "org.opencontainers.image.licenses"}}')" = "Apache-2.0" + docker run --rm --entrypoint /target/fast-runtime/release/node-subtensor "$PLATFORM_IMAGE" --help + docker run --rm --entrypoint /target/non-fast-runtime/release/node-subtensor "$PLATFORM_IMAGE" --help + + - name: Exercise localnet compatibility contract + if: ${{ matrix.platform.arch == 'amd64' }} + run: ./.github/scripts/test-localnet-image.sh "${{ needs.setup.outputs.image }}:build-${{ needs.setup.outputs.publication_id }}-amd64" + - name: Login to GHCR uses: docker/login-action@v3 with: @@ -171,19 +245,119 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Determine image name - # Docker requires lowercase image names; github.repository is RaoFoundation/subtensor - run: echo "image=ghcr.io/${GITHUB_REPOSITORY,,}-localnet" >> $GITHUB_ENV + - name: Push tested platform image + env: + IMAGE: ${{ needs.setup.outputs.image }} + PLATFORM_IMAGE: ${{ needs.setup.outputs.image }}:build-${{ needs.setup.outputs.publication_id }}-${{ matrix.platform.arch }} + ARCH: ${{ matrix.platform.arch }} + run: | + docker push "$PLATFORM_IMAGE" + manifest="$(docker buildx imagetools inspect "$PLATFORM_IMAGE" --format '{{json .Manifest}}')" + digest="$(jq -er '.digest | select(test("^sha256:[0-9a-f]{64}$"))' <<<"$manifest")" + mkdir -p image-descriptors + printf '%s@%s\n' "$IMAGE" "$digest" > "image-descriptors/$ARCH.txt" - - name: Build and push - uses: docker/build-push-action@v6 + - name: Upload tested image descriptor + uses: actions/upload-artifact@v4 with: - context: . - file: Dockerfile-localnet - build-args: | - BUILT_IN_CI="Boom shakalaka" - push: true - platforms: linux/amd64,linux/arm64 - tags: | - ${{ env.image }}:${{ needs.setup.outputs.tag }} - ${{ needs.setup.outputs.latest_tag == 'true' && format('{0}:latest', env.image) || '' }} + name: localnet-image-${{ needs.setup.outputs.publication_id }}-${{ matrix.platform.arch }} + path: image-descriptors/${{ matrix.platform.arch }}.txt + if-no-files-found: error + + # Publish a multi-architecture manifest composed only of the platform images + # that passed the smoke tests above. + docker: + needs: [setup, validate-image] + runs-on: [self-hosted, fireactions-turbo-8] + steps: + # Publication tooling belongs to the workflow revision, not the selected + # application source. Manual runs may intentionally build an older ref or + # a PR whose copy of this script is missing or incompatible. + - name: Check out publication tooling + uses: actions/checkout@v4 + with: + ref: ${{ github.workflow_sha }} + + - name: Download tested image descriptors + uses: actions/download-artifact@v5 + with: + pattern: localnet-image-${{ needs.setup.outputs.publication_id }}-* + path: image-descriptors/ + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish tested image manifest + env: + IMAGE: ${{ needs.setup.outputs.image }} + TAG: ${{ needs.setup.outputs.tag }} + SHA: ${{ needs.setup.outputs.sha }} + PUBLISH_LATEST: ${{ needs.setup.outputs.latest_tag }} + run: ./.github/scripts/publish-localnet-manifest.sh image-descriptors + + # CI consumers pull anonymously. A successful authenticated push is not + # sufficient: fail if package visibility regresses to private. + verify-public: + needs: [setup, docker] + runs-on: ubuntu-latest + steps: + - name: Verify anonymous pulls + env: + IMAGE: ${{ needs.setup.outputs.image }} + REPOSITORY: ${{ needs.setup.outputs.repository }} + TAG: ${{ needs.setup.outputs.tag }} + SHA: ${{ needs.setup.outputs.sha }} + VERIFY_LATEST: ${{ needs.setup.outputs.latest_tag }} + run: | + DOCKER_CONFIG="$(mktemp -d)" + export DOCKER_CONFIG + tags=("$TAG" "sha-$SHA") + if [ "$VERIFY_LATEST" = true ]; then + tags+=(latest) + fi + + for tag in "${tags[@]}"; do + for attempt in {1..12}; do + if docker manifest inspect "$IMAGE:$tag" >/dev/null; then + break + fi + if [ "$attempt" -eq 12 ]; then + echo "Anonymous pull failed for $IMAGE:$tag" >&2 + exit 1 + fi + sleep 10 + done + done + + registry_token="$( + curl -fsSL --get \ + --data-urlencode "scope=repository:$REPOSITORY:pull" \ + https://ghcr.io/token \ + | jq -er '.token // .access_token' + )" + manifest="$( + curl -fsSL \ + -H "Authorization: Bearer $registry_token" \ + -H 'Accept: application/vnd.oci.image.index.v1+json' \ + "https://ghcr.io/v2/$REPOSITORY/manifests/$TAG" + )" + test "$(jq -r '.annotations["org.opencontainers.image.description"]' <<<"$manifest")" = \ + "Subtensor local development network for CI and local testing" + test "$(jq -r '.annotations["org.opencontainers.image.source"]' <<<"$manifest")" = \ + "https://github.com/RaoFoundation/subtensor" + test "$(jq -r '.annotations["org.opencontainers.image.licenses"]' <<<"$manifest")" = \ + "Apache-2.0" + + # Match the anonymous CI consumer path, including layer downloads + # and execution, rather than treating manifest visibility as enough. + docker pull "$IMAGE:$TAG" + docker run --rm --entrypoint /target/fast-runtime/release/node-subtensor \ + "$IMAGE:$TAG" --help >/dev/null diff --git a/.github/workflows/release-train.yml b/.github/workflows/release-train.yml index ce9885b7a2..868e236c19 100644 --- a/.github/workflows/release-train.yml +++ b/.github/workflows/release-train.yml @@ -13,6 +13,8 @@ name: Release Train # is force-updated to the deployed commit, so those branches always contain # the code running on the respective chain. The `mainnet` branch is updated # by watch-mainnet-release.yml once the multisig executes on chain. +# Moving a network mirror triggers both Docker publishers, updating the +# matching tags in the regular `subtensor` and `subtensor-localnet` packages. # Those branches are locked by the "network-branch-mirrors (CI only)" # repository ruleset; the only bypass actor is the network-branch-mirror-ci # deploy key (secret MIRROR_DEPLOY_KEY), so the mirror pushes go over SSH. @@ -172,9 +174,10 @@ jobs: [ "$chain" = "${{ needs.build.outputs.spec_version }}" ] || { echo "devnet still on $chain"; exit 1; } # Mirror: the devnet branch always points at the code now running on - # devnet. The branch is ruleset-locked; only the mirror deploy key may - # update it, so the push goes over SSH. Force push because deploys are - # not fast-forwards of the previous mirror. + # devnet. Its push event publishes both regular and localnet :devnet + # images from this exact commit. The branch is ruleset-locked; only the + # mirror deploy key may update it, so the push goes over SSH. Force push + # because deploys are not fast-forwards of the previous mirror. - name: Point devnet branch at deployed commit if: steps.guard.outputs.should_deploy == 'true' env: diff --git a/Cargo.lock b/Cargo.lock index debfc4538a..503ac43281 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2090,7 +2090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" dependencies = [ "memchr", - "regex-automata 0.4.11", + "regex-automata", "serde", ] @@ -4432,7 +4432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -8103,11 +8103,11 @@ dependencies = [ [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] @@ -8919,12 +8919,11 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.46.0" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "overload", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -9228,12 +9227,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "pallet-admin-utils" version = "4.0.0-dev" @@ -11264,7 +11257,7 @@ dependencies = [ "tle", "tracing", "tracing-log", - "tracing-subscriber 0.3.18", + "tracing-subscriber 0.3.20", "w3f-bls 0.1.3", ] @@ -13873,7 +13866,7 @@ dependencies = [ "rand 0.9.4", "rand_chacha 0.9.0", "rand_xorshift", - "regex-syntax 0.8.6", + "regex-syntax", "rusty-fork", "tempfile", "unarray", @@ -14445,17 +14438,8 @@ checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.11", - "regex-syntax 0.8.6", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] @@ -14466,15 +14450,9 @@ checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.6", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.6" @@ -14777,13 +14755,13 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.4.0" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d4c8b64f049c6721ec8ccec37ddfc3d641c4a7fca57e8f2a89de509c73df39" +checksum = "2da316a15f47e3d053de9cb2c439650bd8fa4aaeb9365f2e5f27f492ff73c196" dependencies = [ "libc", "rtoolbox", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -14975,7 +14953,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -16368,7 +16346,7 @@ dependencies = [ "thiserror 1.0.69", "tracing", "tracing-log", - "tracing-subscriber 0.3.18", + "tracing-subscriber 0.3.20", ] [[package]] @@ -18227,7 +18205,7 @@ dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber 0.3.18", + "tracing-subscriber 0.3.20", ] [[package]] @@ -19421,7 +19399,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix 1.1.2", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -19983,15 +19961,15 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" dependencies = [ "matchers", "nu-ansi-term", "once_cell", "parking_lot 0.12.5", - "regex", + "regex-automata", "sharded-slab", "smallvec", "thread_local", @@ -21115,7 +21093,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fc3d52547c..2de9093cbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,7 +108,7 @@ serde_with = { version = "3.14.0", default-features = false } smallvec = "1.13.2" tracing = "0.1" tracing-log = "0.2" -tracing-subscriber = { version = "=0.3.18" } +tracing-subscriber = { version = "=0.3.20" } litep2p = { git = "https://github.com/paritytech/litep2p", tag = "v0.7.0", default-features = false } syn = { version = "2.0.106", default-features = false } quote = { version = "1", default-features = false } diff --git a/Dockerfile-localnet b/Dockerfile-localnet index 1b2fee723b..3b4b3cd0e9 100644 --- a/Dockerfile-localnet +++ b/Dockerfile-localnet @@ -1,79 +1,119 @@ -ARG BASE_IMAGE=ubuntu:latest +# syntax=docker/dockerfile:1 -FROM $BASE_IMAGE AS builder +ARG BASE_IMAGE=ubuntu:24.04@sha256:4fbb8e6a8395de5a7550b33509421a2bafbc0aab6c06ba2cef9ebffbc7092d90 -SHELL ["/bin/bash", "-c"] +# Source builds remain the default for developers running: +# docker build -f Dockerfile-localnet . +FROM ${BASE_IMAGE} AS source-builder -# Set noninteractive mode for apt-get +SHELL ["/bin/bash", "-c"] ARG DEBIAN_FRONTEND=noninteractive -LABEL com.bittensor.image.authors="operations@bittensor.com" \ - com.bittensor.image.vendor="Rao Foundation" \ - com.bittensor.image.title="raofoundation/subtensor-localnet" \ - com.bittensor.image.description="Bittensor Subtensor Blockchain" \ - com.bittensor.image.documentation="https://bittensor.com/docs" - -# Copy repo first (you want this *before* RUN to enable layer cache reuse) COPY . /build WORKDIR /build -# Set up env var -ARG BUILT_IN_CI -ARG TARGETARCH - -ENV BUILT_IN_CI=${BUILT_IN_CI} -ENV RUST_BACKTRACE=1 -ENV PATH="/root/.cargo/bin:${PATH}" - -## Ubdate certificates -RUN apt-get update && apt-get install -y ca-certificates - -# Install requirements -RUN chmod +x ./scripts/install_build_env.sh -RUN ./scripts/install_build_env.sh - -## Build fast-runtime node +RUN chmod +x ./scripts/install_build_env.sh \ + && ./scripts/install_build_env.sh RUN ./scripts/localnet.sh --build-only -# Build non-fast-runtime RUN ./scripts/localnet.sh False --build-only -# We will prepare the necessary binaries if they are created in CI -RUN chmod +x ./scripts/install_prebuilt_binaries.sh -RUN ./scripts/install_prebuilt_binaries.sh +RUN test -x /build/target/fast-runtime/release/node-subtensor \ + && test -x /build/target/non-fast-runtime/release/node-subtensor -# Verify the binaries was produced -RUN test -e /build/target/fast-runtime/release/node-subtensor -RUN test -e /build/target/non-fast-runtime/release/node-subtensor +# CI already compiles architecture-specific binaries on native runners. This +# stage only normalizes the downloaded artifacts into the layout used by the +# final image, avoiding a second Rust toolchain install inside Docker. +FROM ${BASE_IMAGE} AS prebuilt-artifacts -FROM $BASE_IMAGE AS subtensor-localnet - -# Copy binaries -COPY --from=builder /build/target/fast-runtime/release/node-subtensor target/fast-runtime/release/node-subtensor -RUN chmod +x target/fast-runtime/release/node-subtensor +SHELL ["/bin/bash", "-c"] +ARG TARGETARCH +ENV BUILT_IN_CI=1 -COPY --from=builder /build/target/non-fast-runtime/release/node-subtensor target/non-fast-runtime/release/node-subtensor -RUN chmod +x target/non-fast-runtime/release/node-subtensor +WORKDIR /build +COPY ./build/ ./build/ +COPY ./scripts/install_prebuilt_binaries.sh ./scripts/install_prebuilt_binaries.sh +RUN chmod +x ./scripts/install_prebuilt_binaries.sh \ + && ./scripts/install_prebuilt_binaries.sh -COPY --from=builder /build/snapshot.json /snapshot.json +RUN test -x /build/target/fast-runtime/release/node-subtensor \ + && test -x /build/target/non-fast-runtime/release/node-subtensor -COPY --from=builder /build/scripts/localnet.sh scripts/localnet.sh -RUN chmod +x /scripts/localnet.sh +FROM ${BASE_IMAGE} AS runtime-base -# Copy WebAssembly artifacts -COPY --from=builder /build/target/fast-runtime/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm target/fast-runtime/release/node_subtensor_runtime.compact.compressed.wasm -COPY --from=builder /build/target/non-fast-runtime/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm target/non-fast-runtime/release/node_subtensor_runtime.compact.compressed.wasm +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH -# Update certificates for next layer -RUN apt-get update && apt-get install -y ca-certificates +LABEL com.bittensor.image.authors="operations@bittensor.com" \ + com.bittensor.image.vendor="Rao Foundation" \ + com.bittensor.image.title="raofoundation/subtensor-localnet" \ + com.bittensor.image.description="Bittensor Subtensor local development network" \ + com.bittensor.image.documentation="https://bittensor.com/docs" \ + org.opencontainers.image.authors="operations@bittensor.com" \ + org.opencontainers.image.vendor="Rao Foundation" \ + org.opencontainers.image.title="Subtensor Localnet" \ + org.opencontainers.image.description="Subtensor local development network for CI and local testing" \ + org.opencontainers.image.source="https://github.com/RaoFoundation/subtensor" \ + org.opencontainers.image.url="https://github.com/RaoFoundation/subtensor/pkgs/container/subtensor-localnet" \ + org.opencontainers.image.documentation="https://github.com/RaoFoundation/subtensor/blob/main/docs/guides/local-development.mdx" \ + org.opencontainers.image.licenses="Apache-2.0" + +RUN set -eu; \ + if [ "${TARGETARCH}" = "arm64" ]; then \ + for sources in /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources; do \ + [ ! -f "${sources}" ] || sed -i \ + 's|http://ports.ubuntu.com/ubuntu-ports|http://ftp.kaist.ac.kr/ubuntu-ports|g' \ + "${sources}"; \ + done; \ + fi; \ + apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update; \ + apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true install -y ca-certificates; \ + if [ "${TARGETARCH}" = "arm64" ]; then \ + for sources in /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources; do \ + [ ! -f "${sources}" ] || sed -i \ + 's|http://ftp.kaist.ac.kr/ubuntu-ports|https://ftp.kaist.ac.kr/ubuntu-ports|g' \ + "${sources}"; \ + done; \ + apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update; \ + fi; \ + apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true install -y --no-install-recommends curl procps; \ + rm -rf /var/lib/apt/lists/* + +COPY ./snapshot.json /snapshot.json +COPY --chmod=0755 ./scripts/localnet.sh /scripts/localnet.sh +COPY --chmod=0755 ./scripts/localnet_healthcheck.sh /scripts/localnet_healthcheck.sh +RUN mkdir -p /scripts/specs -# Do not build (just run) ENV BUILD_BINARY=0 -# Switch to local run with IP 0.0.0.0 within docker image ENV RUN_IN_DOCKER=1 -# Expose ports -EXPOSE 30334 30335 9944 9945 + +EXPOSE 30334 30335 30336 9944 9945 9946 + +HEALTHCHECK --interval=5s --timeout=3s --start-period=90s --retries=6 \ + CMD ["/scripts/localnet_healthcheck.sh"] ENTRYPOINT ["/scripts/localnet.sh"] -# Fast blocks defaults to True, you can disable it by passing False to the docker command, e.g.: -# docker run ghcr.io/raofoundation/subtensor-localnet False +# Fast blocks remain the default. Pass False for the standard 12-second runtime. CMD ["True"] + +# CI target: package binaries produced by docker-localnet.yml. +FROM runtime-base AS subtensor-localnet-prebuilt + +COPY --from=prebuilt-artifacts /build/target/fast-runtime/release/node-subtensor /target/fast-runtime/release/node-subtensor +COPY --from=prebuilt-artifacts /build/target/non-fast-runtime/release/node-subtensor /target/non-fast-runtime/release/node-subtensor +COPY --from=prebuilt-artifacts /build/target/fast-runtime/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm /target/fast-runtime/release/node_subtensor_runtime.compact.compressed.wasm +COPY --from=prebuilt-artifacts /build/target/non-fast-runtime/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm /target/non-fast-runtime/release/node_subtensor_runtime.compact.compressed.wasm + +RUN chmod +x /target/fast-runtime/release/node-subtensor \ + /target/non-fast-runtime/release/node-subtensor + +# Developer target: package binaries compiled by source-builder. Keep this +# target last so a target-less local docker build retains its historic behavior. +FROM runtime-base AS subtensor-localnet + +COPY --from=source-builder /build/target/fast-runtime/release/node-subtensor /target/fast-runtime/release/node-subtensor +COPY --from=source-builder /build/target/non-fast-runtime/release/node-subtensor /target/non-fast-runtime/release/node-subtensor +COPY --from=source-builder /build/target/fast-runtime/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm /target/fast-runtime/release/node_subtensor_runtime.compact.compressed.wasm +COPY --from=source-builder /build/target/non-fast-runtime/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm /target/non-fast-runtime/release/node_subtensor_runtime.compact.compressed.wasm + +RUN chmod +x /target/fast-runtime/release/node-subtensor \ + /target/non-fast-runtime/release/node-subtensor diff --git a/README.md b/README.md index a280f52ac2..c7d2bbb021 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,12 @@ docker run --rm --name local_chain \ ghcr.io/raofoundation/subtensor-localnet:devnet ``` +Use `:testnet` for the commit deployed to testnet or `:main` for the current +main-branch candidate; `:latest` is an alias for `:main`. The `:devnet` and +`:testnet` tags move only after the release train verifies that commit on the +corresponding live network. Immutable `:sha-` tags are also published +for reproducible CI. + Then connect with `btcli --network local query is-fast-blocks` or `bittensor.Client("local")`. See [local development](https://bittensor.com/docs/guides/local-development) diff --git a/docs/guides/evm/index.mdx b/docs/guides/evm/index.mdx index 2ef04ed9ca..fe8b98aa01 100644 --- a/docs/guides/evm/index.mdx +++ b/docs/guides/evm/index.mdx @@ -339,6 +339,7 @@ index `2053` → `0x…0805`): | proxy | 2059 | `0x80b` | Proxy delegations. | | address-mapping | 2060 | `0x80c` | On-chain h160 → mirror bytes32. | | voting-power | 2061 | `0x80d` | Validator voting power (stake EMA) per subnet. | +| balance | 2062 | `0x80e` | Free TAO balance for any ss58 coldkey. | | ed25519-verify | 1026 | `0x402` | Verify ed25519 (prove ss58 ownership). | | sr25519-verify | 1027 | `0x403` | Verify sr25519. | diff --git a/docs/guides/evm/read-chain-state.mdx b/docs/guides/evm/read-chain-state.mdx index f4412d67f8..98a85c959e 100644 --- a/docs/guides/evm/read-chain-state.mdx +++ b/docs/guides/evm/read-chain-state.mdx @@ -1,6 +1,6 @@ --- title: Read chain state -description: The metagraph, alpha, and uid-lookup precompiles — free view calls from the CLI, Python, and Solidity. +description: The metagraph, alpha, uid-lookup, and balance precompiles — free view calls from the CLI, Python, and Solidity. --- Everything a subnet dashboard needs — stake, incentive, axon endpoints, pool @@ -75,6 +75,18 @@ key?" — it only returns results for hotkeys that have btcli evm call uid-lookup uidLookup 1 0x1074Ad… 16 # up to 16 (uid, block_associated) pairs ``` +## Coldkey free balances + +`balance` (address `0x…080e`) reads any native ss58 account's free TAO +balance. Like other key-shaped precompile arguments, Solidity passes the raw +32-byte public key and the CLI accepts ss58 directly: + +```bash +btcli evm call balance getFreeBalance 5F... +``` + +The return value is rao. + ## From Python The SDK's EVM layer encodes and decodes for you — this is exactly what diff --git a/docs/guides/local-development.mdx b/docs/guides/local-development.mdx index 15ea187d68..9fcf3a2ed1 100644 --- a/docs/guides/local-development.mdx +++ b/docs/guides/local-development.mdx @@ -16,9 +16,34 @@ docker run --rm --name local_chain \ ``` Append `False` to the command to run real 12-second blocks instead of the -default fast-blocks mode (0.25 s). `--rm` discards chain state when the -container exits; omit it to persist state across restarts. Re-pull the image -regularly — it tracks mainnet behavior. +default fast-blocks mode (0.25 s). + +Choose the image tag for the code you need to test: + +| Tag | Source | +| --- | --- | +| `devnet` | Exact commit deployed to devnet (the `devnet` mirror branch) | +| `testnet` | Exact commit deployed to testnet (the `testnet` mirror branch) | +| `main` / `latest` | Current `main` branch candidate | +| `sha-` | Immutable commit build for reproducible CI | +| `v` | Immutable mainnet release build | + +The three branch tags are deliberately independent because a candidate moves +through the networks in stages. The release train updates `devnet` or `testnet` +only after verifying the new runtime on that live network; those mirror pushes +publish the corresponding image tags. Re-pull a moving tag before testing +changes that landed since your last run. + +To keep chain state, mount `/tmp` and pass `--no-purge` when starting a new +container from that volume: + +```bash +docker volume create subtensor-localnet-data +docker run --rm --name local_chain \ + -p 9944:9944 -p 9945:9945 \ + -v subtensor-localnet-data:/tmp \ + ghcr.io/raofoundation/subtensor-localnet:devnet True --no-purge +``` A fresh localnet ships with subnet 0 (root) and subnet 1 already created. diff --git a/docs/internals/release-process.mdx b/docs/internals/release-process.mdx index 4c886ba6f1..a9cab71cff 100644 --- a/docs/internals/release-process.mdx +++ b/docs/internals/release-process.mdx @@ -53,10 +53,12 @@ Human approval lives in GitHub **environment settings**, not workflow code: Deploys to devnet and testnet are direct `setCode` transactions via the CI deploy key. After the on-chain `spec_version` is verified, the train moves the -corresponding network mirror branch. That branch push builds the exact deployed -commit and updates `ghcr.io/raofoundation/subtensor:devnet` or `:testnet`; it -does not move `:latest`. The smoke suite then validates the live network while -the independent image build runs. +corresponding network mirror branch. That branch push triggers both Docker +publishers from the exact deployed commit, updating the matching `:devnet` or +`:testnet` tag in `ghcr.io/raofoundation/subtensor` and +`ghcr.io/raofoundation/subtensor-localnet`. It does not move either package's +`:latest` tag. The smoke suite then validates the live network while the +independent image builds run. ### The mainnet multisig ceremony @@ -90,7 +92,9 @@ mainnet*, not what was merged. The watcher explicitly dispatches `docker.yml` and `docker-localnet.yml` because releases created with the default `GITHUB_TOKEN` do not emit another workflow event. The production build publishes both the immutable release tag -and `:latest`; the localnet build does the same in its separate package. +and `:latest`. The localnet build publishes the immutable release tag in its +separate package; localnet `:latest` remains an alias for the current `:main` +branch image, while `:devnet` and `:testnet` follow their respective branches. ## Hotfixes diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index f4cb6c0534..dc34a29433 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -181,6 +181,8 @@ pub mod pallet { AddressMapping, /// Voting power precompile VotingPower, + /// Account balance precompile + AccountBalance, } #[pallet::type_value] diff --git a/pallets/admin-utils/src/weights.rs b/pallets/admin-utils/src/weights.rs index 7bb37a0f6b..5ea4c4cdd4 100644 --- a/pallets/admin-utils/src/weights.rs +++ b/pallets/admin-utils/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_admin_utils` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.iZ25wt3jLL +// --output=/tmp/tmp.iJZ8rYougD // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -107,10 +107,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_704_000 picoseconds. - Weight::from_parts(3_487_558, 0) - // Standard Error: 756 - .saturating_add(Weight::from_parts(27_376, 0).saturating_mul(a.into())) + // Minimum execution time: 4_007_000 picoseconds. + Weight::from_parts(4_721_714, 0) + // Standard Error: 732 + .saturating_add(Weight::from_parts(25_072, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -120,10 +120,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `174` // Estimated: `2779` - // Minimum execution time: 6_289_000 picoseconds. - Weight::from_parts(6_680_485, 2779) - // Standard Error: 2_123 - .saturating_add(Weight::from_parts(36_625, 0).saturating_mul(a.into())) + // Minimum execution time: 7_444_000 picoseconds. + Weight::from_parts(8_055_222, 2779) + // Standard Error: 917 + .saturating_add(Weight::from_parts(18_955, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -133,8 +133,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_985_000 picoseconds. - Weight::from_parts(4_367_000, 0) + // Minimum execution time: 5_330_000 picoseconds. + Weight::from_parts(5_691_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -151,8 +151,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `747` // Estimated: `4212` - // Minimum execution time: 25_689_000 picoseconds. - Weight::from_parts(26_840_000, 4212) + // Minimum execution time: 27_211_000 picoseconds. + Weight::from_parts(28_163_000, 4212) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -172,8 +172,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_828_000 picoseconds. - Weight::from_parts(32_569_000, 4383) + // Minimum execution time: 32_972_000 picoseconds. + Weight::from_parts(34_014_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -193,8 +193,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_868_000 picoseconds. - Weight::from_parts(32_418_000, 4383) + // Minimum execution time: 32_831_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -206,8 +206,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_081_000 picoseconds. - Weight::from_parts(14_702_000, 4084) + // Minimum execution time: 15_810_000 picoseconds. + Weight::from_parts(16_350_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -227,8 +227,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_597_000 picoseconds. - Weight::from_parts(32_969_000, 4383) + // Minimum execution time: 32_982_000 picoseconds. + Weight::from_parts(34_094_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -248,8 +248,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_847_000 picoseconds. - Weight::from_parts(32_338_000, 4383) + // Minimum execution time: 32_911_000 picoseconds. + Weight::from_parts(33_944_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -269,8 +269,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_376_000 picoseconds. - Weight::from_parts(32_368_000, 4383) + // Minimum execution time: 33_082_000 picoseconds. + Weight::from_parts(33_894_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -292,8 +292,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_999_000 picoseconds. - Weight::from_parts(34_020_000, 4383) + // Minimum execution time: 34_535_000 picoseconds. + Weight::from_parts(35_477_000, 4383) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -313,8 +313,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_427_000 picoseconds. - Weight::from_parts(32_108_000, 4383) + // Minimum execution time: 33_062_000 picoseconds. + Weight::from_parts(33_974_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -326,8 +326,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_411_000 picoseconds. - Weight::from_parts(15_113_000, 4084) + // Minimum execution time: 16_090_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -347,8 +347,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_497_000 picoseconds. - Weight::from_parts(32_499_000, 4383) + // Minimum execution time: 33_452_000 picoseconds. + Weight::from_parts(34_194_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -370,35 +370,20 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_479_000 picoseconds. - Weight::from_parts(33_660_000, 4383) + // Minimum execution time: 33_753_000 picoseconds. + Weight::from_parts(34_805_000, 4383) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Tempo` (r:1 w:0) - /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) - /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) - /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) - /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) - /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ActivityCutoffFactorMilli` (r:0 w:1) /// Proof: `SubtensorModule::ActivityCutoffFactorMilli` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_activity_cutoff_factor() -> Weight { // Proof Size summary in bytes: - // Measured: `899` - // Estimated: `4364` - // Minimum execution time: 36_214_000 picoseconds. - Weight::from_parts(37_446_000, 4364) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_993_000 picoseconds. + Weight::from_parts(7_354_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -416,8 +401,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 28_883_000 picoseconds. - Weight::from_parts(29_804_000, 4383) + // Minimum execution time: 29_966_000 picoseconds. + Weight::from_parts(30_948_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -429,8 +414,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_261_000 picoseconds. - Weight::from_parts(14_812_000, 4084) + // Minimum execution time: 16_040_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -454,8 +439,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 35_522_000 picoseconds. - Weight::from_parts(67_971_000, 4383) + // Minimum execution time: 35_977_000 picoseconds. + Weight::from_parts(37_299_000, 4383) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -481,8 +466,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4433` - // Minimum execution time: 39_689_000 picoseconds. - Weight::from_parts(45_167_000, 4433) + // Minimum execution time: 41_067_000 picoseconds. + Weight::from_parts(42_269_000, 4433) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -502,8 +487,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_617_000 picoseconds. - Weight::from_parts(32_718_000, 4383) + // Minimum execution time: 32_721_000 picoseconds. + Weight::from_parts(33_793_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -523,8 +508,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_998_000 picoseconds. - Weight::from_parts(33_079_000, 4383) + // Minimum execution time: 32_601_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -544,8 +529,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_697_000 picoseconds. - Weight::from_parts(32_969_000, 4383) + // Minimum execution time: 33_112_000 picoseconds. + Weight::from_parts(33_784_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -567,8 +552,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `945` // Estimated: `4410` - // Minimum execution time: 34_311_000 picoseconds. - Weight::from_parts(35_714_000, 4410) + // Minimum execution time: 36_247_000 picoseconds. + Weight::from_parts(36_978_000, 4410) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -590,8 +575,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `920` // Estimated: `4385` - // Minimum execution time: 35_012_000 picoseconds. - Weight::from_parts(36_024_000, 4385) + // Minimum execution time: 35_867_000 picoseconds. + Weight::from_parts(37_510_000, 4385) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -601,10 +586,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_177_000 picoseconds. - Weight::from_parts(5_618_000, 0) + // Minimum execution time: 6_752_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Tempo` (r:1 w:1) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) @@ -613,16 +602,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TransactionKeyLastBlock` (r:1 w:1) + /// Proof: `SubtensorModule::TransactionKeyLastBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_tempo() -> Weight { // Proof Size summary in bytes: - // Measured: `918` - // Estimated: `4383` - // Minimum execution time: 32_889_000 picoseconds. - Weight::from_parts(34_191_000, 4383) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `975` + // Estimated: `4440` + // Minimum execution time: 45_966_000 picoseconds. + Weight::from_parts(47_038_000, 4440) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -640,8 +629,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_028_000 picoseconds. - Weight::from_parts(32_819_000, 4383) + // Minimum execution time: 33_763_000 picoseconds. + Weight::from_parts(34_514_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -661,8 +650,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_827_000 picoseconds. - Weight::from_parts(32_549_000, 4383) + // Minimum execution time: 33_242_000 picoseconds. + Weight::from_parts(33_914_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -672,8 +661,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_547_000 picoseconds. - Weight::from_parts(4_877_000, 0) + // Minimum execution time: 5_971_000 picoseconds. + Weight::from_parts(6_352_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -682,16 +671,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_226_000 picoseconds. - Weight::from_parts(4_507_000, 0) + // Minimum execution time: 5_360_000 picoseconds. + Weight::from_parts(5_720_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn sudo_set_total_issuance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_068_000 picoseconds. - Weight::from_parts(5_478_000, 0) + // Minimum execution time: 5_790_000 picoseconds. + Weight::from_parts(6_021_000, 0) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -701,8 +690,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_502_000 picoseconds. - Weight::from_parts(15_423_000, 4084) + // Minimum execution time: 15_869_000 picoseconds. + Weight::from_parts(16_370_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -712,8 +701,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_196_000 picoseconds. - Weight::from_parts(4_467_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_661_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -728,8 +717,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `950` // Estimated: `6890` - // Minimum execution time: 26_730_000 picoseconds. - Weight::from_parts(28_011_000, 6890) + // Minimum execution time: 29_785_000 picoseconds. + Weight::from_parts(30_577_000, 6890) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -739,8 +728,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(4_506_000, 0) + // Minimum execution time: 5_561_000 picoseconds. + Weight::from_parts(5_721_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -749,8 +738,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_186_000 picoseconds. - Weight::from_parts(4_426_000, 0) + // Minimum execution time: 5_410_000 picoseconds. + Weight::from_parts(5_671_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -773,8 +762,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `954` // Estimated: `4419` - // Minimum execution time: 35_232_000 picoseconds. - Weight::from_parts(36_064_000, 4419) + // Minimum execution time: 36_419_000 picoseconds. + Weight::from_parts(37_621_000, 4419) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -792,8 +781,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 23_344_000 picoseconds. - Weight::from_parts(24_347_000, 4280) + // Minimum execution time: 24_436_000 picoseconds. + Weight::from_parts(25_598_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -813,8 +802,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `962` // Estimated: `4427` - // Minimum execution time: 31_607_000 picoseconds. - Weight::from_parts(32_268_000, 4427) + // Minimum execution time: 33_122_000 picoseconds. + Weight::from_parts(33_783_000, 4427) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -824,8 +813,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(4_406_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_791_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -834,8 +823,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_127_000 picoseconds. - Weight::from_parts(4_466_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_760_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -844,8 +833,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_016_000 picoseconds. - Weight::from_parts(4_446_000, 0) + // Minimum execution time: 5_240_000 picoseconds. + Weight::from_parts(5_660_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -862,8 +851,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 25_828_000 picoseconds. - Weight::from_parts(26_610_000, 4280) + // Minimum execution time: 27_180_000 picoseconds. + Weight::from_parts(28_282_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -873,8 +862,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 5_238_000 picoseconds. - Weight::from_parts(5_649_000, 3507) + // Minimum execution time: 6_051_000 picoseconds. + Weight::from_parts(6_202_000, 3507) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -883,8 +872,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_073_000 picoseconds. - Weight::from_parts(2_333_000, 0) + // Minimum execution time: 2_875_000 picoseconds. + Weight::from_parts(2_985_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -893,8 +882,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_945_000 picoseconds. - Weight::from_parts(3_335_000, 0) + // Minimum execution time: 3_877_000 picoseconds. + Weight::from_parts(4_238_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -913,8 +902,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 28_973_000 picoseconds. - Weight::from_parts(29_784_000, 4383) + // Minimum execution time: 29_776_000 picoseconds. + Weight::from_parts(30_897_000, 4383) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -932,8 +921,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 26_018_000 picoseconds. - Weight::from_parts(26_799_000, 4280) + // Minimum execution time: 27_751_000 picoseconds. + Weight::from_parts(28_463_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -951,8 +940,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 27_461_000 picoseconds. - Weight::from_parts(28_272_000, 4280) + // Minimum execution time: 29_636_000 picoseconds. + Weight::from_parts(30_025_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -964,8 +953,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_352_000 picoseconds. - Weight::from_parts(15_062_000, 4084) + // Minimum execution time: 15_900_000 picoseconds. + Weight::from_parts(16_401_000, 4084) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -979,8 +968,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `712` // Estimated: `4177` - // Minimum execution time: 23_185_000 picoseconds. - Weight::from_parts(24_186_000, 4177) + // Minimum execution time: 24_415_000 picoseconds. + Weight::from_parts(25_167_000, 4177) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -998,8 +987,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 23_295_000 picoseconds. - Weight::from_parts(24_196_000, 4280) + // Minimum execution time: 24_125_000 picoseconds. + Weight::from_parts(24_847_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1009,8 +998,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_176_000 picoseconds. - Weight::from_parts(4_457_000, 0) + // Minimum execution time: 5_500_000 picoseconds. + Weight::from_parts(5_731_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -1019,8 +1008,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_086_000 picoseconds. - Weight::from_parts(4_477_000, 0) + // Minimum execution time: 5_600_000 picoseconds. + Weight::from_parts(5_831_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1037,8 +1026,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 23_274_000 picoseconds. - Weight::from_parts(24_256_000, 4280) + // Minimum execution time: 24_045_000 picoseconds. + Weight::from_parts(24_967_000, 4280) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1062,8 +1051,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `933` // Estimated: `4398` - // Minimum execution time: 35_963_000 picoseconds. - Weight::from_parts(37_025_000, 4398) + // Minimum execution time: 36_298_000 picoseconds. + Weight::from_parts(37_260_000, 4398) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1073,8 +1062,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_157_000 picoseconds. - Weight::from_parts(5_839_000, 0) + // Minimum execution time: 6_904_000 picoseconds. + Weight::from_parts(7_203_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxEpochsPerBlock` (r:0 w:1) @@ -1083,8 +1072,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_106_000 picoseconds. - Weight::from_parts(4_437_000, 0) + // Minimum execution time: 5_460_000 picoseconds. + Weight::from_parts(5_740_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -1098,10 +1087,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_704_000 picoseconds. - Weight::from_parts(3_487_558, 0) - // Standard Error: 756 - .saturating_add(Weight::from_parts(27_376, 0).saturating_mul(a.into())) + // Minimum execution time: 4_007_000 picoseconds. + Weight::from_parts(4_721_714, 0) + // Standard Error: 732 + .saturating_add(Weight::from_parts(25_072, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Grandpa::PendingChange` (r:1 w:1) @@ -1111,10 +1100,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `174` // Estimated: `2779` - // Minimum execution time: 6_289_000 picoseconds. - Weight::from_parts(6_680_485, 2779) - // Standard Error: 2_123 - .saturating_add(Weight::from_parts(36_625, 0).saturating_mul(a.into())) + // Minimum execution time: 7_444_000 picoseconds. + Weight::from_parts(8_055_222, 2779) + // Standard Error: 917 + .saturating_add(Weight::from_parts(18_955, 0).saturating_mul(a.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1124,8 +1113,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_985_000 picoseconds. - Weight::from_parts(4_367_000, 0) + // Minimum execution time: 5_330_000 picoseconds. + Weight::from_parts(5_691_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1142,8 +1131,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `747` // Estimated: `4212` - // Minimum execution time: 25_689_000 picoseconds. - Weight::from_parts(26_840_000, 4212) + // Minimum execution time: 27_211_000 picoseconds. + Weight::from_parts(28_163_000, 4212) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1163,8 +1152,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_828_000 picoseconds. - Weight::from_parts(32_569_000, 4383) + // Minimum execution time: 32_972_000 picoseconds. + Weight::from_parts(34_014_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1184,8 +1173,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_868_000 picoseconds. - Weight::from_parts(32_418_000, 4383) + // Minimum execution time: 32_831_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1197,8 +1186,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_081_000 picoseconds. - Weight::from_parts(14_702_000, 4084) + // Minimum execution time: 15_810_000 picoseconds. + Weight::from_parts(16_350_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1218,8 +1207,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_597_000 picoseconds. - Weight::from_parts(32_969_000, 4383) + // Minimum execution time: 32_982_000 picoseconds. + Weight::from_parts(34_094_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1239,8 +1228,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_847_000 picoseconds. - Weight::from_parts(32_338_000, 4383) + // Minimum execution time: 32_911_000 picoseconds. + Weight::from_parts(33_944_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1260,8 +1249,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_376_000 picoseconds. - Weight::from_parts(32_368_000, 4383) + // Minimum execution time: 33_082_000 picoseconds. + Weight::from_parts(33_894_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1283,8 +1272,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_999_000 picoseconds. - Weight::from_parts(34_020_000, 4383) + // Minimum execution time: 34_535_000 picoseconds. + Weight::from_parts(35_477_000, 4383) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1304,8 +1293,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_427_000 picoseconds. - Weight::from_parts(32_108_000, 4383) + // Minimum execution time: 33_062_000 picoseconds. + Weight::from_parts(33_974_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1317,8 +1306,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_411_000 picoseconds. - Weight::from_parts(15_113_000, 4084) + // Minimum execution time: 16_090_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1338,8 +1327,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_497_000 picoseconds. - Weight::from_parts(32_499_000, 4383) + // Minimum execution time: 33_452_000 picoseconds. + Weight::from_parts(34_194_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1361,35 +1350,20 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_479_000 picoseconds. - Weight::from_parts(33_660_000, 4383) + // Minimum execution time: 33_753_000 picoseconds. + Weight::from_parts(34_805_000, 4383) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) - /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Tempo` (r:1 w:0) - /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) - /// Proof: `SubtensorModule::PendingEpochAt` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastEpochBlock` (r:1 w:0) - /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) - /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:1 w:0) - /// Proof: `SubtensorModule::OwnerHyperparamRateLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:1 w:1) - /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::ActivityCutoffFactorMilli` (r:0 w:1) /// Proof: `SubtensorModule::ActivityCutoffFactorMilli` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_activity_cutoff_factor() -> Weight { // Proof Size summary in bytes: - // Measured: `899` - // Estimated: `4364` - // Minimum execution time: 36_214_000 picoseconds. - Weight::from_parts(37_446_000, 4364) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_993_000 picoseconds. + Weight::from_parts(7_354_000, 0) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1407,8 +1381,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 28_883_000 picoseconds. - Weight::from_parts(29_804_000, 4383) + // Minimum execution time: 29_966_000 picoseconds. + Weight::from_parts(30_948_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1420,8 +1394,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_261_000 picoseconds. - Weight::from_parts(14_812_000, 4084) + // Minimum execution time: 16_040_000 picoseconds. + Weight::from_parts(16_591_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1445,8 +1419,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 35_522_000 picoseconds. - Weight::from_parts(67_971_000, 4383) + // Minimum execution time: 35_977_000 picoseconds. + Weight::from_parts(37_299_000, 4383) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1472,8 +1446,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4433` - // Minimum execution time: 39_689_000 picoseconds. - Weight::from_parts(45_167_000, 4433) + // Minimum execution time: 41_067_000 picoseconds. + Weight::from_parts(42_269_000, 4433) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1493,8 +1467,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_617_000 picoseconds. - Weight::from_parts(32_718_000, 4383) + // Minimum execution time: 32_721_000 picoseconds. + Weight::from_parts(33_793_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1514,8 +1488,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_998_000 picoseconds. - Weight::from_parts(33_079_000, 4383) + // Minimum execution time: 32_601_000 picoseconds. + Weight::from_parts(33_853_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1535,8 +1509,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_697_000 picoseconds. - Weight::from_parts(32_969_000, 4383) + // Minimum execution time: 33_112_000 picoseconds. + Weight::from_parts(33_784_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1558,8 +1532,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `945` // Estimated: `4410` - // Minimum execution time: 34_311_000 picoseconds. - Weight::from_parts(35_714_000, 4410) + // Minimum execution time: 36_247_000 picoseconds. + Weight::from_parts(36_978_000, 4410) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1581,8 +1555,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `920` // Estimated: `4385` - // Minimum execution time: 35_012_000 picoseconds. - Weight::from_parts(36_024_000, 4385) + // Minimum execution time: 35_867_000 picoseconds. + Weight::from_parts(37_510_000, 4385) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1592,10 +1566,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_177_000 picoseconds. - Weight::from_parts(5_618_000, 0) + // Minimum execution time: 6_752_000 picoseconds. + Weight::from_parts(7_163_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `SubtensorModule::SubnetOwner` (r:1 w:0) + /// Proof: `SubtensorModule::SubnetOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Tempo` (r:1 w:1) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::PendingEpochAt` (r:1 w:0) @@ -1604,16 +1582,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::LastEpochBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AdminFreezeWindow` (r:1 w:0) /// Proof: `SubtensorModule::AdminFreezeWindow` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TransactionKeyLastBlock` (r:1 w:1) + /// Proof: `SubtensorModule::TransactionKeyLastBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) fn sudo_set_tempo() -> Weight { // Proof Size summary in bytes: - // Measured: `918` - // Estimated: `4383` - // Minimum execution time: 32_889_000 picoseconds. - Weight::from_parts(34_191_000, 4383) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Measured: `975` + // Estimated: `4440` + // Minimum execution time: 45_966_000 picoseconds. + Weight::from_parts(47_038_000, 4440) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) /// Proof: `SubtensorModule::Tempo` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1631,8 +1609,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 32_028_000 picoseconds. - Weight::from_parts(32_819_000, 4383) + // Minimum execution time: 33_763_000 picoseconds. + Weight::from_parts(34_514_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1652,8 +1630,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 31_827_000 picoseconds. - Weight::from_parts(32_549_000, 4383) + // Minimum execution time: 33_242_000 picoseconds. + Weight::from_parts(33_914_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1663,8 +1641,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_547_000 picoseconds. - Weight::from_parts(4_877_000, 0) + // Minimum execution time: 5_971_000 picoseconds. + Weight::from_parts(6_352_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::TxRateLimit` (r:0 w:1) @@ -1673,16 +1651,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_226_000 picoseconds. - Weight::from_parts(4_507_000, 0) + // Minimum execution time: 5_360_000 picoseconds. + Weight::from_parts(5_720_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn sudo_set_total_issuance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_068_000 picoseconds. - Weight::from_parts(5_478_000, 0) + // Minimum execution time: 5_790_000 picoseconds. + Weight::from_parts(6_021_000, 0) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1692,8 +1670,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_502_000 picoseconds. - Weight::from_parts(15_423_000, 4084) + // Minimum execution time: 15_869_000 picoseconds. + Weight::from_parts(16_370_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1703,8 +1681,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_196_000 picoseconds. - Weight::from_parts(4_467_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_661_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NominatorMinRequiredStake` (r:1 w:1) @@ -1719,8 +1697,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `950` // Estimated: `6890` - // Minimum execution time: 26_730_000 picoseconds. - Weight::from_parts(28_011_000, 6890) + // Minimum execution time: 29_785_000 picoseconds. + Weight::from_parts(30_577_000, 6890) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1730,8 +1708,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(4_506_000, 0) + // Minimum execution time: 5_561_000 picoseconds. + Weight::from_parts(5_721_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:0 w:1) @@ -1740,8 +1718,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_186_000 picoseconds. - Weight::from_parts(4_426_000, 0) + // Minimum execution time: 5_410_000 picoseconds. + Weight::from_parts(5_671_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1764,8 +1742,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `954` // Estimated: `4419` - // Minimum execution time: 35_232_000 picoseconds. - Weight::from_parts(36_064_000, 4419) + // Minimum execution time: 36_419_000 picoseconds. + Weight::from_parts(37_621_000, 4419) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1783,8 +1761,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 23_344_000 picoseconds. - Weight::from_parts(24_347_000, 4280) + // Minimum execution time: 24_436_000 picoseconds. + Weight::from_parts(25_598_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1804,8 +1782,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `962` // Estimated: `4427` - // Minimum execution time: 31_607_000 picoseconds. - Weight::from_parts(32_268_000, 4427) + // Minimum execution time: 33_122_000 picoseconds. + Weight::from_parts(33_783_000, 4427) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1815,8 +1793,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(4_406_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_791_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::ColdkeySwapReannouncementDelay` (r:0 w:1) @@ -1825,8 +1803,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_127_000 picoseconds. - Weight::from_parts(4_466_000, 0) + // Minimum execution time: 5_480_000 picoseconds. + Weight::from_parts(5_760_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::DissolveNetworkScheduleDuration` (r:0 w:1) @@ -1835,8 +1813,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_016_000 picoseconds. - Weight::from_parts(4_446_000, 0) + // Minimum execution time: 5_240_000 picoseconds. + Weight::from_parts(5_660_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1853,8 +1831,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 25_828_000 picoseconds. - Weight::from_parts(26_610_000, 4280) + // Minimum execution time: 27_180_000 picoseconds. + Weight::from_parts(28_282_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1864,8 +1842,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 5_238_000 picoseconds. - Weight::from_parts(5_649_000, 3507) + // Minimum execution time: 6_051_000 picoseconds. + Weight::from_parts(6_202_000, 3507) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `SubtensorModule::SubnetMovingAlpha` (r:0 w:1) @@ -1874,8 +1852,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_073_000 picoseconds. - Weight::from_parts(2_333_000, 0) + // Minimum execution time: 2_875_000 picoseconds. + Weight::from_parts(2_985_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::EMAPriceHalvingBlocks` (r:0 w:1) @@ -1884,8 +1862,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_945_000 picoseconds. - Weight::from_parts(3_335_000, 0) + // Minimum execution time: 3_877_000 picoseconds. + Weight::from_parts(4_238_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -1904,8 +1882,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `918` // Estimated: `4383` - // Minimum execution time: 28_973_000 picoseconds. - Weight::from_parts(29_784_000, 4383) + // Minimum execution time: 29_776_000 picoseconds. + Weight::from_parts(30_897_000, 4383) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1923,8 +1901,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 26_018_000 picoseconds. - Weight::from_parts(26_799_000, 4280) + // Minimum execution time: 27_751_000 picoseconds. + Weight::from_parts(28_463_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1942,8 +1920,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 27_461_000 picoseconds. - Weight::from_parts(28_272_000, 4280) + // Minimum execution time: 29_636_000 picoseconds. + Weight::from_parts(30_025_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1955,8 +1933,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `619` // Estimated: `4084` - // Minimum execution time: 14_352_000 picoseconds. - Weight::from_parts(15_062_000, 4084) + // Minimum execution time: 15_900_000 picoseconds. + Weight::from_parts(16_401_000, 4084) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1970,8 +1948,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `712` // Estimated: `4177` - // Minimum execution time: 23_185_000 picoseconds. - Weight::from_parts(24_186_000, 4177) + // Minimum execution time: 24_415_000 picoseconds. + Weight::from_parts(25_167_000, 4177) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1989,8 +1967,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 23_295_000 picoseconds. - Weight::from_parts(24_196_000, 4280) + // Minimum execution time: 24_125_000 picoseconds. + Weight::from_parts(24_847_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2000,8 +1978,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_176_000 picoseconds. - Weight::from_parts(4_457_000, 0) + // Minimum execution time: 5_500_000 picoseconds. + Weight::from_parts(5_731_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::OwnerHyperparamRateLimit` (r:0 w:1) @@ -2010,8 +1988,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_086_000 picoseconds. - Weight::from_parts(4_477_000, 0) + // Minimum execution time: 5_600_000 picoseconds. + Weight::from_parts(5_831_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Tempo` (r:1 w:0) @@ -2028,8 +2006,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `815` // Estimated: `4280` - // Minimum execution time: 23_274_000 picoseconds. - Weight::from_parts(24_256_000, 4280) + // Minimum execution time: 24_045_000 picoseconds. + Weight::from_parts(24_967_000, 4280) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2053,8 +2031,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `933` // Estimated: `4398` - // Minimum execution time: 35_963_000 picoseconds. - Weight::from_parts(37_025_000, 4398) + // Minimum execution time: 36_298_000 picoseconds. + Weight::from_parts(37_260_000, 4398) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2064,8 +2042,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_157_000 picoseconds. - Weight::from_parts(5_839_000, 0) + // Minimum execution time: 6_904_000 picoseconds. + Weight::from_parts(7_203_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::MaxEpochsPerBlock` (r:0 w:1) @@ -2074,8 +2052,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_106_000 picoseconds. - Weight::from_parts(4_437_000, 0) + // Minimum execution time: 5_460_000 picoseconds. + Weight::from_parts(5_740_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallets/limit-orders/src/weights.rs b/pallets/limit-orders/src/weights.rs index 3d16cc4e1d..797cb99502 100644 --- a/pallets/limit-orders/src/weights.rs +++ b/pallets/limit-orders/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_limit_orders` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.JfNRyjjsii +// --output=/tmp/tmp.qHTE7glz7U // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -51,8 +51,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `66` // Estimated: `3522` - // Minimum execution time: 14_182_000 picoseconds. - Weight::from_parts(15_364_000, 3522) + // Minimum execution time: 15_910_000 picoseconds. + Weight::from_parts(16_471_000, 3522) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -62,8 +62,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_086_000 picoseconds. - Weight::from_parts(4_326_000, 0) + // Minimum execution time: 5_390_000 picoseconds. + Weight::from_parts(5_971_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `LimitOrders::LimitOrdersEnabled` (r:1 w:0) @@ -123,10 +123,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1134 + n * (283 ±0)` // Estimated: `6148 + n * (5158 ±0)` - // Minimum execution time: 609_778_000 picoseconds. - Weight::from_parts(131_333_347, 6148) - // Standard Error: 246_583 - .saturating_add(Weight::from_parts(528_445_964, 0).saturating_mul(n.into())) + // Minimum execution time: 595_817_000 picoseconds. + Weight::from_parts(64_792_249, 6148) + // Standard Error: 219_451 + .saturating_add(Weight::from_parts(522_317_121, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().reads((11_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(10_u64)) @@ -190,10 +190,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1263 + n * (283 ±0)` // Estimated: `8727 + n * (5158 ±0)` - // Minimum execution time: 761_717_000 picoseconds. - Weight::from_parts(471_602_079, 8727) - // Standard Error: 128_897 - .saturating_add(Weight::from_parts(260_747_527, 0).saturating_mul(n.into())) + // Minimum execution time: 747_041_000 picoseconds. + Weight::from_parts(510_366_410, 8727) + // Standard Error: 68_804 + .saturating_add(Weight::from_parts(255_380_520, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(25_u64)) .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(15_u64)) @@ -210,8 +210,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `66` // Estimated: `3522` - // Minimum execution time: 14_182_000 picoseconds. - Weight::from_parts(15_364_000, 3522) + // Minimum execution time: 15_910_000 picoseconds. + Weight::from_parts(16_471_000, 3522) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -221,8 +221,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_086_000 picoseconds. - Weight::from_parts(4_326_000, 0) + // Minimum execution time: 5_390_000 picoseconds. + Weight::from_parts(5_971_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `LimitOrders::LimitOrdersEnabled` (r:1 w:0) @@ -282,10 +282,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1134 + n * (283 ±0)` // Estimated: `6148 + n * (5158 ±0)` - // Minimum execution time: 609_778_000 picoseconds. - Weight::from_parts(131_333_347, 6148) - // Standard Error: 246_583 - .saturating_add(Weight::from_parts(528_445_964, 0).saturating_mul(n.into())) + // Minimum execution time: 595_817_000 picoseconds. + Weight::from_parts(64_792_249, 6148) + // Standard Error: 219_451 + .saturating_add(Weight::from_parts(522_317_121, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().reads((11_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(10_u64)) @@ -349,10 +349,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1263 + n * (283 ±0)` // Estimated: `8727 + n * (5158 ±0)` - // Minimum execution time: 761_717_000 picoseconds. - Weight::from_parts(471_602_079, 8727) - // Standard Error: 128_897 - .saturating_add(Weight::from_parts(260_747_527, 0).saturating_mul(n.into())) + // Minimum execution time: 747_041_000 picoseconds. + Weight::from_parts(510_366_410, 8727) + // Standard Error: 68_804 + .saturating_add(Weight::from_parts(255_380_520, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(25_u64)) .saturating_add(RocksDbWeight::get().reads((10_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(15_u64)) diff --git a/pallets/proxy/src/weights.rs b/pallets/proxy/src/weights.rs index d2be8ecfc6..253c64c795 100644 --- a/pallets/proxy/src/weights.rs +++ b/pallets/proxy/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_subtensor_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.93Cw4C1tKU +// --output=/tmp/tmp.RPRs7xwHCO // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -66,10 +66,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `637 + p * (37 ±0)` // Estimated: `4254 + p * (37 ±0)` - // Minimum execution time: 22_944_000 picoseconds. - Weight::from_parts(24_266_610, 4254) - // Standard Error: 3_455 - .saturating_add(Weight::from_parts(54_450, 0).saturating_mul(p.into())) + // Minimum execution time: 27_311_000 picoseconds. + Weight::from_parts(28_486_266, 4254) + // Standard Error: 3_449 + .saturating_add(Weight::from_parts(81_179, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) @@ -92,12 +92,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `894 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615 + a * (68 ±0) + p * (37 ±0)` - // Minimum execution time: 47_260_000 picoseconds. - Weight::from_parts(47_529_113, 8615) - // Standard Error: 1_955 - .saturating_add(Weight::from_parts(228_520, 0).saturating_mul(a.into())) - // Standard Error: 7_834 - .saturating_add(Weight::from_parts(91_082, 0).saturating_mul(p.into())) + // Minimum execution time: 53_721_000 picoseconds. + Weight::from_parts(54_823_542, 8615) + // Standard Error: 1_396 + .saturating_add(Weight::from_parts(227_680, 0).saturating_mul(a.into())) + // Standard Error: 5_594 + .saturating_add(Weight::from_parts(49_632, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 68).saturating_mul(a.into())) @@ -113,12 +113,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 22_794_000 picoseconds. - Weight::from_parts(23_443_735, 8615) - // Standard Error: 934 - .saturating_add(Weight::from_parts(195_425, 0).saturating_mul(a.into())) - // Standard Error: 3_742 - .saturating_add(Weight::from_parts(28_301, 0).saturating_mul(p.into())) + // Minimum execution time: 26_269_000 picoseconds. + Weight::from_parts(25_886_226, 8615) + // Standard Error: 1_243 + .saturating_add(Weight::from_parts(216_353, 0).saturating_mul(a.into())) + // Standard Error: 4_980 + .saturating_add(Weight::from_parts(48_789, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -132,12 +132,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 22_985_000 picoseconds. - Weight::from_parts(23_534_338, 8615) - // Standard Error: 780 - .saturating_add(Weight::from_parts(189_895, 0).saturating_mul(a.into())) - // Standard Error: 3_126 - .saturating_add(Weight::from_parts(28_011, 0).saturating_mul(p.into())) + // Minimum execution time: 26_179_000 picoseconds. + Weight::from_parts(27_149_127, 8615) + // Standard Error: 2_670 + .saturating_add(Weight::from_parts(206_147, 0).saturating_mul(a.into())) + // Standard Error: 10_696 + .saturating_add(Weight::from_parts(24_070, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -153,12 +153,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `308 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615` - // Minimum execution time: 30_425_000 picoseconds. - Weight::from_parts(30_524_921, 8615) - // Standard Error: 1_118 - .saturating_add(Weight::from_parts(199_090, 0).saturating_mul(a.into())) - // Standard Error: 4_480 - .saturating_add(Weight::from_parts(57_115, 0).saturating_mul(p.into())) + // Minimum execution time: 34_094_000 picoseconds. + Weight::from_parts(33_908_359, 8615) + // Standard Error: 1_874 + .saturating_add(Weight::from_parts(214_642, 0).saturating_mul(a.into())) + // Standard Error: 7_509 + .saturating_add(Weight::from_parts(69_223, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -169,10 +169,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 22_223_000 picoseconds. - Weight::from_parts(23_131_574, 4254) - // Standard Error: 1_846 - .saturating_add(Weight::from_parts(58_537, 0).saturating_mul(p.into())) + // Minimum execution time: 24_857_000 picoseconds. + Weight::from_parts(25_965_759, 4254) + // Standard Error: 2_416 + .saturating_add(Weight::from_parts(71_360, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -185,10 +185,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 23_755_000 picoseconds. - Weight::from_parts(24_906_155, 4254) - // Standard Error: 2_155 - .saturating_add(Weight::from_parts(60_029, 0).saturating_mul(p.into())) + // Minimum execution time: 26_770_000 picoseconds. + Weight::from_parts(28_059_742, 4254) + // Standard Error: 2_451 + .saturating_add(Weight::from_parts(63_593, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -199,10 +199,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 23_414_000 picoseconds. - Weight::from_parts(24_372_840, 4254) - // Standard Error: 2_319 - .saturating_add(Weight::from_parts(45_772, 0).saturating_mul(p.into())) + // Minimum execution time: 26_630_000 picoseconds. + Weight::from_parts(28_105_274, 4254) + // Standard Error: 2_597 + .saturating_add(Weight::from_parts(41_821, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -213,10 +213,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4254` - // Minimum execution time: 23_465_000 picoseconds. - Weight::from_parts(24_697_649, 4254) - // Standard Error: 2_033 - .saturating_add(Weight::from_parts(14_413, 0).saturating_mul(p.into())) + // Minimum execution time: 26_990_000 picoseconds. + Weight::from_parts(28_243_687, 4254) + // Standard Error: 2_975 + .saturating_add(Weight::from_parts(28_462, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -227,10 +227,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `156 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 22_614_000 picoseconds. - Weight::from_parts(23_662_943, 4254) - // Standard Error: 2_317 - .saturating_add(Weight::from_parts(38_167, 0).saturating_mul(p.into())) + // Minimum execution time: 26_230_000 picoseconds. + Weight::from_parts(27_299_094, 4254) + // Standard Error: 2_747 + .saturating_add(Weight::from_parts(38_537, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -244,8 +244,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `412` // Estimated: `8615` - // Minimum execution time: 42_253_000 picoseconds. - Weight::from_parts(43_064_000, 8615) + // Minimum execution time: 46_267_000 picoseconds. + Weight::from_parts(46_698_000, 8615) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -258,10 +258,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 11_637_000 picoseconds. - Weight::from_parts(12_193_545, 4254) - // Standard Error: 1_531 - .saturating_add(Weight::from_parts(34_642, 0).saturating_mul(p.into())) + // Minimum execution time: 14_176_000 picoseconds. + Weight::from_parts(14_886_579, 4254) + // Standard Error: 2_018 + .saturating_add(Weight::from_parts(45_475, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -282,10 +282,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `637 + p * (37 ±0)` // Estimated: `4254 + p * (37 ±0)` - // Minimum execution time: 22_944_000 picoseconds. - Weight::from_parts(24_266_610, 4254) - // Standard Error: 3_455 - .saturating_add(Weight::from_parts(54_450, 0).saturating_mul(p.into())) + // Minimum execution time: 27_311_000 picoseconds. + Weight::from_parts(28_486_266, 4254) + // Standard Error: 3_449 + .saturating_add(Weight::from_parts(81_179, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) @@ -308,12 +308,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `894 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615 + a * (68 ±0) + p * (37 ±0)` - // Minimum execution time: 47_260_000 picoseconds. - Weight::from_parts(47_529_113, 8615) - // Standard Error: 1_955 - .saturating_add(Weight::from_parts(228_520, 0).saturating_mul(a.into())) - // Standard Error: 7_834 - .saturating_add(Weight::from_parts(91_082, 0).saturating_mul(p.into())) + // Minimum execution time: 53_721_000 picoseconds. + Weight::from_parts(54_823_542, 8615) + // Standard Error: 1_396 + .saturating_add(Weight::from_parts(227_680, 0).saturating_mul(a.into())) + // Standard Error: 5_594 + .saturating_add(Weight::from_parts(49_632, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 68).saturating_mul(a.into())) @@ -329,12 +329,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 22_794_000 picoseconds. - Weight::from_parts(23_443_735, 8615) - // Standard Error: 934 - .saturating_add(Weight::from_parts(195_425, 0).saturating_mul(a.into())) - // Standard Error: 3_742 - .saturating_add(Weight::from_parts(28_301, 0).saturating_mul(p.into())) + // Minimum execution time: 26_269_000 picoseconds. + Weight::from_parts(25_886_226, 8615) + // Standard Error: 1_243 + .saturating_add(Weight::from_parts(216_353, 0).saturating_mul(a.into())) + // Standard Error: 4_980 + .saturating_add(Weight::from_parts(48_789, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -348,12 +348,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `299 + a * (68 ±0)` // Estimated: `8615` - // Minimum execution time: 22_985_000 picoseconds. - Weight::from_parts(23_534_338, 8615) - // Standard Error: 780 - .saturating_add(Weight::from_parts(189_895, 0).saturating_mul(a.into())) - // Standard Error: 3_126 - .saturating_add(Weight::from_parts(28_011, 0).saturating_mul(p.into())) + // Minimum execution time: 26_179_000 picoseconds. + Weight::from_parts(27_149_127, 8615) + // Standard Error: 2_670 + .saturating_add(Weight::from_parts(206_147, 0).saturating_mul(a.into())) + // Standard Error: 10_696 + .saturating_add(Weight::from_parts(24_070, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -369,12 +369,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `308 + a * (68 ±0) + p * (37 ±0)` // Estimated: `8615` - // Minimum execution time: 30_425_000 picoseconds. - Weight::from_parts(30_524_921, 8615) - // Standard Error: 1_118 - .saturating_add(Weight::from_parts(199_090, 0).saturating_mul(a.into())) - // Standard Error: 4_480 - .saturating_add(Weight::from_parts(57_115, 0).saturating_mul(p.into())) + // Minimum execution time: 34_094_000 picoseconds. + Weight::from_parts(33_908_359, 8615) + // Standard Error: 1_874 + .saturating_add(Weight::from_parts(214_642, 0).saturating_mul(a.into())) + // Standard Error: 7_509 + .saturating_add(Weight::from_parts(69_223, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -385,10 +385,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 22_223_000 picoseconds. - Weight::from_parts(23_131_574, 4254) - // Standard Error: 1_846 - .saturating_add(Weight::from_parts(58_537, 0).saturating_mul(p.into())) + // Minimum execution time: 24_857_000 picoseconds. + Weight::from_parts(25_965_759, 4254) + // Standard Error: 2_416 + .saturating_add(Weight::from_parts(71_360, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -401,10 +401,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 23_755_000 picoseconds. - Weight::from_parts(24_906_155, 4254) - // Standard Error: 2_155 - .saturating_add(Weight::from_parts(60_029, 0).saturating_mul(p.into())) + // Minimum execution time: 26_770_000 picoseconds. + Weight::from_parts(28_059_742, 4254) + // Standard Error: 2_451 + .saturating_add(Weight::from_parts(63_593, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -415,10 +415,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 23_414_000 picoseconds. - Weight::from_parts(24_372_840, 4254) - // Standard Error: 2_319 - .saturating_add(Weight::from_parts(45_772, 0).saturating_mul(p.into())) + // Minimum execution time: 26_630_000 picoseconds. + Weight::from_parts(28_105_274, 4254) + // Standard Error: 2_597 + .saturating_add(Weight::from_parts(41_821, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -429,10 +429,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4254` - // Minimum execution time: 23_465_000 picoseconds. - Weight::from_parts(24_697_649, 4254) - // Standard Error: 2_033 - .saturating_add(Weight::from_parts(14_413, 0).saturating_mul(p.into())) + // Minimum execution time: 26_990_000 picoseconds. + Weight::from_parts(28_243_687, 4254) + // Standard Error: 2_975 + .saturating_add(Weight::from_parts(28_462, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -443,10 +443,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `156 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 22_614_000 picoseconds. - Weight::from_parts(23_662_943, 4254) - // Standard Error: 2_317 - .saturating_add(Weight::from_parts(38_167, 0).saturating_mul(p.into())) + // Minimum execution time: 26_230_000 picoseconds. + Weight::from_parts(27_299_094, 4254) + // Standard Error: 2_747 + .saturating_add(Weight::from_parts(38_537, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -460,8 +460,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `412` // Estimated: `8615` - // Minimum execution time: 42_253_000 picoseconds. - Weight::from_parts(43_064_000, 8615) + // Minimum execution time: 46_267_000 picoseconds. + Weight::from_parts(46_698_000, 8615) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -474,10 +474,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `119 + p * (37 ±0)` // Estimated: `4254` - // Minimum execution time: 11_637_000 picoseconds. - Weight::from_parts(12_193_545, 4254) - // Standard Error: 1_531 - .saturating_add(Weight::from_parts(34_642, 0).saturating_mul(p.into())) + // Minimum execution time: 14_176_000 picoseconds. + Weight::from_parts(14_886_579, 4254) + // Standard Error: 2_018 + .saturating_add(Weight::from_parts(45_475, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index ad73946035..30a50a774b 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -1561,37 +1561,42 @@ mod pallet_benchmarks { let old: T::AccountId = account("A", 0, 7); let new: T::AccountId = account("B", 0, 8); - let num_subnets: u16 = 4; - for i in 1..=num_subnets { + const INCIDENT_SUBNETS: u16 = 16; + const INCIDENT_STAKE_POSITIONS: u32 = 1_273; + + let alpha_amount = AlphaBalance::from(1_000_000_u64); + let subnet_alpha = AlphaBalance::from(1_000_000_000_000_u64); + + // Populate the reduced topology and make the old hotkey a member + // everywhere so the benchmark includes the per-subnet metadata path. + for i in 1..=INCIDENT_SUBNETS { let netuid = NetUid::from(i); Subtensor::::init_new_network(netuid, 1); + Subtensor::::set_max_allowed_uids(netuid, 1); SubtokenEnabled::::insert(netuid, true); - Subtensor::::set_network_registration_allowed(netuid, true); - Subtensor::::set_burn(netuid, benchmark_registration_burn()); - - let reg_balance = TaoBalance::from(1_000_000_u64); seed_swap_reserves::(netuid); - add_balance_to_coldkey_account::(&coldkey, reg_balance.into()); - - assert_ok!(Subtensor::::burned_register( - RawOrigin::Signed(coldkey.clone()).into(), - netuid, - old.clone() - )); + SubnetAlphaOut::::insert(netuid, subnet_alpha); + Subtensor::::append_neuron(netuid, &old, 0); + } - let alpha_amount = AlphaBalance::from(1_000_000_u64); - SubnetAlphaOut::::insert(netuid, alpha_amount * 2.into()); + // Use distinct coldkeys so execution performs the reduced number + // of actual position migrations and StakingHotkeys index rewrites. The + // positions are spread evenly over all active subnets. + for i in 0..INCIDENT_STAKE_POSITIONS { + let staker: T::AccountId = account("stake", i, 9); + let netuid = NetUid::from(((i % u32::from(INCIDENT_SUBNETS)).saturating_add(1)) as u16); Subtensor::::increase_stake_for_hotkey_and_coldkey_on_subnet( &old, - &coldkey, + &staker, netuid, alpha_amount, ); } Owner::::insert(&old, &coldkey); + let ed = ::ExistentialDeposit::get(); let cost = Subtensor::::get_key_swap_cost(); - add_balance_to_coldkey_account::(&coldkey, cost.into()); + add_balance_to_coldkey_account::(&coldkey, cost + ed); #[extrinsic_call] _(RawOrigin::Signed(coldkey.clone()), old, new, None); diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index a875eeeeea..10def33b62 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -842,7 +842,11 @@ mod dispatches { note = "Please use swap_hotkey_v2 instead. This extrinsic will be removed some time after June 2026." )] #[pallet::call_index(70)] - #[pallet::weight(::WeightInfo::swap_hotkey())] + #[pallet::weight(( + ::WeightInfo::swap_hotkey(), + DispatchClass::Normal, + Pays::Yes + ))] pub fn swap_hotkey( origin: OriginFor, hotkey: T::AccountId, @@ -864,9 +868,11 @@ mod dispatches { /// * `keep_stake`: If `true`, stake remains on the old hotkey and the rest metadata /// is transferred to the new hotkey. #[pallet::call_index(72)] - #[pallet::weight((Weight::from_parts(275_300_000, 0) - .saturating_add(T::DbWeight::get().reads(52_u64)) - .saturating_add(T::DbWeight::get().writes(35_u64)), DispatchClass::Normal, Pays::Yes))] + #[pallet::weight(( + crate::Pallet::::swap_hotkey_v2_dispatch_weight(netuid, *keep_stake), + DispatchClass::Normal, + Pays::Yes + ))] pub fn swap_hotkey_v2( origin: OriginFor, hotkey: T::AccountId, diff --git a/pallets/subtensor/src/subnets/leasing.rs b/pallets/subtensor/src/subnets/leasing.rs index 3ba615b4c5..3aa08b6db1 100644 --- a/pallets/subtensor/src/subnets/leasing.rs +++ b/pallets/subtensor/src/subnets/leasing.rs @@ -16,6 +16,7 @@ //! ownership will be transferred to the beneficiary. use super::*; +use crate::weights::WeightInfo; use frame_support::{ dispatch::RawOrigin, traits::{Defensive, fungible::*}, @@ -163,12 +164,10 @@ impl Pallet { if crowdloan.contributors_count < T::MaxContributors::get() { // We have less contributors than the max allowed, so we need to refund the difference - Ok( - Some(SubnetLeasingWeightInfo::::do_register_leased_network( - crowdloan.contributors_count, - )) - .into(), - ) + Ok(Some(::WeightInfo::register_leased_network( + crowdloan.contributors_count, + )) + .into()) } else { // We have the max number of contributors, so we don't need to refund anything Ok(().into()) @@ -215,6 +214,7 @@ impl Pallet { SubnetLeaseShares::::clear_prefix(lease_id, T::MaxContributors::get(), None); AccumulatedLeaseDividends::::remove(lease_id); SubnetLeases::::remove(lease_id); + SubnetUidToLeaseId::::remove(lease.netuid); // Remove the beneficiary proxy T::ProxyInterface::remove_lease_beneficiary_proxy(&lease.coldkey, &lease.beneficiary)?; @@ -224,10 +224,12 @@ impl Pallet { netuid: lease.netuid, }); - if clear_result.unique < T::MaxContributors::get() { + // Lease shares exclude the beneficiary, while the benchmark's `k` includes them. + let contributors_count = clear_result.unique.saturating_add(1); + if contributors_count < T::MaxContributors::get() { // We have cleared less than the max number of shareholders, so we need to refund the difference - Ok(Some(SubnetLeasingWeightInfo::::do_terminate_lease( - clear_result.unique, + Ok(Some(::WeightInfo::terminate_lease( + contributors_count, )) .into()) } else { @@ -378,27 +380,3 @@ impl Pallet { Ok((crowdloan_id, crowdloan)) } } - -/// Weight functions needed for subnet leasing. -pub struct SubnetLeasingWeightInfo(PhantomData); -impl SubnetLeasingWeightInfo { - pub fn do_register_leased_network(k: u32) -> Weight { - Weight::from_parts(301_560_714, 10079) - .saturating_add(Weight::from_parts(26_884_006, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(41_u64)) - .saturating_add(T::DbWeight::get().reads(2_u64.saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(55_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64.saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 2579).saturating_mul(k.into())) - } - - pub fn do_terminate_lease(k: u32) -> Weight { - Weight::from_parts(56_635_122, 6148) - .saturating_add(Weight::from_parts(912_993, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(6_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 2529).saturating_mul(k.into())) - } -} diff --git a/pallets/subtensor/src/swap/swap_hotkey.rs b/pallets/subtensor/src/swap/swap_hotkey.rs index c49b260cf7..dce875dc0c 100644 --- a/pallets/subtensor/src/swap/swap_hotkey.rs +++ b/pallets/subtensor/src/swap/swap_hotkey.rs @@ -2,11 +2,48 @@ use super::*; use frame_support::weights::Weight; use share_pool::SafeFloat; use sp_core::Get; -use sp_std::collections::btree_set::BTreeSet; -use substrate_fixed::types::U64F64; +use sp_std::collections::btree_map::BTreeMap; use subtensor_runtime_common::{MechId, NetUid, Token}; +struct PreparedHotkeyStake { + positions: Vec<(AccountId, NetUid, SafeFloat)>, + coldkeys_by_netuid: BTreeMap>, +} + impl Pallet { + /// Use the generated all-subnet stake-moving benchmark for every v2 path + /// that scans and moves stake. Preserve the previous lightweight weight for + /// the single-subnet `keep_stake` path, which does not scan stake prefixes. + pub fn swap_hotkey_v2_dispatch_weight(netuid: &Option, keep_stake: bool) -> Weight { + if netuid.is_none() || !keep_stake { + <::WeightInfo as crate::weights::WeightInfo>::swap_hotkey() + } else { + Weight::from_parts(275_300_000, 0) + .saturating_add(T::DbWeight::get().reads(52_u64)) + .saturating_add(T::DbWeight::get().writes(35_u64)) + } + } + + /// Read and merge the old hotkey's V1/V2 stake rows once. V2 keeps the + /// existing precedence over a duplicate legacy row. + fn prepare_hotkey_stake(old_hotkey: &T::AccountId) -> PreparedHotkeyStake { + let positions: Vec<(T::AccountId, NetUid, SafeFloat)> = + Self::alpha_iter_single_prefix(old_hotkey).collect(); + let mut coldkeys_by_netuid: BTreeMap> = BTreeMap::new(); + + for (coldkey, netuid, _) in &positions { + coldkeys_by_netuid + .entry(*netuid) + .or_default() + .push(coldkey.clone()); + } + + PreparedHotkeyStake { + positions, + coldkeys_by_netuid, + } + } + /// Swaps the hotkey of a coldkey account. /// /// # Arguments @@ -107,6 +144,14 @@ impl Pallet { ); } + // Read and group stake once before any hotkey-swap mutation. Execution + // reuses this snapshot instead of rescanning both prefixes per subnet. + let prepared_stake = if keep_stake { + None + } else { + Some(Self::prepare_hotkey_stake(old_hotkey)) + }; + // 8. Swap LastTxBlockDelegateTake let last_tx_block_delegate_take: u64 = Self::get_last_tx_block_delegate_take(old_hotkey); Self::set_last_tx_block_delegate_take(new_hotkey, last_tx_block_delegate_take); @@ -120,7 +165,13 @@ impl Pallet { // 12. fork for swap hotkey on a specific subnet case after do the common check if let Some(netuid) = netuid { return Self::swap_hotkey_on_subnet( - &coldkey, old_hotkey, new_hotkey, netuid, weight, keep_stake, + &coldkey, + old_hotkey, + new_hotkey, + netuid, + weight, + keep_stake, + prepared_stake.as_ref(), ); }; @@ -190,13 +241,15 @@ impl Pallet { Self::recycle_tao(&coldkey, swap_cost.into())?; weight.saturating_accrue(T::DbWeight::get().reads_writes(0, 2)); - // 16. Perform the hotkey swap - Self::perform_hotkey_swap_on_all_subnets( + // 16. Perform the hotkey swap using the read-only snapshot prepared + // before the fee was charged. + Self::perform_hotkey_swap_on_all_subnets_prepared( old_hotkey, new_hotkey, &coldkey, &mut weight, keep_stake, + prepared_stake.as_ref(), )?; // 16.1 Record the per-subnet swap cooldown for every affected subnet, so a @@ -214,8 +267,13 @@ impl Pallet { new_hotkey: new_hotkey.clone(), }); - // 19. Return the weight of the operation - Ok(Some(weight).into()) + // Stake-moving paths retain the generated pre-dispatch benchmark weight. + // `keep_stake` does not inspect stake prefixes and may keep its dynamic refund. + if keep_stake { + Ok(Some(weight).into()) + } else { + Ok(None.into()) + } } /// Performs the hotkey swap operation, transferring all associated data and state from the old hotkey to the new hotkey. @@ -258,11 +316,30 @@ impl Pallet { weight: &mut Weight, keep_stake: bool, ) -> DispatchResult { - // 1. keep the old hotkey alpha values for the case where hotkey staked by multiple coldkeys. - let old_alpha_values: Vec<(T::AccountId, NetUid, SafeFloat)> = - Self::alpha_iter_single_prefix(old_hotkey).collect(); - weight.saturating_accrue(T::DbWeight::get().reads(old_alpha_values.len() as u64)); + let prepared_stake = if keep_stake { + None + } else { + Some(Self::prepare_hotkey_stake(old_hotkey)) + }; + + Self::perform_hotkey_swap_on_all_subnets_prepared( + old_hotkey, + new_hotkey, + coldkey, + weight, + keep_stake, + prepared_stake.as_ref(), + ) + } + fn perform_hotkey_swap_on_all_subnets_prepared( + old_hotkey: &T::AccountId, + new_hotkey: &T::AccountId, + coldkey: &T::AccountId, + weight: &mut Weight, + keep_stake: bool, + prepared_stake: Option<&PreparedHotkeyStake>, + ) -> DispatchResult { // 2. Swap the stake locks let (reads, writes) = Self::swap_hotkey_locks(old_hotkey, new_hotkey); weight.saturating_accrue(T::DbWeight::get().reads_writes(reads, writes)); @@ -289,8 +366,18 @@ impl Pallet { // 6. execute the hotkey swap on all subnets for netuid in Self::get_all_subnet_netuids() { - Self::perform_hotkey_swap_on_one_subnet( - old_hotkey, new_hotkey, weight, netuid, keep_stake, + let stake_coldkeys = prepared_stake + .and_then(|prepared| prepared.coldkeys_by_netuid.get(&netuid)) + .map(Vec::as_slice) + .unwrap_or(&[]); + + Self::perform_hotkey_swap_on_one_subnet_prepared( + old_hotkey, + new_hotkey, + weight, + netuid, + keep_stake, + stake_coldkeys, )?; } @@ -320,19 +407,19 @@ impl Pallet { // 11. Alphas already update in perform_hotkey_swap_on_one_subnet // Update the StakingHotkeys for the case where hotkey staked by multiple coldkeys. - if !keep_stake { - for (coldkey, _netuid, alpha_share) in old_alpha_values { + if let Some(prepared_stake) = prepared_stake { + for (coldkey, _netuid, alpha_share) in &prepared_stake.positions { // Swap StakingHotkeys. // StakingHotkeys( coldkey ) --> Vec -- the hotkeys that the coldkey stakes. if !alpha_share.is_zero() { - let mut staking_hotkeys = StakingHotkeys::::get(&coldkey); + let mut staking_hotkeys = StakingHotkeys::::get(coldkey); weight.saturating_accrue(T::DbWeight::get().reads(1)); if staking_hotkeys.contains(old_hotkey) { staking_hotkeys.retain(|hk| *hk != *old_hotkey && *hk != *new_hotkey); if !staking_hotkeys.contains(new_hotkey) { staking_hotkeys.push(new_hotkey.clone()); } - StakingHotkeys::::insert(&coldkey, staking_hotkeys); + StakingHotkeys::::insert(coldkey, staking_hotkeys); weight.saturating_accrue(T::DbWeight::get().writes(1)); } } @@ -351,6 +438,7 @@ impl Pallet { netuid: NetUid, init_weight: Weight, keep_stake: bool, + prepared_stake: Option<&PreparedHotkeyStake>, ) -> DispatchResultWithPostInfo { // 1. Ensure coldkey not swap hotkey too frequently let mut weight: Weight = init_weight; @@ -413,13 +501,18 @@ impl Pallet { let (reads, writes) = Self::swap_hotkey_locks_on_subnet(old_hotkey, new_hotkey, netuid); weight.saturating_accrue(T::DbWeight::get().reads_writes(reads, writes)); - // 10. Perform the hotkey swap - Self::perform_hotkey_swap_on_one_subnet( + // 10. Perform the hotkey swap using the preflight snapshot. + let stake_coldkeys = prepared_stake + .and_then(|prepared| prepared.coldkeys_by_netuid.get(&netuid)) + .map(Vec::as_slice) + .unwrap_or(&[]); + Self::perform_hotkey_swap_on_one_subnet_prepared( old_hotkey, new_hotkey, &mut weight, netuid, keep_stake, + stake_coldkeys, )?; // 10. Record the per-subnet swap block for the HotkeySwapOnSubnetInterval gate. @@ -435,7 +528,11 @@ impl Pallet { netuid, }); - Ok(Some(weight).into()) + if keep_stake { + Ok(Some(weight).into()) + } else { + Ok(None.into()) + } } // do hotkey swap public part for both swap all subnets and just swap one subnet @@ -445,6 +542,35 @@ impl Pallet { weight: &mut Weight, netuid: NetUid, keep_stake: bool, + ) -> DispatchResult { + let prepared_stake = if keep_stake { + None + } else { + Some(Self::prepare_hotkey_stake(old_hotkey)) + }; + let stake_coldkeys = prepared_stake + .as_ref() + .and_then(|prepared| prepared.coldkeys_by_netuid.get(&netuid)) + .map(Vec::as_slice) + .unwrap_or(&[]); + + Self::perform_hotkey_swap_on_one_subnet_prepared( + old_hotkey, + new_hotkey, + weight, + netuid, + keep_stake, + stake_coldkeys, + ) + } + + fn perform_hotkey_swap_on_one_subnet_prepared( + old_hotkey: &T::AccountId, + new_hotkey: &T::AccountId, + weight: &mut Weight, + netuid: NetUid, + keep_stake: bool, + stake_coldkeys: &[T::AccountId], ) -> DispatchResult { // 3. Swap all subnet specific info. @@ -615,50 +741,25 @@ impl Pallet { Self::swap_voting_power_for_hotkey(old_hotkey, new_hotkey, netuid); weight.saturating_accrue(T::DbWeight::get().reads_writes(2, 2)); - // Swap Alpha - // Alpha( hotkey, coldkey, netuid ) -> alpha - let old_alpha_values: Vec<((T::AccountId, NetUid), U64F64)> = - Alpha::::iter_prefix((old_hotkey,)).collect(); - weight.saturating_accrue(T::DbWeight::get().reads(old_alpha_values.len() as u64)); - weight.saturating_accrue(T::DbWeight::get().writes(old_alpha_values.len() as u64)); - - let old_alpha_values_v2: Vec<((T::AccountId, NetUid), SafeFloat)> = - AlphaV2::::iter_prefix((old_hotkey,)).collect(); - weight.saturating_accrue(T::DbWeight::get().reads(old_alpha_values_v2.len() as u64)); - weight.saturating_accrue(T::DbWeight::get().writes(old_alpha_values_v2.len() as u64)); - - // Insert the new alpha values. - // Deduplicate coldkeys staking to old_hotkey from alpha and alpha_v2 - let unique_coldkeys: BTreeSet = old_alpha_values - .into_iter() - .map(|((coldkey, netuid_alpha), _)| (coldkey, netuid_alpha)) - .chain( - old_alpha_values_v2 - .into_iter() - .map(|((coldkey, netuid_alpha), _)| (coldkey, netuid_alpha)), - ) - .filter(|(_, netuid_alpha)| *netuid_alpha == netuid) - .map(|(coldkey, _)| coldkey) - .collect(); - - // For each coldkey remove their stake from old_hotkey and add to new_hotkey - for coldkey in unique_coldkeys { + // Move only the positions prepared for this subnet. The V1/V2 + // prefixes were already scanned and deduplicated once during preflight. + for coldkey in stake_coldkeys { let alpha_old = - Self::get_stake_for_hotkey_and_coldkey_on_subnet(old_hotkey, &coldkey, netuid); + Self::get_stake_for_hotkey_and_coldkey_on_subnet(old_hotkey, coldkey, netuid); Self::decrease_stake_for_hotkey_and_coldkey_on_subnet( - old_hotkey, &coldkey, netuid, alpha_old, + old_hotkey, coldkey, netuid, alpha_old, ); Self::increase_stake_for_hotkey_and_coldkey_on_subnet( - new_hotkey, &coldkey, netuid, alpha_old, + new_hotkey, coldkey, netuid, alpha_old, ); weight.saturating_accrue(T::DbWeight::get().reads_writes(2, 2)); - let mut staking_hotkeys = StakingHotkeys::::get(&coldkey); + let mut staking_hotkeys = StakingHotkeys::::get(coldkey); weight.saturating_accrue(T::DbWeight::get().reads(1)); if staking_hotkeys.contains(old_hotkey) && !staking_hotkeys.contains(new_hotkey) { staking_hotkeys.push(new_hotkey.clone()); - StakingHotkeys::::insert(&coldkey, staking_hotkeys); + StakingHotkeys::::insert(coldkey, staking_hotkeys); weight.saturating_accrue(T::DbWeight::get().writes(1)); } } diff --git a/pallets/subtensor/src/tests/leasing.rs b/pallets/subtensor/src/tests/leasing.rs index cc0715f451..0bc00d139d 100644 --- a/pallets/subtensor/src/tests/leasing.rs +++ b/pallets/subtensor/src/tests/leasing.rs @@ -28,11 +28,20 @@ fn test_register_leased_network_works() { // Register the leased network let end_block = 500; let emissions_share = Percent::from_percent(30); - assert_ok!(SubtensorModule::register_leased_network( - RuntimeOrigin::signed(beneficiary), - emissions_share, - Some(end_block), - )); + let contributors_count = 1 + contributions.len() as u32; + assert_ok!( + SubtensorModule::register_leased_network( + RuntimeOrigin::signed(beneficiary), + emissions_share, + Some(end_block), + ) + .map(|post_info| post_info.actual_weight), + Some( + <::WeightInfo as crate::weights::WeightInfo>::register_leased_network( + contributors_count, + ), + ) + ); // Ensure the lease was created let lease_id = 0; @@ -239,25 +248,33 @@ fn test_register_lease_network_fails_if_end_block_is_in_the_past() { #[test] fn test_terminate_lease_works() { - new_test_ext(1).execute_with(|| { + let mut ext = new_test_ext(1); + let beneficiary = U256::from(1); + let contributions = vec![(U256::from(2), 990_000_000_000)]; // 990 TAO + let end_block = 500; + + let (lease_id, lease) = ext.execute_with(|| { // Setup a crowdloan let crowdloan_id = 0; - let beneficiary = U256::from(1); let deposit = 10_000_000_000; // 10 TAO let cap = 1_000_000_000_000; // 1000 TAO - let contributions = vec![(U256::from(2), 990_000_000_000)]; // 990 TAO setup_crowdloan(crowdloan_id, deposit, cap, beneficiary, &contributions); // Setup a leased network - let end_block = 500; let tao_to_stake = 100_000_000_000; // 100 TAO let emissions_share = Percent::from_percent(30); - let (lease_id, lease) = setup_leased_network( + setup_leased_network( beneficiary, emissions_share, Some(end_block), Some(tao_to_stake), - ); + ) + }); + + // Commit the lease setup so clear_prefix reports the same backend removals as on-chain. + assert_ok!(ext.commit_all()); + + ext.execute_with(|| { // Run to the end of the lease run_to_block(end_block); @@ -266,12 +283,26 @@ fn test_terminate_lease_works() { let hotkey = U256::from(3); let _ = SubtensorModule::create_account_if_non_existent(&beneficiary, &hotkey); + assert_eq!( + SubnetLeaseShares::::iter_prefix(lease_id).count(), + contributions.len() + ); + // Terminate the lease - assert_ok!(SubtensorModule::terminate_lease( - RuntimeOrigin::signed(beneficiary), - lease_id, - hotkey, - )); + let contributors_count = 1 + contributions.len() as u32; + assert_ok!( + SubtensorModule::terminate_lease( + RuntimeOrigin::signed(beneficiary), + lease_id, + hotkey, + ) + .map(|post_info| post_info.actual_weight), + Some( + <::WeightInfo as crate::weights::WeightInfo>::terminate_lease( + contributors_count, + ), + ) + ); // Ensure the beneficiary is now the owner of the subnet assert_eq!(SubnetOwner::::get(lease.netuid), beneficiary); @@ -281,6 +312,7 @@ fn test_terminate_lease_works() { assert_eq!(SubnetLeases::::get(lease_id), None); assert!(!SubnetLeaseShares::::contains_prefix(lease_id)); assert!(!AccumulatedLeaseDividends::::contains_key(lease_id)); + assert!(!SubnetUidToLeaseId::::contains_key(lease.netuid)); // Ensure the beneficiary has been removed as a proxy assert!(PROXIES.with_borrow(|proxies| proxies.0.is_empty())); diff --git a/pallets/subtensor/src/tests/swap_hotkey.rs b/pallets/subtensor/src/tests/swap_hotkey.rs index 035a738464..19ade1960f 100644 --- a/pallets/subtensor/src/tests/swap_hotkey.rs +++ b/pallets/subtensor/src/tests/swap_hotkey.rs @@ -1972,3 +1972,53 @@ fn ghsa_2026_014_childkey_take_not_migrated_on_hotkey_swap() { ); }); } + +#[test] +fn hotkey_swap_has_no_hard_position_cap() { + new_test_ext(1).execute_with(|| { + let old_hotkey = U256::from(1); + let new_hotkey = U256::from(2); + let owner = U256::from(3); + let netuid = NetUid::from(1); + let alpha = AlphaBalance::from(1_u64); + + add_network(netuid, 1, 0); + SubnetAlphaOut::::insert(netuid, AlphaBalance::from(10_000_u64)); + Owner::::insert(old_hotkey, owner); + OwnedHotkeys::::insert(owner, vec![old_hotkey]); + add_balance_to_coldkey_account( + &owner, + SubtensorModule::get_key_swap_cost().saturating_add(ExistentialDeposit::get()), + ); + + // This is deliberately one more than the removed 1,024-position cap. + for index in 0..=1_024_u64 { + let coldkey = U256::from(10_000_u64.saturating_add(index)); + SubtensorModule::increase_stake_for_hotkey_and_coldkey_on_subnet( + &old_hotkey, + &coldkey, + netuid, + alpha, + ); + } + + assert_ok!(SubtensorModule::do_swap_hotkey( + RuntimeOrigin::signed(owner), + &old_hotkey, + &new_hotkey, + None, + false, + )); + + let first_staker = U256::from(10_000_u64); + assert_eq!(Owner::::get(new_hotkey), owner); + assert_eq!( + SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &new_hotkey, + &first_staker, + netuid, + ), + alpha + ); + }); +} diff --git a/pallets/subtensor/src/weights.rs b/pallets/subtensor/src/weights.rs index 575f5898a0..666be47e80 100644 --- a/pallets/subtensor/src/weights.rs +++ b/pallets/subtensor/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_subtensor` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.VWOavGjFZ0 +// --output=/tmp/tmp.g1Ks5fkiAw // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -184,8 +184,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1865` // Estimated: `6148` - // Minimum execution time: 352_754_000 picoseconds. - Weight::from_parts(356_540_000, 6148) + // Minimum execution time: 362_389_000 picoseconds. + Weight::from_parts(364_683_000, 6148) .saturating_add(T::DbWeight::get().reads(34_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } @@ -227,8 +227,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `188820` // Estimated: `10327410` - // Minimum execution time: 16_725_626_000 picoseconds. - Weight::from_parts(17_365_948_000, 10327410) + // Minimum execution time: 15_329_095_000 picoseconds. + Weight::from_parts(15_577_909_000, 10327410) .saturating_add(T::DbWeight::get().reads(4112_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -298,8 +298,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2226` // Estimated: `8727` - // Minimum execution time: 689_695_000 picoseconds. - Weight::from_parts(708_463_000, 8727) + // Minimum execution time: 660_157_000 picoseconds. + Weight::from_parts(682_328_000, 8727) .saturating_add(T::DbWeight::get().reads(32_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -315,8 +315,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 36_164_000 picoseconds. - Weight::from_parts(37_075_000, 4293) + // Minimum execution time: 37_149_000 picoseconds. + Weight::from_parts(37_831_000, 4293) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -332,8 +332,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4392` - // Minimum execution time: 34_191_000 picoseconds. - Weight::from_parts(35_243_000, 4392) + // Minimum execution time: 35_126_000 picoseconds. + Weight::from_parts(35_617_000, 4392) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -415,8 +415,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1798` // Estimated: `6148` - // Minimum execution time: 354_477_000 picoseconds. - Weight::from_parts(357_842_000, 6148) + // Minimum execution time: 348_623_000 picoseconds. + Weight::from_parts(365_124_000, 6148) .saturating_add(T::DbWeight::get().reads(34_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } @@ -468,8 +468,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1516` // Estimated: `4981` - // Minimum execution time: 103_874_000 picoseconds. - Weight::from_parts(107_119_000, 4981) + // Minimum execution time: 103_914_000 picoseconds. + Weight::from_parts(106_500_000, 4981) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -591,8 +591,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1532` // Estimated: `9947` - // Minimum execution time: 281_649_000 picoseconds. - Weight::from_parts(288_668_000, 9947) + // Minimum execution time: 297_417_000 picoseconds. + Weight::from_parts(306_113_000, 9947) .saturating_add(T::DbWeight::get().reads(41_u64)) .saturating_add(T::DbWeight::get().writes(48_u64)) } @@ -626,8 +626,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1249` // Estimated: `4714` - // Minimum execution time: 68_141_000 picoseconds. - Weight::from_parts(70_104_000, 4714) + // Minimum execution time: 68_428_000 picoseconds. + Weight::from_parts(69_841_000, 4714) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -673,8 +673,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 112_226_000 picoseconds. - Weight::from_parts(114_661_000, 7590) + // Minimum execution time: 113_753_000 picoseconds. + Weight::from_parts(115_677_000, 7590) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -684,8 +684,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_336_000 picoseconds. - Weight::from_parts(4_496_000, 0) + // Minimum execution time: 5_651_000 picoseconds. + Weight::from_parts(5_941_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -708,8 +708,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1033` // Estimated: `4498` - // Minimum execution time: 55_112_000 picoseconds. - Weight::from_parts(56_764_000, 4498) + // Minimum execution time: 55_384_000 picoseconds. + Weight::from_parts(55_974_000, 4498) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -725,8 +725,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 44_986_000 picoseconds. - Weight::from_parts(46_500_000, 4159) + // Minimum execution time: 46_918_000 picoseconds. + Weight::from_parts(48_231_000, 4159) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -774,8 +774,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2110` // Estimated: `13000` - // Minimum execution time: 297_051_000 picoseconds. - Weight::from_parts(303_430_000, 13000) + // Minimum execution time: 298_409_000 picoseconds. + Weight::from_parts(302_957_000, 13000) .saturating_add(T::DbWeight::get().reads(39_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -827,8 +827,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2166` // Estimated: `13056` - // Minimum execution time: 321_948_000 picoseconds. - Weight::from_parts(326_835_000, 13056) + // Minimum execution time: 323_075_000 picoseconds. + Weight::from_parts(327_203_000, 13056) .saturating_add(T::DbWeight::get().reads(39_u64)) .saturating_add(T::DbWeight::get().writes(20_u64)) } @@ -840,8 +840,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 20_591_000 picoseconds. - Weight::from_parts(21_242_000, 4130) + // Minimum execution time: 22_332_000 picoseconds. + Weight::from_parts(22_763_000, 4130) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -853,8 +853,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 16_885_000 picoseconds. - Weight::from_parts(17_345_000, 4078) + // Minimum execution time: 18_535_000 picoseconds. + Weight::from_parts(19_286_000, 4078) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -866,8 +866,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_231_000 picoseconds. - Weight::from_parts(7_542_000, 0) + // Minimum execution time: 8_676_000 picoseconds. + Weight::from_parts(8_977_000, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -912,8 +912,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2155` // Estimated: `8095` - // Minimum execution time: 428_717_000 picoseconds. - Weight::from_parts(445_321_000, 8095) + // Minimum execution time: 419_336_000 picoseconds. + Weight::from_parts(424_766_000, 8095) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -947,8 +947,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 184_805_000 picoseconds. - Weight::from_parts(195_741_000, 5219) + // Minimum execution time: 172_995_000 picoseconds. + Weight::from_parts(174_738_000, 5219) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -980,8 +980,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 181_350_000 picoseconds. - Weight::from_parts(182_581_000, 5219) + // Minimum execution time: 168_626_000 picoseconds. + Weight::from_parts(170_771_000, 5219) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -1001,8 +1001,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 37_586_000 picoseconds. - Weight::from_parts(38_778_000, 4583) + // Minimum execution time: 38_692_000 picoseconds. + Weight::from_parts(39_624_000, 4583) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1072,11 +1072,17 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2226` // Estimated: `8727` - // Minimum execution time: 913_477_000 picoseconds. - Weight::from_parts(926_927_000, 8727) + // Minimum execution time: 848_440_000 picoseconds. + Weight::from_parts(867_877_000, 8727) .saturating_add(T::DbWeight::get().reads(32_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:2 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -1087,12 +1093,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:2 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) @@ -1109,8 +1109,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1979` // Estimated: `7919` - // Minimum execution time: 221_830_000 picoseconds. - Weight::from_parts(225_024_000, 7919) + // Minimum execution time: 194_375_000 picoseconds. + Weight::from_parts(196_448_000, 7919) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -1166,8 +1166,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2142` // Estimated: `10557` - // Minimum execution time: 585_780_000 picoseconds. - Weight::from_parts(602_415_000, 10557) + // Minimum execution time: 562_384_000 picoseconds. + Weight::from_parts(584_084_000, 10557) .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } @@ -1221,21 +1221,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2176` // Estimated: `10591` - // Minimum execution time: 778_446_000 picoseconds. - Weight::from_parts(797_084_000, 10591) + // Minimum execution time: 729_086_000 picoseconds. + Weight::from_parts(754_454_000, 10591) .saturating_add(T::DbWeight::get().reads(27_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) @@ -1254,6 +1244,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Lock` (r:3 w:1) @@ -1294,11 +1294,17 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2662` // Estimated: `11077` - // Minimum execution time: 985_745_000 picoseconds. - Weight::from_parts(995_639_000, 11077) + // Minimum execution time: 902_290_000 picoseconds. + Weight::from_parts(926_466_000, 11077) .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(24_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -1309,12 +1315,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) @@ -1335,11 +1335,17 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1988` // Estimated: `7928` - // Minimum execution time: 257_983_000 picoseconds. - Weight::from_parts(259_696_000, 7928) + // Minimum execution time: 226_044_000 picoseconds. + Weight::from_parts(228_018_000, 7928) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -1350,12 +1356,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) @@ -1408,8 +1408,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2505` // Estimated: `10920` - // Minimum execution time: 743_614_000 picoseconds. - Weight::from_parts(758_998_000, 10920) + // Minimum execution time: 696_305_000 picoseconds. + Weight::from_parts(716_563_000, 10920) .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(24_u64)) } @@ -1447,8 +1447,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1300` // Estimated: `4765` - // Minimum execution time: 154_690_000 picoseconds. - Weight::from_parts(163_683_000, 4765) + // Minimum execution time: 150_943_000 picoseconds. + Weight::from_parts(158_827_000, 4765) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1488,8 +1488,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1455` // Estimated: `7395` - // Minimum execution time: 101_931_000 picoseconds. - Weight::from_parts(102_873_000, 7395) + // Minimum execution time: 102_251_000 picoseconds. + Weight::from_parts(103_163_000, 7395) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1505,8 +1505,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `830` // Estimated: `4295` - // Minimum execution time: 27_672_000 picoseconds. - Weight::from_parts(28_413_000, 4295) + // Minimum execution time: 29_034_000 picoseconds. + Weight::from_parts(30_257_000, 4295) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1524,8 +1524,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `923` // Estimated: `4388` - // Minimum execution time: 34_261_000 picoseconds. - Weight::from_parts(34_871_000, 4388) + // Minimum execution time: 36_087_000 picoseconds. + Weight::from_parts(36_980_000, 4388) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1647,8 +1647,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1468` // Estimated: `9883` - // Minimum execution time: 282_209_000 picoseconds. - Weight::from_parts(287_627_000, 9883) + // Minimum execution time: 294_192_000 picoseconds. + Weight::from_parts(301_796_000, 9883) .saturating_add(T::DbWeight::get().reads(40_u64)) .saturating_add(T::DbWeight::get().writes(47_u64)) } @@ -1664,8 +1664,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 35_403_000 picoseconds. - Weight::from_parts(36_814_000, 4264) + // Minimum execution time: 35_927_000 picoseconds. + Weight::from_parts(37_350_000, 4264) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1679,8 +1679,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `889` // Estimated: `6829` - // Minimum execution time: 30_195_000 picoseconds. - Weight::from_parts(31_066_000, 6829) + // Minimum execution time: 31_549_000 picoseconds. + Weight::from_parts(32_721_000, 6829) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1694,91 +1694,91 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 20_771_000 picoseconds. - Weight::from_parts(21_892_000, 4203) + // Minimum execution time: 22_993_000 picoseconds. + Weight::from_parts(24_086_000, 4203) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::IsNetworkMember` (r:6 w:10) + /// Storage: `SubtensorModule::IsNetworkMember` (r:18 w:34) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:9 w:8) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:33 w:32) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:2547 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2547 w:2546) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:6 w:0) + /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ChildKeys` (r:10 w:10) + /// Storage: `SubtensorModule::ChildKeys` (r:34 w:34) /// Proof: `SubtensorModule::ChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastHotkeySwapOnNetuid` (r:4 w:4) + /// Storage: `SubtensorModule::LastHotkeySwapOnNetuid` (r:16 w:16) /// Proof: `SubtensorModule::LastHotkeySwapOnNetuid` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:9 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:9 w:8) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:5 w:0) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:17 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:5 w:0) + /// Storage: `SubtensorModule::HotkeyLock` (r:17 w:0) /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:5 w:0) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:17 w:0) /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ChildkeyTake` (r:5 w:0) + /// Storage: `SubtensorModule::ChildkeyTake` (r:17 w:0) /// Proof: `SubtensorModule::ChildkeyTake` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ParentKeys` (r:10 w:10) + /// Storage: `SubtensorModule::ParentKeys` (r:34 w:34) /// Proof: `SubtensorModule::ParentKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingChildKeys` (r:10 w:0) + /// Storage: `SubtensorModule::PendingChildKeys` (r:34 w:0) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AutoStakeDestinationColdkeys` (r:5 w:0) + /// Storage: `SubtensorModule::AutoStakeDestinationColdkeys` (r:17 w:0) /// Proof: `SubtensorModule::AutoStakeDestinationColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlphaLastEpoch` (r:10 w:5) + /// Storage: `SubtensorModule::TotalHotkeyAlphaLastEpoch` (r:34 w:17) /// Proof: `SubtensorModule::TotalHotkeyAlphaLastEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:10 w:10) + /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:34 w:34) /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::VotingPower` (r:5 w:0) + /// Storage: `SubtensorModule::VotingPower` (r:17 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:4 w:8) + /// Storage: `SubtensorModule::Uids` (r:16 w:32) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Prometheus` (r:4 w:0) + /// Storage: `SubtensorModule::Prometheus` (r:16 w:0) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Axons` (r:4 w:0) + /// Storage: `SubtensorModule::Axons` (r:16 w:0) /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MechanismCountCurrent` (r:4 w:0) + /// Storage: `SubtensorModule::MechanismCountCurrent` (r:16 w:0) /// Proof: `SubtensorModule::MechanismCountCurrent` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::WeightCommits` (r:4 w:0) + /// Storage: `SubtensorModule::WeightCommits` (r:16 w:0) /// Proof: `SubtensorModule::WeightCommits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LoadedEmission` (r:4 w:0) + /// Storage: `SubtensorModule::LoadedEmission` (r:16 w:0) /// Proof: `SubtensorModule::LoadedEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NeuronCertificates` (r:4 w:0) + /// Storage: `SubtensorModule::NeuronCertificates` (r:16 w:0) /// Proof: `SubtensorModule::NeuronCertificates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:8 w:0) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:32 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:8 w:8) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:32 w:32) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1273 w:1273) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Keys` (r:0 w:4) + /// Storage: `SubtensorModule::Keys` (r:0 w:16) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `3172` - // Estimated: `28912` - // Minimum execution time: 1_266_031_000 picoseconds. - Weight::from_parts(1_276_767_000, 28912) - .saturating_add(T::DbWeight::get().reads(179_u64)) - .saturating_add(T::DbWeight::get().writes(97_u64)) + // Measured: `219071` + // Estimated: `6523886` + // Minimum execution time: 168_761_677_000 picoseconds. + Weight::from_parts(171_200_208_000, 6523886) + .saturating_add(T::DbWeight::get().reads(6911_u64)) + .saturating_add(T::DbWeight::get().writes(4111_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1790,8 +1790,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `818` // Estimated: `4283` - // Minimum execution time: 23_845_000 picoseconds. - Weight::from_parts(24_787_000, 4283) + // Minimum execution time: 25_187_000 picoseconds. + Weight::from_parts(26_149_000, 4283) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1805,8 +1805,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `774` // Estimated: `9189` - // Minimum execution time: 25_338_000 picoseconds. - Weight::from_parts(26_269_000, 9189) + // Minimum execution time: 27_011_000 picoseconds. + Weight::from_parts(28_052_000, 9189) .saturating_add(T::DbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -1867,8 +1867,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2235` // Estimated: `11306` - // Minimum execution time: 729_844_000 picoseconds. - Weight::from_parts(746_850_000, 11306) + // Minimum execution time: 686_838_000 picoseconds. + Weight::from_parts(711_382_000, 11306) .saturating_add(T::DbWeight::get().reads(43_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } @@ -1922,8 +1922,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2176` // Estimated: `10591` - // Minimum execution time: 806_187_000 picoseconds. - Weight::from_parts(821_450_000, 10591) + // Minimum execution time: 747_090_000 picoseconds. + Weight::from_parts(770_634_000, 10591) .saturating_add(T::DbWeight::get().reads(27_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } @@ -2064,10 +2064,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1835 + k * (44 ±0)` // Estimated: `10256 + k * (2579 ±0)` - // Minimum execution time: 505_751_000 picoseconds. - Weight::from_parts(253_066_381, 10256) - // Standard Error: 37_124 - .saturating_add(Weight::from_parts(51_320_642, 0).saturating_mul(k.into())) + // Minimum execution time: 508_022_000 picoseconds. + Weight::from_parts(329_641_381, 10256) + // Standard Error: 41_788 + .saturating_add(Weight::from_parts(50_236_445, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(50_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(53_u64)) @@ -2097,10 +2097,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1501 + k * (53 ±0)` // Estimated: `6148 + k * (2529 ±0)` - // Minimum execution time: 108_682_000 picoseconds. - Weight::from_parts(100_564_950, 6148) - // Standard Error: 8_188 - .saturating_add(Weight::from_parts(1_593_935, 0).saturating_mul(k.into())) + // Minimum execution time: 93_937_000 picoseconds. + Weight::from_parts(105_218_882, 6148) + // Standard Error: 8_896 + .saturating_add(Weight::from_parts(1_559_042, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(7_u64)) @@ -2117,8 +2117,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `762` // Estimated: `9177` - // Minimum execution time: 30_415_000 picoseconds. - Weight::from_parts(31_798_000, 9177) + // Minimum execution time: 33_994_000 picoseconds. + Weight::from_parts(35_176_000, 9177) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2154,8 +2154,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1248` // Estimated: `4713` - // Minimum execution time: 84_836_000 picoseconds. - Weight::from_parts(86_408_000, 4713) + // Minimum execution time: 85_600_000 picoseconds. + Weight::from_parts(87_374_000, 4713) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2171,8 +2171,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 31_657_000 picoseconds. - Weight::from_parts(32_549_000, 4274) + // Minimum execution time: 32_862_000 picoseconds. + Weight::from_parts(33_804_000, 4274) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2188,8 +2188,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 16_355_000 picoseconds. - Weight::from_parts(16_955_000, 3941) + // Minimum execution time: 18_024_000 picoseconds. + Weight::from_parts(18_474_000, 3941) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2221,8 +2221,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1969` // Estimated: `7909` - // Minimum execution time: 144_895_000 picoseconds. - Weight::from_parts(146_528_000, 7909) + // Minimum execution time: 139_241_000 picoseconds. + Weight::from_parts(141_625_000, 7909) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -2232,8 +2232,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_043_000 picoseconds. - Weight::from_parts(2_193_000, 0) + // Minimum execution time: 2_665_000 picoseconds. + Weight::from_parts(2_905_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -2244,8 +2244,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 13_761_000 picoseconds. - Weight::from_parts(14_141_000, 4117) + // Minimum execution time: 14_437_000 picoseconds. + Weight::from_parts(14_667_000, 4117) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2259,8 +2259,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 25_518_000 picoseconds. - Weight::from_parts(26_259_000, 4364) + // Minimum execution time: 27_461_000 picoseconds. + Weight::from_parts(28_273_000, 4364) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -2332,8 +2332,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2229` // Estimated: `8727` - // Minimum execution time: 1_041_487_000 picoseconds. - Weight::from_parts(1_050_321_000, 8727) + // Minimum execution time: 989_125_000 picoseconds. + Weight::from_parts(994_564_000, 8727) .saturating_add(T::DbWeight::get().reads(33_u64)) .saturating_add(T::DbWeight::get().writes(17_u64)) } @@ -2355,8 +2355,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `885` // Estimated: `4350` - // Minimum execution time: 40_330_000 picoseconds. - Weight::from_parts(41_352_000, 4350) + // Minimum execution time: 41_788_000 picoseconds. + Weight::from_parts(43_001_000, 4350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -2366,8 +2366,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_083_000 picoseconds. - Weight::from_parts(2_243_000, 0) + // Minimum execution time: 2_896_000 picoseconds. + Weight::from_parts(3_086_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -2410,8 +2410,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1830` // Estimated: `7770` - // Minimum execution time: 126_528_000 picoseconds. - Weight::from_parts(128_682_000, 7770) + // Minimum execution time: 124_053_000 picoseconds. + Weight::from_parts(125_365_000, 7770) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -2443,8 +2443,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1515` // Estimated: `7455` - // Minimum execution time: 167_459_000 picoseconds. - Weight::from_parts(170_092_000, 7455) + // Minimum execution time: 159_229_000 picoseconds. + Weight::from_parts(160_150_000, 7455) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -2462,8 +2462,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1157` // Estimated: `4622` - // Minimum execution time: 716_614_000 picoseconds. - Weight::from_parts(733_820_000, 4622) + // Minimum execution time: 684_593_000 picoseconds. + Weight::from_parts(704_060_000, 4622) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2487,8 +2487,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `982` // Estimated: `4447` - // Minimum execution time: 39_789_000 picoseconds. - Weight::from_parts(41_672_000, 4447) + // Minimum execution time: 42_119_000 picoseconds. + Weight::from_parts(43_212_000, 4447) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -2500,8 +2500,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 16_395_000 picoseconds. - Weight::from_parts(16_745_000, 4198) + // Minimum execution time: 16_781_000 picoseconds. + Weight::from_parts(17_373_000, 4198) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) @@ -2528,8 +2528,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1731` // Estimated: `7671` - // Minimum execution time: 51_396_000 picoseconds. - Weight::from_parts(52_438_000, 7671) + // Minimum execution time: 52_168_000 picoseconds. + Weight::from_parts(53_500_000, 7671) .saturating_add(T::DbWeight::get().reads(11_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -2550,8 +2550,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1019` // Estimated: `4484` - // Minimum execution time: 33_920_000 picoseconds. - Weight::from_parts(34_972_000, 4484) + // Minimum execution time: 34_816_000 picoseconds. + Weight::from_parts(35_767_000, 4484) .saturating_add(T::DbWeight::get().reads(7_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:1 w:0) @@ -2564,8 +2564,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `721` // Estimated: `4186` - // Minimum execution time: 14_672_000 picoseconds. - Weight::from_parts(14_982_000, 4186) + // Minimum execution time: 15_078_000 picoseconds. + Weight::from_parts(15_518_000, 4186) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -2578,8 +2578,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `647` // Estimated: `4112` - // Minimum execution time: 18_237_000 picoseconds. - Weight::from_parts(18_708_000, 4112) + // Minimum execution time: 18_585_000 picoseconds. + Weight::from_parts(19_296_000, 4112) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -2590,8 +2590,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 13_971_000 picoseconds. - Weight::from_parts(14_782_000, 4117) + // Minimum execution time: 15_108_000 picoseconds. + Weight::from_parts(15_489_000, 4117) .saturating_add(T::DbWeight::get().reads(2_u64)) } } @@ -2676,8 +2676,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1865` // Estimated: `6148` - // Minimum execution time: 352_754_000 picoseconds. - Weight::from_parts(356_540_000, 6148) + // Minimum execution time: 362_389_000 picoseconds. + Weight::from_parts(364_683_000, 6148) .saturating_add(RocksDbWeight::get().reads(34_u64)) .saturating_add(RocksDbWeight::get().writes(29_u64)) } @@ -2719,8 +2719,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `188820` // Estimated: `10327410` - // Minimum execution time: 16_725_626_000 picoseconds. - Weight::from_parts(17_365_948_000, 10327410) + // Minimum execution time: 15_329_095_000 picoseconds. + Weight::from_parts(15_577_909_000, 10327410) .saturating_add(RocksDbWeight::get().reads(4112_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2790,8 +2790,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2226` // Estimated: `8727` - // Minimum execution time: 689_695_000 picoseconds. - Weight::from_parts(708_463_000, 8727) + // Minimum execution time: 660_157_000 picoseconds. + Weight::from_parts(682_328_000, 8727) .saturating_add(RocksDbWeight::get().reads(32_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -2807,8 +2807,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 36_164_000 picoseconds. - Weight::from_parts(37_075_000, 4293) + // Minimum execution time: 37_149_000 picoseconds. + Weight::from_parts(37_831_000, 4293) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2824,8 +2824,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4392` - // Minimum execution time: 34_191_000 picoseconds. - Weight::from_parts(35_243_000, 4392) + // Minimum execution time: 35_126_000 picoseconds. + Weight::from_parts(35_617_000, 4392) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2907,8 +2907,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1798` // Estimated: `6148` - // Minimum execution time: 354_477_000 picoseconds. - Weight::from_parts(357_842_000, 6148) + // Minimum execution time: 348_623_000 picoseconds. + Weight::from_parts(365_124_000, 6148) .saturating_add(RocksDbWeight::get().reads(34_u64)) .saturating_add(RocksDbWeight::get().writes(29_u64)) } @@ -2960,8 +2960,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1516` // Estimated: `4981` - // Minimum execution time: 103_874_000 picoseconds. - Weight::from_parts(107_119_000, 4981) + // Minimum execution time: 103_914_000 picoseconds. + Weight::from_parts(106_500_000, 4981) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -3083,8 +3083,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1532` // Estimated: `9947` - // Minimum execution time: 281_649_000 picoseconds. - Weight::from_parts(288_668_000, 9947) + // Minimum execution time: 297_417_000 picoseconds. + Weight::from_parts(306_113_000, 9947) .saturating_add(RocksDbWeight::get().reads(41_u64)) .saturating_add(RocksDbWeight::get().writes(48_u64)) } @@ -3118,8 +3118,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1249` // Estimated: `4714` - // Minimum execution time: 68_141_000 picoseconds. - Weight::from_parts(70_104_000, 4714) + // Minimum execution time: 68_428_000 picoseconds. + Weight::from_parts(69_841_000, 4714) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3165,8 +3165,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 112_226_000 picoseconds. - Weight::from_parts(114_661_000, 7590) + // Minimum execution time: 113_753_000 picoseconds. + Weight::from_parts(115_677_000, 7590) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3176,8 +3176,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_336_000 picoseconds. - Weight::from_parts(4_496_000, 0) + // Minimum execution time: 5_651_000 picoseconds. + Weight::from_parts(5_941_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -3200,8 +3200,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1033` // Estimated: `4498` - // Minimum execution time: 55_112_000 picoseconds. - Weight::from_parts(56_764_000, 4498) + // Minimum execution time: 55_384_000 picoseconds. + Weight::from_parts(55_974_000, 4498) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3217,8 +3217,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `694` // Estimated: `4159` - // Minimum execution time: 44_986_000 picoseconds. - Weight::from_parts(46_500_000, 4159) + // Minimum execution time: 46_918_000 picoseconds. + Weight::from_parts(48_231_000, 4159) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -3266,8 +3266,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2110` // Estimated: `13000` - // Minimum execution time: 297_051_000 picoseconds. - Weight::from_parts(303_430_000, 13000) + // Minimum execution time: 298_409_000 picoseconds. + Weight::from_parts(302_957_000, 13000) .saturating_add(RocksDbWeight::get().reads(39_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -3319,8 +3319,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2166` // Estimated: `13056` - // Minimum execution time: 321_948_000 picoseconds. - Weight::from_parts(326_835_000, 13056) + // Minimum execution time: 323_075_000 picoseconds. + Weight::from_parts(327_203_000, 13056) .saturating_add(RocksDbWeight::get().reads(39_u64)) .saturating_add(RocksDbWeight::get().writes(20_u64)) } @@ -3332,8 +3332,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `665` // Estimated: `4130` - // Minimum execution time: 20_591_000 picoseconds. - Weight::from_parts(21_242_000, 4130) + // Minimum execution time: 22_332_000 picoseconds. + Weight::from_parts(22_763_000, 4130) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3345,8 +3345,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `613` // Estimated: `4078` - // Minimum execution time: 16_885_000 picoseconds. - Weight::from_parts(17_345_000, 4078) + // Minimum execution time: 18_535_000 picoseconds. + Weight::from_parts(19_286_000, 4078) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -3358,8 +3358,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_231_000 picoseconds. - Weight::from_parts(7_542_000, 0) + // Minimum execution time: 8_676_000 picoseconds. + Weight::from_parts(8_977_000, 0) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -3404,8 +3404,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2155` // Estimated: `8095` - // Minimum execution time: 428_717_000 picoseconds. - Weight::from_parts(445_321_000, 8095) + // Minimum execution time: 419_336_000 picoseconds. + Weight::from_parts(424_766_000, 8095) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3439,8 +3439,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 184_805_000 picoseconds. - Weight::from_parts(195_741_000, 5219) + // Minimum execution time: 172_995_000 picoseconds. + Weight::from_parts(174_738_000, 5219) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -3472,8 +3472,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1754` // Estimated: `5219` - // Minimum execution time: 181_350_000 picoseconds. - Weight::from_parts(182_581_000, 5219) + // Minimum execution time: 168_626_000 picoseconds. + Weight::from_parts(170_771_000, 5219) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -3493,8 +3493,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1118` // Estimated: `4583` - // Minimum execution time: 37_586_000 picoseconds. - Weight::from_parts(38_778_000, 4583) + // Minimum execution time: 38_692_000 picoseconds. + Weight::from_parts(39_624_000, 4583) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3564,11 +3564,17 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2226` // Estimated: `8727` - // Minimum execution time: 913_477_000 picoseconds. - Weight::from_parts(926_927_000, 8727) + // Minimum execution time: 848_440_000 picoseconds. + Weight::from_parts(867_877_000, 8727) .saturating_add(RocksDbWeight::get().reads(32_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:2 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -3579,12 +3585,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:2 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:1 w:0) @@ -3601,8 +3601,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1979` // Estimated: `7919` - // Minimum execution time: 221_830_000 picoseconds. - Weight::from_parts(225_024_000, 7919) + // Minimum execution time: 194_375_000 picoseconds. + Weight::from_parts(196_448_000, 7919) .saturating_add(RocksDbWeight::get().reads(19_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -3658,8 +3658,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2142` // Estimated: `10557` - // Minimum execution time: 585_780_000 picoseconds. - Weight::from_parts(602_415_000, 10557) + // Minimum execution time: 562_384_000 picoseconds. + Weight::from_parts(584_084_000, 10557) .saturating_add(RocksDbWeight::get().reads(28_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -3713,21 +3713,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2176` // Estimated: `10591` - // Minimum execution time: 778_446_000 picoseconds. - Weight::from_parts(797_084_000, 10591) + // Minimum execution time: 729_086_000 picoseconds. + Weight::from_parts(754_454_000, 10591) .saturating_add(RocksDbWeight::get().reads(27_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } - /// Storage: `SubtensorModule::Alpha` (r:2 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) - /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) - /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetAlphaIn` (r:2 w:2) @@ -3746,6 +3736,16 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Owner` (r:1 w:0) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:2 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:2 w:0) + /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) + /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:0) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Lock` (r:3 w:1) @@ -3786,11 +3786,17 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2662` // Estimated: `11077` - // Minimum execution time: 985_745_000 picoseconds. - Weight::from_parts(995_639_000, 11077) + // Minimum execution time: 902_290_000 picoseconds. + Weight::from_parts(926_466_000, 11077) .saturating_add(RocksDbWeight::get().reads(47_u64)) .saturating_add(RocksDbWeight::get().writes(24_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -3801,12 +3807,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:1 w:1) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:1 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TransferToggle` (r:1 w:0) /// Proof: `SubtensorModule::TransferToggle` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::StakingHotkeys` (r:2 w:1) @@ -3827,11 +3827,17 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1988` // Estimated: `7928` - // Minimum execution time: 257_983_000 picoseconds. - Weight::from_parts(259_696_000, 7928) + // Minimum execution time: 226_044_000 picoseconds. + Weight::from_parts(228_018_000, 7928) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } + /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) + /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) + /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Owner` (r:1 w:0) + /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Alpha` (r:2 w:0) /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AlphaV2` (r:2 w:2) @@ -3842,12 +3848,6 @@ impl WeightInfo for () { /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:2 w:2) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:2 w:0) - /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubtokenEnabled` (r:2 w:0) - /// Proof: `SubtensorModule::SubtokenEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Owner` (r:1 w:0) - /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetMechanism` (r:2 w:0) /// Proof: `SubtensorModule::SubnetMechanism` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::SubnetTAO` (r:2 w:2) @@ -3900,8 +3900,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2505` // Estimated: `10920` - // Minimum execution time: 743_614_000 picoseconds. - Weight::from_parts(758_998_000, 10920) + // Minimum execution time: 696_305_000 picoseconds. + Weight::from_parts(716_563_000, 10920) .saturating_add(RocksDbWeight::get().reads(47_u64)) .saturating_add(RocksDbWeight::get().writes(24_u64)) } @@ -3939,8 +3939,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1300` // Estimated: `4765` - // Minimum execution time: 154_690_000 picoseconds. - Weight::from_parts(163_683_000, 4765) + // Minimum execution time: 150_943_000 picoseconds. + Weight::from_parts(158_827_000, 4765) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3980,8 +3980,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1455` // Estimated: `7395` - // Minimum execution time: 101_931_000 picoseconds. - Weight::from_parts(102_873_000, 7395) + // Minimum execution time: 102_251_000 picoseconds. + Weight::from_parts(103_163_000, 7395) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -3997,8 +3997,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `830` // Estimated: `4295` - // Minimum execution time: 27_672_000 picoseconds. - Weight::from_parts(28_413_000, 4295) + // Minimum execution time: 29_034_000 picoseconds. + Weight::from_parts(30_257_000, 4295) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4016,8 +4016,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `923` // Estimated: `4388` - // Minimum execution time: 34_261_000 picoseconds. - Weight::from_parts(34_871_000, 4388) + // Minimum execution time: 36_087_000 picoseconds. + Weight::from_parts(36_980_000, 4388) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4139,8 +4139,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1468` // Estimated: `9883` - // Minimum execution time: 282_209_000 picoseconds. - Weight::from_parts(287_627_000, 9883) + // Minimum execution time: 294_192_000 picoseconds. + Weight::from_parts(301_796_000, 9883) .saturating_add(RocksDbWeight::get().reads(40_u64)) .saturating_add(RocksDbWeight::get().writes(47_u64)) } @@ -4156,8 +4156,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `799` // Estimated: `4264` - // Minimum execution time: 35_403_000 picoseconds. - Weight::from_parts(36_814_000, 4264) + // Minimum execution time: 35_927_000 picoseconds. + Weight::from_parts(37_350_000, 4264) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4171,8 +4171,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `889` // Estimated: `6829` - // Minimum execution time: 30_195_000 picoseconds. - Weight::from_parts(31_066_000, 6829) + // Minimum execution time: 31_549_000 picoseconds. + Weight::from_parts(32_721_000, 6829) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4186,91 +4186,91 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `738` // Estimated: `4203` - // Minimum execution time: 20_771_000 picoseconds. - Weight::from_parts(21_892_000, 4203) + // Minimum execution time: 22_993_000 picoseconds. + Weight::from_parts(24_086_000, 4203) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::Owner` (r:2 w:2) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::IsNetworkMember` (r:6 w:10) + /// Storage: `SubtensorModule::IsNetworkMember` (r:18 w:34) /// Proof: `SubtensorModule::IsNetworkMember` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimable` (r:2 w:2) /// Proof: `SubtensorModule::RootClaimable` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:9 w:8) + /// Storage: `SubtensorModule::TotalHotkeyAlpha` (r:33 w:32) /// Proof: `SubtensorModule::TotalHotkeyAlpha` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::RootClaimed` (r:1 w:0) /// Proof: `SubtensorModule::RootClaimed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::Alpha` (r:2547 w:0) + /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SubtensorModule::AlphaV2` (r:2547 w:2546) + /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::LastRateLimitedBlock` (r:2 w:5) /// Proof: `SubtensorModule::LastRateLimitedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NetworksAdded` (r:6 w:0) + /// Storage: `SubtensorModule::NetworksAdded` (r:18 w:0) /// Proof: `SubtensorModule::NetworksAdded` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ChildKeys` (r:10 w:10) + /// Storage: `SubtensorModule::ChildKeys` (r:34 w:34) /// Proof: `SubtensorModule::ChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LastHotkeySwapOnNetuid` (r:4 w:4) + /// Storage: `SubtensorModule::LastHotkeySwapOnNetuid` (r:16 w:16) /// Proof: `SubtensorModule::LastHotkeySwapOnNetuid` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::TotalIssuance` (r:1 w:1) /// Proof: `SubtensorModule::TotalIssuance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Alpha` (r:9 w:0) - /// Proof: `SubtensorModule::Alpha` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaV2` (r:9 w:8) - /// Proof: `SubtensorModule::AlphaV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:5 w:0) + /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:17 w:0) /// Proof: `SubtensorModule::SubnetOwnerHotkey` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::HotkeyLock` (r:5 w:0) + /// Storage: `SubtensorModule::HotkeyLock` (r:17 w:0) /// Proof: `SubtensorModule::HotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:5 w:0) + /// Storage: `SubtensorModule::DecayingHotkeyLock` (r:17 w:0) /// Proof: `SubtensorModule::DecayingHotkeyLock` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::OwnedHotkeys` (r:1 w:1) /// Proof: `SubtensorModule::OwnedHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ChildkeyTake` (r:5 w:0) + /// Storage: `SubtensorModule::ChildkeyTake` (r:17 w:0) /// Proof: `SubtensorModule::ChildkeyTake` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::ParentKeys` (r:10 w:10) + /// Storage: `SubtensorModule::ParentKeys` (r:34 w:34) /// Proof: `SubtensorModule::ParentKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::PendingChildKeys` (r:10 w:0) + /// Storage: `SubtensorModule::PendingChildKeys` (r:34 w:0) /// Proof: `SubtensorModule::PendingChildKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AutoStakeDestinationColdkeys` (r:5 w:0) + /// Storage: `SubtensorModule::AutoStakeDestinationColdkeys` (r:17 w:0) /// Proof: `SubtensorModule::AutoStakeDestinationColdkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyAlphaLastEpoch` (r:10 w:5) + /// Storage: `SubtensorModule::TotalHotkeyAlphaLastEpoch` (r:34 w:17) /// Proof: `SubtensorModule::TotalHotkeyAlphaLastEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:10 w:10) + /// Storage: `SubtensorModule::AlphaDividendsPerSubnet` (r:34 w:34) /// Proof: `SubtensorModule::AlphaDividendsPerSubnet` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::VotingPower` (r:5 w:0) + /// Storage: `SubtensorModule::VotingPower` (r:17 w:0) /// Proof: `SubtensorModule::VotingPower` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::AutoParentDelegationEnabled` (r:1 w:0) /// Proof: `SubtensorModule::AutoParentDelegationEnabled` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Uids` (r:4 w:8) + /// Storage: `SubtensorModule::Uids` (r:16 w:32) /// Proof: `SubtensorModule::Uids` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Prometheus` (r:4 w:0) + /// Storage: `SubtensorModule::Prometheus` (r:16 w:0) /// Proof: `SubtensorModule::Prometheus` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Axons` (r:4 w:0) + /// Storage: `SubtensorModule::Axons` (r:16 w:0) /// Proof: `SubtensorModule::Axons` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::MechanismCountCurrent` (r:4 w:0) + /// Storage: `SubtensorModule::MechanismCountCurrent` (r:16 w:0) /// Proof: `SubtensorModule::MechanismCountCurrent` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::WeightCommits` (r:4 w:0) + /// Storage: `SubtensorModule::WeightCommits` (r:16 w:0) /// Proof: `SubtensorModule::WeightCommits` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::LoadedEmission` (r:4 w:0) + /// Storage: `SubtensorModule::LoadedEmission` (r:16 w:0) /// Proof: `SubtensorModule::LoadedEmission` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::NeuronCertificates` (r:4 w:0) + /// Storage: `SubtensorModule::NeuronCertificates` (r:16 w:0) /// Proof: `SubtensorModule::NeuronCertificates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeyShares` (r:8 w:0) + /// Storage: `SubtensorModule::TotalHotkeyShares` (r:32 w:0) /// Proof: `SubtensorModule::TotalHotkeyShares` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:8 w:8) + /// Storage: `SubtensorModule::TotalHotkeySharesV2` (r:32 w:32) /// Proof: `SubtensorModule::TotalHotkeySharesV2` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::StakingHotkeys` (r:1 w:1) + /// Storage: `SubtensorModule::StakingHotkeys` (r:1273 w:1273) /// Proof: `SubtensorModule::StakingHotkeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SubtensorModule::Delegates` (r:1 w:0) /// Proof: `SubtensorModule::Delegates` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SubtensorModule::Keys` (r:0 w:4) + /// Storage: `SubtensorModule::Keys` (r:0 w:16) /// Proof: `SubtensorModule::Keys` (`max_values`: None, `max_size`: None, mode: `Measured`) fn swap_hotkey() -> Weight { // Proof Size summary in bytes: - // Measured: `3172` - // Estimated: `28912` - // Minimum execution time: 1_266_031_000 picoseconds. - Weight::from_parts(1_276_767_000, 28912) - .saturating_add(RocksDbWeight::get().reads(179_u64)) - .saturating_add(RocksDbWeight::get().writes(97_u64)) + // Measured: `219071` + // Estimated: `6523886` + // Minimum execution time: 168_761_677_000 picoseconds. + Weight::from_parts(171_200_208_000, 6523886) + .saturating_add(RocksDbWeight::get().reads(6911_u64)) + .saturating_add(RocksDbWeight::get().writes(4111_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:1) /// Proof: `SubtensorModule::Owner` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -4282,8 +4282,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `818` // Estimated: `4283` - // Minimum execution time: 23_845_000 picoseconds. - Weight::from_parts(24_787_000, 4283) + // Minimum execution time: 25_187_000 picoseconds. + Weight::from_parts(26_149_000, 4283) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -4297,8 +4297,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `774` // Estimated: `9189` - // Minimum execution time: 25_338_000 picoseconds. - Weight::from_parts(26_269_000, 9189) + // Minimum execution time: 27_011_000 picoseconds. + Weight::from_parts(28_052_000, 9189) .saturating_add(RocksDbWeight::get().reads(6_u64)) } /// Storage: `SubtensorModule::Owner` (r:1 w:0) @@ -4359,8 +4359,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2235` // Estimated: `11306` - // Minimum execution time: 729_844_000 picoseconds. - Weight::from_parts(746_850_000, 11306) + // Minimum execution time: 686_838_000 picoseconds. + Weight::from_parts(711_382_000, 11306) .saturating_add(RocksDbWeight::get().reads(43_u64)) .saturating_add(RocksDbWeight::get().writes(25_u64)) } @@ -4414,8 +4414,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2176` // Estimated: `10591` - // Minimum execution time: 806_187_000 picoseconds. - Weight::from_parts(821_450_000, 10591) + // Minimum execution time: 747_090_000 picoseconds. + Weight::from_parts(770_634_000, 10591) .saturating_add(RocksDbWeight::get().reads(27_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } @@ -4556,10 +4556,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1835 + k * (44 ±0)` // Estimated: `10256 + k * (2579 ±0)` - // Minimum execution time: 505_751_000 picoseconds. - Weight::from_parts(253_066_381, 10256) - // Standard Error: 37_124 - .saturating_add(Weight::from_parts(51_320_642, 0).saturating_mul(k.into())) + // Minimum execution time: 508_022_000 picoseconds. + Weight::from_parts(329_641_381, 10256) + // Standard Error: 41_788 + .saturating_add(Weight::from_parts(50_236_445, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(50_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(53_u64)) @@ -4589,10 +4589,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1501 + k * (53 ±0)` // Estimated: `6148 + k * (2529 ±0)` - // Minimum execution time: 108_682_000 picoseconds. - Weight::from_parts(100_564_950, 6148) - // Standard Error: 8_188 - .saturating_add(Weight::from_parts(1_593_935, 0).saturating_mul(k.into())) + // Minimum execution time: 93_937_000 picoseconds. + Weight::from_parts(105_218_882, 6148) + // Standard Error: 8_896 + .saturating_add(Weight::from_parts(1_559_042, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(7_u64)) @@ -4609,8 +4609,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `762` // Estimated: `9177` - // Minimum execution time: 30_415_000 picoseconds. - Weight::from_parts(31_798_000, 9177) + // Minimum execution time: 33_994_000 picoseconds. + Weight::from_parts(35_176_000, 9177) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4646,8 +4646,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1248` // Estimated: `4713` - // Minimum execution time: 84_836_000 picoseconds. - Weight::from_parts(86_408_000, 4713) + // Minimum execution time: 85_600_000 picoseconds. + Weight::from_parts(87_374_000, 4713) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4663,8 +4663,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `809` // Estimated: `4274` - // Minimum execution time: 31_657_000 picoseconds. - Weight::from_parts(32_549_000, 4274) + // Minimum execution time: 32_862_000 picoseconds. + Weight::from_parts(33_804_000, 4274) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4680,8 +4680,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `476` // Estimated: `3941` - // Minimum execution time: 16_355_000 picoseconds. - Weight::from_parts(16_955_000, 3941) + // Minimum execution time: 18_024_000 picoseconds. + Weight::from_parts(18_474_000, 3941) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4713,8 +4713,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1969` // Estimated: `7909` - // Minimum execution time: 144_895_000 picoseconds. - Weight::from_parts(146_528_000, 7909) + // Minimum execution time: 139_241_000 picoseconds. + Weight::from_parts(141_625_000, 7909) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -4724,8 +4724,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_043_000 picoseconds. - Weight::from_parts(2_193_000, 0) + // Minimum execution time: 2_665_000 picoseconds. + Weight::from_parts(2_905_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -4736,8 +4736,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 13_761_000 picoseconds. - Weight::from_parts(14_141_000, 4117) + // Minimum execution time: 14_437_000 picoseconds. + Weight::from_parts(14_667_000, 4117) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4751,8 +4751,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `899` // Estimated: `4364` - // Minimum execution time: 25_518_000 picoseconds. - Weight::from_parts(26_259_000, 4364) + // Minimum execution time: 27_461_000 picoseconds. + Weight::from_parts(28_273_000, 4364) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -4824,8 +4824,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2229` // Estimated: `8727` - // Minimum execution time: 1_041_487_000 picoseconds. - Weight::from_parts(1_050_321_000, 8727) + // Minimum execution time: 989_125_000 picoseconds. + Weight::from_parts(994_564_000, 8727) .saturating_add(RocksDbWeight::get().reads(33_u64)) .saturating_add(RocksDbWeight::get().writes(17_u64)) } @@ -4847,8 +4847,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `885` // Estimated: `4350` - // Minimum execution time: 40_330_000 picoseconds. - Weight::from_parts(41_352_000, 4350) + // Minimum execution time: 41_788_000 picoseconds. + Weight::from_parts(43_001_000, 4350) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -4858,8 +4858,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_083_000 picoseconds. - Weight::from_parts(2_243_000, 0) + // Minimum execution time: 2_896_000 picoseconds. + Weight::from_parts(3_086_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `SubtensorModule::NetworksAdded` (r:1 w:0) @@ -4902,8 +4902,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1830` // Estimated: `7770` - // Minimum execution time: 126_528_000 picoseconds. - Weight::from_parts(128_682_000, 7770) + // Minimum execution time: 124_053_000 picoseconds. + Weight::from_parts(125_365_000, 7770) .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -4935,8 +4935,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1515` // Estimated: `7455` - // Minimum execution time: 167_459_000 picoseconds. - Weight::from_parts(170_092_000, 7455) + // Minimum execution time: 159_229_000 picoseconds. + Weight::from_parts(160_150_000, 7455) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -4954,8 +4954,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1157` // Estimated: `4622` - // Minimum execution time: 716_614_000 picoseconds. - Weight::from_parts(733_820_000, 4622) + // Minimum execution time: 684_593_000 picoseconds. + Weight::from_parts(704_060_000, 4622) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4979,8 +4979,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `982` // Estimated: `4447` - // Minimum execution time: 39_789_000 picoseconds. - Weight::from_parts(41_672_000, 4447) + // Minimum execution time: 42_119_000 picoseconds. + Weight::from_parts(43_212_000, 4447) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -4992,8 +4992,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 16_395_000 picoseconds. - Weight::from_parts(16_745_000, 4198) + // Minimum execution time: 16_781_000 picoseconds. + Weight::from_parts(17_373_000, 4198) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SubtensorModule::SubnetOwnerHotkey` (r:1 w:0) @@ -5020,8 +5020,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1731` // Estimated: `7671` - // Minimum execution time: 51_396_000 picoseconds. - Weight::from_parts(52_438_000, 7671) + // Minimum execution time: 52_168_000 picoseconds. + Weight::from_parts(53_500_000, 7671) .saturating_add(RocksDbWeight::get().reads(11_u64)) } /// Storage: `SubtensorModule::CommitRevealWeightsEnabled` (r:1 w:0) @@ -5042,8 +5042,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1019` // Estimated: `4484` - // Minimum execution time: 33_920_000 picoseconds. - Weight::from_parts(34_972_000, 4484) + // Minimum execution time: 34_816_000 picoseconds. + Weight::from_parts(35_767_000, 4484) .saturating_add(RocksDbWeight::get().reads(7_u64)) } /// Storage: `SubtensorModule::MinDelegateTake` (r:1 w:0) @@ -5056,8 +5056,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `721` // Estimated: `4186` - // Minimum execution time: 14_672_000 picoseconds. - Weight::from_parts(14_982_000, 4186) + // Minimum execution time: 15_078_000 picoseconds. + Weight::from_parts(15_518_000, 4186) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -5070,8 +5070,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `647` // Estimated: `4112` - // Minimum execution time: 18_237_000 picoseconds. - Weight::from_parts(18_708_000, 4112) + // Minimum execution time: 18_585_000 picoseconds. + Weight::from_parts(19_296_000, 4112) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `SubtensorModule::Uids` (r:1 w:0) @@ -5082,8 +5082,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `652` // Estimated: `4117` - // Minimum execution time: 13_971_000 picoseconds. - Weight::from_parts(14_782_000, 4117) + // Minimum execution time: 15_108_000 picoseconds. + Weight::from_parts(15_489_000, 4117) .saturating_add(RocksDbWeight::get().reads(2_u64)) } } diff --git a/pallets/utility/src/weights.rs b/pallets/utility/src/weights.rs index e69d5889ec..44d6ca05ab 100644 --- a/pallets/utility/src/weights.rs +++ b/pallets/utility/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_subtensor_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0 -//! DATE: 2026-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 9V74 80-Core Processor` +//! HOSTNAME: `runnervm5mmn9`, CPU: `AMD EPYC 7763 64-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -22,7 +22,7 @@ // --no-storage-info // --no-min-squares // --no-median-slopes -// --output=/tmp/tmp.Hb92JKVB3W +// --output=/tmp/tmp.BzMP7O5VG3 // --template=/home/runner/work/subtensor/subtensor/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -57,10 +57,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 4_046_000 picoseconds. - Weight::from_parts(22_636_151, 3983) - // Standard Error: 2_757 - .saturating_add(Weight::from_parts(5_310_242, 0).saturating_mul(c.into())) + // Minimum execution time: 4_899_000 picoseconds. + Weight::from_parts(17_074_386, 3983) + // Standard Error: 2_223 + .saturating_add(Weight::from_parts(5_790_025, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -71,8 +71,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 13_861_000 picoseconds. - Weight::from_parts(14_181_000, 3983) + // Minimum execution time: 15_339_000 picoseconds. + Weight::from_parts(15_800_000, 3983) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -84,18 +84,18 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(34_748_875, 3983) - // Standard Error: 4_003 - .saturating_add(Weight::from_parts(5_542_239, 0).saturating_mul(c.into())) + // Minimum execution time: 5_030_000 picoseconds. + Weight::from_parts(2_851_506, 3983) + // Standard Error: 7_045 + .saturating_add(Weight::from_parts(6_103_978, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_538_000 picoseconds. - Weight::from_parts(5_778_000, 0) + // Minimum execution time: 7_003_000 picoseconds. + Weight::from_parts(7_293_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -106,18 +106,18 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 4_056_000 picoseconds. - Weight::from_parts(24_627_910, 3983) - // Standard Error: 2_609 - .saturating_add(Weight::from_parts(5_312_573, 0).saturating_mul(c.into())) + // Minimum execution time: 5_029_000 picoseconds. + Weight::from_parts(30_782_380, 3983) + // Standard Error: 3_379 + .saturating_add(Weight::from_parts(5_775_616, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn dispatch_as_fallible() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_529_000 picoseconds. - Weight::from_parts(6_019_000, 0) + // Minimum execution time: 6_983_000 picoseconds. + Weight::from_parts(7_244_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -127,8 +127,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 19_249_000 picoseconds. - Weight::from_parts(19_749_000, 3983) + // Minimum execution time: 21_991_000 picoseconds. + Weight::from_parts(22_742_000, 3983) .saturating_add(T::DbWeight::get().reads(2_u64)) } } @@ -144,10 +144,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 4_046_000 picoseconds. - Weight::from_parts(22_636_151, 3983) - // Standard Error: 2_757 - .saturating_add(Weight::from_parts(5_310_242, 0).saturating_mul(c.into())) + // Minimum execution time: 4_899_000 picoseconds. + Weight::from_parts(17_074_386, 3983) + // Standard Error: 2_223 + .saturating_add(Weight::from_parts(5_790_025, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -158,8 +158,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 13_861_000 picoseconds. - Weight::from_parts(14_181_000, 3983) + // Minimum execution time: 15_339_000 picoseconds. + Weight::from_parts(15_800_000, 3983) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) @@ -171,18 +171,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 4_126_000 picoseconds. - Weight::from_parts(34_748_875, 3983) - // Standard Error: 4_003 - .saturating_add(Weight::from_parts(5_542_239, 0).saturating_mul(c.into())) + // Minimum execution time: 5_030_000 picoseconds. + Weight::from_parts(2_851_506, 3983) + // Standard Error: 7_045 + .saturating_add(Weight::from_parts(6_103_978, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_538_000 picoseconds. - Weight::from_parts(5_778_000, 0) + // Minimum execution time: 7_003_000 picoseconds. + Weight::from_parts(7_293_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -193,18 +193,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 4_056_000 picoseconds. - Weight::from_parts(24_627_910, 3983) - // Standard Error: 2_609 - .saturating_add(Weight::from_parts(5_312_573, 0).saturating_mul(c.into())) + // Minimum execution time: 5_029_000 picoseconds. + Weight::from_parts(30_782_380, 3983) + // Standard Error: 3_379 + .saturating_add(Weight::from_parts(5_775_616, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn dispatch_as_fallible() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_529_000 picoseconds. - Weight::from_parts(6_019_000, 0) + // Minimum execution time: 6_983_000 picoseconds. + Weight::from_parts(7_244_000, 0) } /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -214,8 +214,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3983` - // Minimum execution time: 19_249_000 picoseconds. - Weight::from_parts(19_749_000, 3983) + // Minimum execution time: 21_991_000 picoseconds. + Weight::from_parts(22_742_000, 3983) .saturating_add(RocksDbWeight::get().reads(2_u64)) } } diff --git a/precompiles/src/balance.rs b/precompiles/src/balance.rs new file mode 100644 index 0000000000..36b80489e3 --- /dev/null +++ b/precompiles/src/balance.rs @@ -0,0 +1,242 @@ +use core::marker::PhantomData; + +use pallet_evm::PrecompileHandle; +use precompile_utils::EvmResult; +use sp_core::{H256, U256}; + +use crate::PrecompileExt; +use crate::PrecompileHandleExt; + +pub struct BalancePrecompile(PhantomData); + +impl PrecompileExt for BalancePrecompile +where + R: frame_system::Config + pallet_balances::Config + pallet_evm::Config, + R::AccountId: From<[u8; 32]>, + ::Balance: Into, +{ + const INDEX: u64 = 2062; +} + +#[precompile_utils::precompile] +impl BalancePrecompile +where + R: frame_system::Config + pallet_balances::Config + pallet_evm::Config, + R::AccountId: From<[u8; 32]>, + ::Balance: Into, +{ + #[precompile::public("getFreeBalance(bytes32)")] + #[precompile::view] + fn get_free_balance(handle: &mut impl PrecompileHandle, coldkey: H256) -> EvmResult { + handle.record_db_reads::(1)?; + let coldkey = R::AccountId::from(coldkey.0); + Ok(pallet_balances::Pallet::::free_balance(&coldkey).into()) + } +} + +#[cfg(test)] +mod tests { + #![allow(clippy::arithmetic_side_effects)] + + use super::*; + use crate::Precompiles; + use crate::mock::{ + AccountId, Runtime, TestBalanceStatus, abi_word, addr_from_index, execute_precompile, + fund_account, new_test_ext, precompiles, selector_u32, + }; + use frame_support::{ + dispatch::DispatchResult, + traits::{ + ReservableCurrency, + tokens::{ + Fortitude, Preservation, + fungible::{Inspect, InspectFreeze, InspectHold, MutateFreeze, MutateHold}, + }, + }, + }; + use pallet_admin_utils::{PrecompileEnable, PrecompileEnum}; + use precompile_utils::prelude::RuntimeHelper; + use precompile_utils::solidity::encode_with_selector; + use precompile_utils::testing::PrecompileTesterExt; + + fn coldkey(byte: u8) -> AccountId { + AccountId::from([byte; 32]) + } + + fn balance_call_input(coldkey: &AccountId) -> Vec { + encode_with_selector( + selector_u32("getFreeBalance(bytes32)"), + (H256::from_slice(coldkey.as_ref()),), + ) + } + + #[test] + fn balance_precompile_returns_free_balance_for_coldkey() { + new_test_ext().execute_with(|| { + let caller = addr_from_index(0x7001); + let target = coldkey(0x11); + let amount = 123_456_789_u64; + fund_account(&target, amount); + + precompiles::>() + .prepare_test( + caller, + addr_from_index(BalancePrecompile::::INDEX), + balance_call_input(&target), + ) + .with_static_call(true) + .expect_cost(RuntimeHelper::::db_read_gas_cost()) + .execute_returns_raw(abi_word(U256::from(amount))); + }); + } + + #[test] + fn balance_precompile_returns_zero_for_unfunded_coldkey() { + new_test_ext().execute_with(|| { + let caller = addr_from_index(0x7001); + let target = coldkey(0x22); + + precompiles::>() + .prepare_test( + caller, + addr_from_index(BalancePrecompile::::INDEX), + balance_call_input(&target), + ) + .with_static_call(true) + .expect_cost(RuntimeHelper::::db_read_gas_cost()) + .execute_returns_raw(abi_word(U256::zero())); + }); + } + + #[test] + fn balance_precompile_returns_free_not_total_or_reducible_balance() -> DispatchResult { + new_test_ext().execute_with(|| -> DispatchResult { + let caller = addr_from_index(0x7001); + let target = coldkey(0x33); + let initial = 1_000_u64; + let reserved = 100_u64; + let held = 200_u64; + let frozen = 650_u64; + let expected_free = initial - reserved - held; + + fund_account(&target, initial); + pallet_balances::Pallet::::reserve(&target, reserved.into())?; + as MutateHold>::hold( + &TestBalanceStatus::Test, + &target, + held.into(), + )?; + as MutateFreeze>::set_freeze( + &TestBalanceStatus::Test, + &target, + frozen.into(), + )?; + + assert_eq!( + pallet_balances::Pallet::::reserved_balance(&target), + (reserved + held).into() + ); + assert_eq!( + as InspectHold>::balance_on_hold( + &TestBalanceStatus::Test, + &target, + ), + held.into() + ); + assert_eq!( + as InspectFreeze>::balance_frozen( + &TestBalanceStatus::Test, + &target, + ), + frozen.into() + ); + assert_eq!( + pallet_balances::Pallet::::total_balance(&target), + initial.into() + ); + assert_eq!( + as Inspect>::reducible_balance( + &target, + Preservation::Expendable, + Fortitude::Polite, + ), + 350_u64.into() + ); + assert_eq!( + pallet_balances::Pallet::::free_balance(&target), + expected_free.into() + ); + + precompiles::>() + .prepare_test( + caller, + addr_from_index(BalancePrecompile::::INDEX), + balance_call_input(&target), + ) + .with_static_call(true) + .expect_cost(RuntimeHelper::::db_read_gas_cost()) + .execute_returns_raw(abi_word(U256::from(expected_free))); + + Ok(()) + }) + } + + #[test] + fn balance_precompile_rejects_malformed_calldata() { + new_test_ext().execute_with(|| { + let caller = addr_from_index(0x7001); + let precompile_addr = addr_from_index(BalancePrecompile::::INDEX); + let mut malformed = selector_u32("getFreeBalance(bytes32)") + .to_be_bytes() + .to_vec(); + malformed.extend_from_slice(&[0u8; 31]); + + let result = execute_precompile( + &precompiles::>(), + precompile_addr, + caller, + malformed, + U256::zero(), + ); + + assert!( + matches!(result, Some(Err(_))), + "malformed calldata must not return a balance" + ); + }); + } + + #[test] + fn balance_precompile_respects_enable_disable_administration() { + new_test_ext().execute_with(|| { + let caller = addr_from_index(0x7001); + let target = coldkey(0x44); + let amount = 42_u64; + let precompile_addr = addr_from_index(BalancePrecompile::::INDEX); + let input = balance_call_input(&target); + let precompiles = Precompiles::::new(); + + fund_account(&target, amount); + + PrecompileEnable::::insert(PrecompileEnum::AccountBalance, false); + let disabled = execute_precompile( + &precompiles, + precompile_addr, + caller, + input.clone(), + U256::zero(), + ); + assert!( + matches!(disabled, Some(Err(_))), + "disabled account-balance precompile must reject calls" + ); + + PrecompileEnable::::insert(PrecompileEnum::AccountBalance, true); + precompiles + .prepare_test(caller, precompile_addr, input) + .with_static_call(true) + .expect_cost(RuntimeHelper::::db_read_gas_cost()) + .execute_returns_raw(abi_word(U256::from(amount))); + }); + } +} diff --git a/precompiles/src/lib.rs b/precompiles/src/lib.rs index cf54934d95..d70c3b5eea 100644 --- a/precompiles/src/lib.rs +++ b/precompiles/src/lib.rs @@ -7,6 +7,7 @@ use core::marker::PhantomData; use crate::extensions::*; pub use address_mapping::AddressMappingPrecompile; pub use alpha::AlphaPrecompile; +pub use balance::BalancePrecompile; pub use balance_transfer::BalanceTransferPrecompile; pub use crowdloan::CrowdloanPrecompile; pub use ed25519::Ed25519Verify; @@ -44,6 +45,7 @@ pub use voting_power::VotingPowerPrecompile; mod address_mapping; mod alpha; +mod balance; mod balance_transfer; mod crowdloan; mod ed25519; @@ -93,7 +95,7 @@ where + IsSubType> + IsSubType>, ::AddressMapping: AddressMapping, - ::Balance: TryFrom, + ::Balance: Into + TryFrom, <::Lookup as StaticLookup>::Source: From, { fn default() -> Self { @@ -130,14 +132,14 @@ where + IsSubType> + IsSubType>, ::AddressMapping: AddressMapping, - ::Balance: TryFrom, + ::Balance: Into + TryFrom, <::Lookup as StaticLookup>::Source: From, { pub fn new() -> Self { Self(Default::default()) } - pub fn used_addresses() -> [H160; 27] { + pub fn used_addresses() -> [H160; 28] { [ hash(1), hash(2), @@ -166,6 +168,7 @@ where hash(VotingPowerPrecompile::::INDEX), hash(ProxyPrecompile::::INDEX), hash(AddressMappingPrecompile::::INDEX), + hash(BalancePrecompile::::INDEX), ] } } @@ -201,7 +204,7 @@ where <::RuntimeCall as Dispatchable>::RuntimeOrigin: From>>, ::AddressMapping: AddressMapping, - ::Balance: TryFrom, + ::Balance: Into + TryFrom, <::Lookup as StaticLookup>::Source: From, { fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { @@ -274,6 +277,9 @@ where PrecompileEnum::AddressMapping, ) } + a if a == hash(BalancePrecompile::::INDEX) => { + BalancePrecompile::::try_execute::(handle, PrecompileEnum::AccountBalance) + } _ => None, } } diff --git a/precompiles/src/mock.rs b/precompiles/src/mock.rs index e256761b2a..0b0894d397 100644 --- a/precompiles/src/mock.rs +++ b/precompiles/src/mock.rs @@ -4,10 +4,11 @@ use core::{marker::PhantomData, num::NonZeroU64}; +use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use fp_evm::{Context, PrecompileResult}; use frame_support::{ PalletId, derive_impl, parameter_types, - traits::{Everything, PrivilegeCmp}, + traits::{Everything, PrivilegeCmp, VariantCount, VariantCountOf}, weights::Weight, }; use frame_system::{EnsureRoot, limits}; @@ -16,9 +17,10 @@ use pallet_evm::{ PrecompileHandle, PrecompileSet, SubstrateBalance, }; use precompile_utils::testing::MockHandle; +use scale_info::TypeInfo; use sp_core::{ConstU64, H160, H256, U256, crypto::AccountId32}; use sp_runtime::{ - BuildStorage, KeyTypeId, Perbill, Percent, + BuildStorage, KeyTypeId, Perbill, Percent, RuntimeDebug, testing::TestXt, traits::{BlakeTwo256, ConstU32, IdentityLookup}, }; @@ -31,6 +33,28 @@ pub(crate) type AccountId = AccountId32; pub(crate) type Block = frame_system::mocking::MockBlock; pub(crate) type UncheckedExtrinsic = TestXt; +#[derive( + Encode, + Decode, + DecodeWithMemTracking, + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + MaxEncodedLen, + TypeInfo, + RuntimeDebug, +)] +pub enum TestBalanceStatus { + Test, +} + +impl VariantCount for TestBalanceStatus { + const VARIANT_COUNT: u32 = 1; +} + frame_support::construct_runtime!( pub enum Runtime { System: frame_system = 1, @@ -194,10 +218,11 @@ impl pallet_balances::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type ReserveIdentifier = [u8; 8]; - type FreezeIdentifier = (); - type MaxFreezes = (); - type RuntimeHoldReason = (); + type ReserveIdentifier = TestBalanceStatus; + type RuntimeHoldReason = TestBalanceStatus; + type RuntimeFreezeReason = TestBalanceStatus; + type FreezeIdentifier = TestBalanceStatus; + type MaxFreezes = VariantCountOf; } impl pallet_alpha_assets::Config for Runtime {} diff --git a/precompiles/src/solidity/balance.abi b/precompiles/src/solidity/balance.abi new file mode 100644 index 0000000000..6f6e51c1af --- /dev/null +++ b/precompiles/src/solidity/balance.abi @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "coldkey", + "type": "bytes32" + } + ], + "name": "getFreeBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/precompiles/src/solidity/balance.sol b/precompiles/src/solidity/balance.sol new file mode 100644 index 0000000000..004cf8762b --- /dev/null +++ b/precompiles/src/solidity/balance.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +address constant IBALANCE_ADDRESS = 0x000000000000000000000000000000000000080E; + +interface IBalance { + /// @dev Returns the native free TAO balance for an ss58 account public key. + /// @param coldkey The coldkey public key (32 bytes). + /// @return The free balance in rao (1 TAO = 1e9 rao). + function getFreeBalance(bytes32 coldkey) external view returns (uint256); +} diff --git a/scripts/install_build_env.sh b/scripts/install_build_env.sh index b43b73a699..494981b72a 100644 --- a/scripts/install_build_env.sh +++ b/scripts/install_build_env.sh @@ -50,10 +50,19 @@ if [ "$OS" = "Linux" ]; then if [ -z "$SUDO" ] && [ "$(id -u)" -ne 0 ]; then echo "[!] Warning: No sudo and not root. Skipping apt install." else - $SUDO sed -i 's|http://archive.ubuntu.com/ubuntu|http://mirrors.edge.kernel.org/ubuntu|g' /etc/apt/sources.list || true - $SUDO apt-get update - $SUDO apt-get install -y ca-certificates - $SUDO apt-get install -y --no-install-recommends \ + # The canonical ports endpoint is intermittently unreachable from + # GitHub's ARM runners. KAIST is a registered Ubuntu Ports mirror + # serving the same signed archive. Start over HTTP so a minimal + # Ubuntu image can install CA roots, then upgrade it to HTTPS below. + $SUDO sed -i 's|http://ports.ubuntu.com/ubuntu-ports|http://ftp.kaist.ac.kr/ubuntu-ports|g' \ + /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources || true + $SUDO apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update + $SUDO apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true install -y ca-certificates + $SUDO sed -i 's|http://archive.ubuntu.com/ubuntu|https://mirrors.edge.kernel.org/ubuntu|g' /etc/apt/sources.list || true + $SUDO sed -i 's|http://ftp.kaist.ac.kr/ubuntu-ports|https://ftp.kaist.ac.kr/ubuntu-ports|g' \ + /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources || true + $SUDO apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update + $SUDO apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true install -y --no-install-recommends \ curl build-essential protobuf-compiler clang git pkg-config libssl-dev llvm libudev-dev \ python3 python3-dev \ gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu @@ -100,4 +109,4 @@ rustup target add wasm32v1-none rustup target add aarch64-unknown-linux-gnu rustup target add x86_64-unknown-linux-gnu -echo "[✓] Environment setup complete." \ No newline at end of file +echo "[✓] Environment setup complete." diff --git a/scripts/install_prebuilt_binaries.sh b/scripts/install_prebuilt_binaries.sh index e5b11ebf6d..43ed088ab0 100755 --- a/scripts/install_prebuilt_binaries.sh +++ b/scripts/install_prebuilt_binaries.sh @@ -47,8 +47,12 @@ for RUNTIME in fast-runtime non-fast-runtime; do # echo "::endgroup::" mkdir -p /build/target/${RUNTIME}/release/wbuild/node-subtensor-runtime - cp -v /build/build/ci_target/${RUNTIME}/${BUILD_TRIPLE}/release/node-subtensor \ - /build/target/${RUNTIME}/release/node-subtensor - cp -v /build/build/ci_target/${RUNTIME}/${BUILD_TRIPLE}/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm \ - /build/target/${RUNTIME}/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm -done \ No newline at end of file + # GitHub artifact downloads do not preserve executable mode bits. Install + # with explicit modes so packaging is independent of artifact transport. + install -v -m 0755 \ + /build/build/ci_target/${RUNTIME}/${BUILD_TRIPLE}/release/node-subtensor \ + /build/target/${RUNTIME}/release/node-subtensor + install -v -m 0644 \ + /build/build/ci_target/${RUNTIME}/${BUILD_TRIPLE}/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm \ + /build/target/${RUNTIME}/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm +done diff --git a/scripts/localnet.sh b/scripts/localnet.sh index 45fce1b542..ab34221d8e 100755 --- a/scripts/localnet.sh +++ b/scripts/localnet.sh @@ -60,9 +60,70 @@ fi SPEC_PATH="${SCRIPT_DIR}/specs/" FULL_PATH="$SPEC_PATH$CHAIN.json" +PID_FILE="${LOCALNET_PID_FILE:-/tmp/subtensor-localnet.pids}" -# Kill any existing nodes which may have not exited correctly after a previous run. -pkill -9 'node-subtensor' || true +terminate_pids() { + local pids=("$@") + local any_running pid + + [ "${#pids[@]}" -gt 0 ] || return 0 + + for pid in "${pids[@]}"; do + kill -TERM "$pid" 2>/dev/null || true + done + + # Give node databases time to close cleanly before forcing termination. + for _ in {1..30}; do + any_running=0 + for pid in "${pids[@]}"; do + if kill -0 "$pid" 2>/dev/null; then + any_running=1 + break + fi + done + [ "$any_running" -eq 1 ] || break + sleep 1 + done + + for pid in "${pids[@]}"; do + kill -KILL "$pid" 2>/dev/null || true + # Only children of this shell can be reaped; stale recorded PIDs simply + # make wait return non-zero, which is intentionally ignored. + wait "$pid" 2>/dev/null || true + done +} + +stop_recorded_nodes() { + [ -f "$PID_FILE" ] || return 0 + + local recorded_pids=() + while IFS= read -r pid; do + case "$pid" in + ''|*[!0-9]*) continue ;; + esac + + # PID files can survive a container restart through a /tmp volume. Only + # signal a reused PID when it is still one of our node processes. + if kill -0 "$pid" 2>/dev/null \ + && ps -p "$pid" -o comm= 2>/dev/null | grep -q 'node-subtensor'; then + recorded_pids+=("$pid") + fi + done <"$PID_FILE" + + if [ "${#recorded_pids[@]}" -eq 0 ]; then + rm -f "$PID_FILE" + return 0 + fi + + # Never purge a database while a node from the previous run still has it + # open. Terminate only the validated PIDs before touching chain state. + terminate_pids "${recorded_pids[@]}" + rm -f "$PID_FILE" +} + +if [ "$BUILD_ONLY" -eq 0 ]; then + stop_recorded_nodes +fi if [ ! -d "$SPEC_PATH" ]; then echo "*** Creating directory ${SPEC_PATH}..." @@ -74,6 +135,7 @@ if [[ "$BUILD_BINARY" == "1" ]]; then BUILD_CMD=( cargo build + --locked --workspace --profile=release --features "$FEATURES" @@ -113,6 +175,45 @@ fi if [ $BUILD_ONLY -eq 0 ]; then echo "*** Starting localnet nodes..." + NODE_PIDS=() + SHUTDOWN_STARTED=0 + + shutdown_nodes() { + [ "$SHUTDOWN_STARTED" -eq 0 ] || return 0 + SHUTDOWN_STARTED=1 + trap - EXIT INT TERM + + terminate_pids "${NODE_PIDS[@]}" + rm -f "$PID_FILE" + } + + # Called indirectly by the signal trap below. + # shellcheck disable=SC2329 + handle_signal() { + shutdown_nodes + exit 143 + } + + wait_for_node_exit() { + local active_pids pid + + # Bash 3.2 (the system Bash on macOS) has no `wait -n`. The job table is + # portable across every supported Bash version and lets us identify and + # reap whichever authority exits first. + while true; do + # `jobs -p` retains completed jobs in some non-interactive shells. Union + # running and stopped jobs instead, so only truly exited children vanish. + active_pids="$(jobs -pr; jobs -ps)" + for pid in "${NODE_PIDS[@]}"; do + if ! grep -qx "$pid" <<<"$active_pids"; then + wait "$pid" + return $? + fi + done + sleep 1 + done + } + one_start=( "$NODE_BINARY" --base-path /tmp/one @@ -176,12 +277,25 @@ if [ $BUILD_ONLY -eq 0 ]; then three_start+=(--unsafe-rpc-external) fi - trap 'pkill -P $$' EXIT SIGINT SIGTERM + trap shutdown_nodes EXIT + trap handle_signal INT TERM - ( - ("${one_start[@]}" 2>&1) & - ("${two_start[@]}" 2>&1) & - ("${three_start[@]}" 2>&1) - wait - ) + "${one_start[@]}" 2>&1 & + NODE_PIDS+=("$!") + "${two_start[@]}" 2>&1 & + NODE_PIDS+=("$!") + "${three_start[@]}" 2>&1 & + NODE_PIDS+=("$!") + printf '%s\n' "${NODE_PIDS[@]}" >"$PID_FILE" + + set +e + wait_for_node_exit + node_status=$? + set -e + + # A node exiting by itself, even with status zero, leaves a broken partial + # network. Stop its peers and make that visible to Docker/CI. + [ "$node_status" -ne 0 ] || node_status=1 + shutdown_nodes + exit "$node_status" fi diff --git a/scripts/localnet_healthcheck.sh b/scripts/localnet_healthcheck.sh new file mode 100755 index 0000000000..fb71ff915f --- /dev/null +++ b/scripts/localnet_healthcheck.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -eu + +rpc_port="${1:-9944}" +response=$( + curl --fail --silent --show-error --max-time 2 \ + -H 'content-type: application/json' \ + --data '{"id":1,"jsonrpc":"2.0","method":"chain_getHeader","params":[]}' \ + "http://127.0.0.1:${rpc_port}" +) + +# A listening RPC endpoint is not enough for CI: require at least one authored +# block so callers do not race the chain during startup. +printf '%s\n' "$response" \ + | grep -Eq '"number":"0x[0-9a-fA-F]*[1-9a-fA-F][0-9a-fA-F]*"' diff --git a/sdk/bittensor-core/tests/Dockerfile.localnet-fast b/sdk/bittensor-core/tests/Dockerfile.localnet-fast index 135f4789e5..fd00b33898 100644 --- a/sdk/bittensor-core/tests/Dockerfile.localnet-fast +++ b/sdk/bittensor-core/tests/Dockerfile.localnet-fast @@ -1,9 +1,20 @@ -ARG BASE_IMAGE=ubuntu:latest +# Keep the E2E transport image aligned with Dockerfile-localnet so tests and +# published images exercise the same userspace. +ARG BASE_IMAGE=ubuntu:24.04@sha256:4fbb8e6a8395de5a7550b33509421a2bafbc0aab6c06ba2cef9ebffbc7092d90 FROM $BASE_IMAGE ARG BUILD_TRIPLE=x86_64-unknown-linux-gnu +LABEL org.opencontainers.image.authors="operations@bittensor.com" \ + org.opencontainers.image.vendor="Rao Foundation" \ + org.opencontainers.image.title="Subtensor Localnet CI" \ + org.opencontainers.image.description="PR-specific Subtensor localnet image for repository E2E tests" \ + org.opencontainers.image.source="https://github.com/RaoFoundation/subtensor" \ + org.opencontainers.image.url="https://github.com/RaoFoundation/subtensor" \ + org.opencontainers.image.documentation="https://github.com/RaoFoundation/subtensor/blob/main/docs/guides/local-development.mdx" \ + org.opencontainers.image.licenses="Apache-2.0" + ENV RUST_BACKTRACE=1 RUN apt-get update \ diff --git a/sdk/python/bittensor/evm/abi/balance.json b/sdk/python/bittensor/evm/abi/balance.json new file mode 100644 index 0000000000..6f6e51c1af --- /dev/null +++ b/sdk/python/bittensor/evm/abi/balance.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "coldkey", + "type": "bytes32" + } + ], + "name": "getFreeBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/sdk/python/bittensor/evm/precompiles.py b/sdk/python/bittensor/evm/precompiles.py index f41c09e7fb..5d627cfd79 100644 --- a/sdk/python/bittensor/evm/precompiles.py +++ b/sdk/python/bittensor/evm/precompiles.py @@ -141,6 +141,12 @@ def _load_abi(filename: str) -> list[dict]: "votingPower.json", "Validator voting power (stake EMA) per subnet: per-hotkey, totals, tracking state.", ), + Precompile( + "balance", + 2062, + "balance.json", + "Read native free TAO balance for any ss58 coldkey (getFreeBalance(bytes32) -> rao).", + ), Precompile( "ed25519-verify", 1026, diff --git a/vendor/frontier/client/rpc/src/eth/pending.rs b/vendor/frontier/client/rpc/src/eth/pending.rs index 9384b094d7..d30f138a24 100644 --- a/vendor/frontier/client/rpc/src/eth/pending.rs +++ b/vendor/frontier/client/rpc/src/eth/pending.rs @@ -61,7 +61,7 @@ where P: TransactionPool + 'static, { /// Creates a pending runtime API. - pub(crate) async fn pending_runtime_api(&self) -> Result<(B::Hash, ApiRef), Error> { + pub(crate) async fn pending_runtime_api(&self) -> Result<(B::Hash, ApiRef<'_, C::Api>), Error> { let api = self.client.runtime_api(); let info = self.client.info(); diff --git a/vendor/frontier/precompiles/src/evm/handle.rs b/vendor/frontier/precompiles/src/evm/handle.rs index 2d37d37dff..e1e54b7f0c 100644 --- a/vendor/frontier/precompiles/src/evm/handle.rs +++ b/vendor/frontier/precompiles/src/evm/handle.rs @@ -49,7 +49,7 @@ pub trait PrecompileHandleExt: PrecompileHandle { fn read_u32_selector(&self) -> MayRevert; /// Returns a reader of the input, skipping the selector. - fn read_after_selector(&self) -> MayRevert; + fn read_after_selector(&self) -> MayRevert>; } impl PrecompileHandleExt for T { @@ -96,7 +96,7 @@ impl PrecompileHandleExt for T { } /// Returns a reader of the input, skipping the selector. - fn read_after_selector(&self) -> MayRevert { + fn read_after_selector(&self) -> MayRevert> { Reader::new_skip_selector(self.input()) } } diff --git a/vendor/frontier/precompiles/src/testing/execution.rs b/vendor/frontier/precompiles/src/testing/execution.rs index e8279ee7dd..341d3a71ed 100644 --- a/vendor/frontier/precompiles/src/testing/execution.rs +++ b/vendor/frontier/precompiles/src/testing/execution.rs @@ -239,7 +239,7 @@ pub trait PrecompileTesterExt: PrecompileSet + Sized { from: impl Into, to: impl Into, data: impl Into>, - ) -> PrecompilesTester; + ) -> PrecompilesTester<'_, Self>; } impl PrecompileTesterExt for T { @@ -248,7 +248,7 @@ impl PrecompileTesterExt for T { from: impl Into, to: impl Into, data: impl Into>, - ) -> PrecompilesTester { + ) -> PrecompilesTester<'_, Self> { PrecompilesTester::new(self, from, to, data.into()) } } diff --git a/vendor/w3f-bls/src/double_pop.rs b/vendor/w3f-bls/src/double_pop.rs index 5a8c7b0712..8234802c55 100644 --- a/vendor/w3f-bls/src/double_pop.rs +++ b/vendor/w3f-bls/src/double_pop.rs @@ -17,7 +17,6 @@ use ark_ec::Group; use ark_ff::field_hashers::{DefaultFieldHasher, HashToField}; const PROOF_OF_POSSESSION_CONTEXT: &'static [u8] = b"POP_"; -const BLS_CONTEXT: &'static [u8] = b"BLS_"; /// Proof Of Possession of the secret key as the secret scaler genarting both public /// keys in G1 and G2 by generating a BLS Signature of public key (in G2) diff --git a/vendor/w3f-bls/src/verifiers.rs b/vendor/w3f-bls/src/verifiers.rs index 6c0a15cf2f..f9b27797a2 100644 --- a/vendor/w3f-bls/src/verifiers.rs +++ b/vendor/w3f-bls/src/verifiers.rs @@ -268,7 +268,7 @@ pub fn verify_using_aggregated_auxiliary_public_keys< //Simplify from here on. for (m, pk) in itr { - publickeys.push(pk.borrow().0.clone()); + publickeys.push(pk.0); messages.push( m.hash_to_signature_curve::() + E::SignatureGroupAffine::generator() * pseudo_random_scalar, diff --git a/website/package.json b/website/package.json index cf917fb612..6e60aae0a3 100644 --- a/website/package.json +++ b/website/package.json @@ -37,6 +37,12 @@ "@types/mime": "3.0.2", "@types/react": "^18.2.64", "@types/react-dom": "~18.0.10", + "@babel/runtime@npm:^7.3.1": "npm:7.26.10", + "@babel/runtime@npm:^7.8.4": "npm:7.26.10", + "js-yaml@npm:^4.1.0": "npm:4.2.0", + "postcss@npm:8.4.31": "npm:8.5.10", + "prismjs@npm:^1.27.0": "npm:1.30.0", + "prismjs@npm:~1.27.0": "npm:1.30.0", "send": "0.19.0", "semver": "7.5.3", "undici": "5.28.4", diff --git a/website/yarn.lock b/website/yarn.lock index 4cab91a19c..ac18a85e12 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1307,12 +1307,12 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.8.4": - version: 7.26.9 - resolution: "@babel/runtime@npm:7.26.9" +"@babel/runtime@npm:7.26.10": + version: 7.26.10 + resolution: "@babel/runtime@npm:7.26.10" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 10c0/e8517131110a6ec3a7360881438b85060e49824e007f4a64b5dfa9192cf2bb5c01e84bfc109f02d822c7edb0db926928dd6b991e3ee460b483fb0fac43152d9b + checksum: 10c0/6dc6d88c7908f505c4f7770fb4677dfa61f68f659b943c2be1f2a99cb6680343462867abf2d49822adc435932919b36c77ac60125793e719ea8745f2073d3745 languageName: node linkType: hard @@ -3277,13 +3277,6 @@ __metadata: languageName: node linkType: hard -"@trysound/sax@npm:0.2.0": - version: 0.2.0 - resolution: "@trysound/sax@npm:0.2.0" - checksum: 10c0/44907308549ce775a41c38a815f747009ac45929a45d642b836aa6b0a536e4978d30b8d7d680bbd116e9dd73b7dbe2ef0d1369dcfc2d09e83ba381e485ecbe12 - languageName: node - linkType: hard - "@turbo/darwin-64@npm:2.10.4": version: 2.10.4 resolution: "@turbo/darwin-64@npm:2.10.4" @@ -7254,26 +7247,26 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^3.13.1": - version: 3.15.0 - resolution: "js-yaml@npm:3.15.0" +"js-yaml@npm:4.2.0": + version: 4.2.0 + resolution: "js-yaml@npm:4.2.0" dependencies: - argparse: "npm:^1.0.7" - esprima: "npm:^4.0.0" + argparse: "npm:^2.0.1" bin: js-yaml: bin/js-yaml.js - checksum: 10c0/ca966bd354ac5b1b7a4694ebdba46526796aa3a6a99529fa540af2abf85918bd155a50ccc0166b413130a00622999973754458ec01e7095bc902177bfdbd5b64 + checksum: 10c0/1916456c118746603b067d74bbcbb0445d9a1d5e474ad4ae775e7b20525bed902e01d9d97dd0c81fcd8d4f596162309d0eb057f4aa38f3e9647f14075e9dea45 languageName: node linkType: hard -"js-yaml@npm:^4.1.0": - version: 4.1.0 - resolution: "js-yaml@npm:4.1.0" +"js-yaml@npm:^3.13.1": + version: 3.15.0 + resolution: "js-yaml@npm:3.15.0" dependencies: - argparse: "npm:^2.0.1" + argparse: "npm:^1.0.7" + esprima: "npm:^4.0.0" bin: js-yaml: bin/js-yaml.js - checksum: 10c0/184a24b4eaacfce40ad9074c64fd42ac83cf74d8c8cd137718d456ced75051229e5061b8633c3366b8aada17945a7a356b337828c19da92b51ae62126575018f + checksum: 10c0/ca966bd354ac5b1b7a4694ebdba46526796aa3a6a99529fa540af2abf85918bd155a50ccc0166b413130a00622999973754458ec01e7095bc902177bfdbd5b64 languageName: node linkType: hard @@ -8988,11 +8981,11 @@ __metadata: linkType: hard "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": - version: 3.1.2 - resolution: "minimatch@npm:3.1.2" + version: 3.1.5 + resolution: "minimatch@npm:3.1.5" dependencies: brace-expansion: "npm:^1.1.7" - checksum: 10c0/0262810a8fc2e72cca45d6fd86bd349eee435eb95ac6aa45c9ea2180e7ee875ef44c32b55b5973ceabe95ea12682f6e3725cbb63d7a2d1da3ae1163c8b210311 + checksum: 10c0/2ecbdc0d33f07bddb0315a8b5afbcb761307a8778b48f0b312418ccbced99f104a2d17d8aca7573433c70e8ccd1c56823a441897a45e384ea76ef401a26ace70 languageName: node linkType: hard @@ -9112,12 +9105,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.6": - version: 3.3.8 - resolution: "nanoid@npm:3.3.8" +"nanoid@npm:^3.3.11": + version: 3.3.16 + resolution: "nanoid@npm:3.3.16" bin: nanoid: bin/nanoid.cjs - checksum: 10c0/4b1bb29f6cfebf3be3bc4ad1f1296fb0a10a3043a79f34fbffe75d1621b4318319211cd420549459018ea3592f0d2f159247a6f874911d6d26eaaadda2478120 + checksum: 10c0/bbf2dcffe22d2b62d16de2711752070b539c0f644c7916f823ad6521986b2078cbe524f2d6240f58c46e9141ea0c7b87a029e100c0f7f175228cacaf30e41bba languageName: node linkType: hard @@ -10364,14 +10357,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:8.4.31": - version: 8.4.31 - resolution: "postcss@npm:8.4.31" +"postcss@npm:8.5.10": + version: 8.5.10 + resolution: "postcss@npm:8.5.10" dependencies: - nanoid: "npm:^3.3.6" - picocolors: "npm:^1.0.0" - source-map-js: "npm:^1.0.2" - checksum: 10c0/748b82e6e5fc34034dcf2ae88ea3d11fd09f69b6c50ecdd3b4a875cfc7cdca435c958b211e2cb52355422ab6fccb7d8f2f2923161d7a1b281029e4a913d59acf + nanoid: "npm:^3.3.11" + picocolors: "npm:^1.1.1" + source-map-js: "npm:^1.2.1" + checksum: 10c0/c592dffa0c4873b401f01955b265538d9942f425040df5e2b8f0ad34c83773a792ea0fa5859ccc99cfb5b955b4ebff118ab7056315388dc83b107b0fa8313576 languageName: node linkType: hard @@ -10391,17 +10384,10 @@ __metadata: languageName: node linkType: hard -"prismjs@npm:^1.27.0": - version: 1.29.0 - resolution: "prismjs@npm:1.29.0" - checksum: 10c0/d906c4c4d01b446db549b4f57f72d5d7e6ccaca04ecc670fb85cea4d4b1acc1283e945a9cbc3d81819084a699b382f970e02f9d1378e14af9808d366d9ed7ec6 - languageName: node - linkType: hard - -"prismjs@npm:~1.27.0": - version: 1.27.0 - resolution: "prismjs@npm:1.27.0" - checksum: 10c0/841cbf53e837a42df9155c5ce1be52c4a0a8967ac916b52a27d066181a3578186c634e52d06d0547fb62b65c486b99b95f826dd54966619f9721b884f486b498 +"prismjs@npm:1.30.0": + version: 1.30.0 + resolution: "prismjs@npm:1.30.0" + checksum: 10c0/f56205bfd58ef71ccfcbcb691fd0eb84adc96c6ff21b0b69fc6fdcf02be42d6ef972ba4aed60466310de3d67733f6a746f89f2fb79c00bf217406d465b3e8f23 languageName: node linkType: hard @@ -11178,6 +11164,13 @@ __metadata: languageName: node linkType: hard +"sax@npm:^1.5.0": + version: 1.6.0 + resolution: "sax@npm:1.6.0" + checksum: 10c0/e5593f4a91eb25761a688c4d96902e4e95a0dd6017bc65146b6f21236e3d715cf893333b76bc758923c9574c2fb5a7a76c3a81e96ea15432f2624f906c027c1e + languageName: node + linkType: hard + "scheduler@npm:^0.27.0": version: 0.27.0 resolution: "scheduler@npm:0.27.0" @@ -11476,7 +11469,7 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.1, source-map-js@npm:^1.0.2, source-map-js@npm:^1.2.1": +"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.1": version: 1.2.1 resolution: "source-map-js@npm:1.2.1" checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf @@ -11768,19 +11761,19 @@ __metadata: linkType: hard "svgo@npm:^3.0.2, svgo@npm:^3.2.0": - version: 3.3.2 - resolution: "svgo@npm:3.3.2" + version: 3.3.4 + resolution: "svgo@npm:3.3.4" dependencies: - "@trysound/sax": "npm:0.2.0" commander: "npm:^7.2.0" css-select: "npm:^5.1.0" css-tree: "npm:^2.3.1" css-what: "npm:^6.1.0" csso: "npm:^5.0.5" picocolors: "npm:^1.0.0" + sax: "npm:^1.5.0" bin: svgo: ./bin/svgo - checksum: 10c0/a6badbd3d1d6dbb177f872787699ab34320b990d12e20798ecae915f0008796a0f3c69164f1485c9def399e0ce0a5683eb4a8045e51a5e1c364bb13a0d9f79e1 + checksum: 10c0/4aeb29f2dc1923e4332ad3b702aca901c0a55692b9e3884fc932ca1d76b7db0dc8ce4b2f493bbf79b16a961c288fa720628fc78bb91915645967dcaa8f92d499 languageName: node linkType: hard