Skip to content

Commit

Permalink
final deployment of rao to mainnet 2/6/2025 (#1253)
Browse files Browse the repository at this point in the history
* wait rate limit in tests

* use rem root alpha

* fix test involving alpha out emission

* fix alpha out expectation

* Ban to_num, organize safe math into a crate

* Avoid using from_num

* Fix zepter

* Fix zepter

* Invalidate staking and unstaking transactions if liquidity is inadequate

* Fix swap_alpha_for_tao

* Set DefaultMinimumPoolLiquidity

* add new fields to ChainIdentity and SubnetIdentity

* Fix test_do_move_max_values

* Add tests

* Fix unsafe math

* Update pallets/subtensor/src/staking/stake_utils.rs

Co-authored-by: Cameron Fairchild <[email protected]>

* Update pallets/subtensor/src/staking/stake_utils.rs

Co-authored-by: Cameron Fairchild <[email protected]>

* add migration and test

* make min burn only callable by root

* add tests for reg disable -> tao-in == 0

* disable TAO into subnet if reg are disabled

* add stake info by hk, ck, netuid

* Revert "add stake info by hk, ck, netuid"

This reverts commit e0e2b84.

* Add stakeinfo by hk, ck, netuid

* typo

* Replace frontier's RuntimeHelper with manual dispatcher

* add subnet volume to runtimeAPIs

* Move checked_sqrt to save math and add tests

* Change type for pool k to I110F18

* Raise minimum pool liquidity to 1 TAO

* Format

* Implement remove_stake_limit

* Fix clippy

* Fix tests

* Add an option to run try-runtime script with a snapshot

* Update spec version

* Add allow_partial parameter for add_stake_limit and remove_stake_limit

* Bump spec version to 225

* Update pallets/subtensor/src/tests/staking.rs

Co-authored-by: Cameron Fairchild <[email protected]>

* Update pallets/subtensor/src/staking/remove_stake.rs

Co-authored-by: Cameron Fairchild <[email protected]>

* refactor code

* fix cargo audit working in CI 🎉

* bump CI

* upgrade futures-util

* ignore some unmaintained advisories

* add another unmaintained

* cargo update url

* fix more advisories

* fix more advisories

* add len check

* add len check

* Fix rao migration did not update TotalIssuance

* Refactor TryState

* Reformat

* fix wrong origin

* fix clippy

* Implement slippage safe move_stake_limit

* Validate slippage-safe staking extrinsics

* fix some CI actions not triggering on newly opened pull request

* no owner dereg & tests

* update existing tests

* Double-size SubnetVolume to u128

* Add swap_stake_limit

* Add tests, fix corner case bugs

* commit Cargo.lock

* add comments

* fix wrong origin

* fix clippy

* Remove pallet-dynamic-fee and associated inherent data

* Add tests, fix bugs

* Cleanup

* Add subnet volume migration to fix try-runtime

* Revert endpoint change in try-runtime script

* Use resulting average price formula for add-remove limit stake

* commit Cargo.lock

* cargo clippy

* cargo fix

* safe math usage

* upgrade openssl

* address freeze_struct

* rename commit_reveal_period

* apply criticial openssl update to fix RUSTSEC-2025-0004 (openssl)

* remove subnet_info_v3

* address lint

* update register_network with identity precompile

* fix merge commit

* bump spec

* remove SubnetInfov3 struct

* rename emission_values => emission_value

* bump spec

* use saturating math

* add cleaned coinbase

* noclaim

* remove complexity

* non scaled tao emission

* bump

* fix test

* clean coinbase

* pre merge

* no tao in for non registration

* move to moving prices rather than tao reserves

* price

* moving alpha

* bump spec

* Fix tests

* add moving price tests

* add alpha in tests

* Fix all tests

* Format

* Fix unsafe math

* alpha tests

* set tao weight

* reset default staking fee

* fix names

* add mainnet names

* cargo clippy

* cargo fmt

* add a global min burn and migration

* add more tests for root pending etc

* alpha divs

* fix test for root

* new test root tao

* fix wrong parse function

* fix test

* add toggle off for transfers

* delete unused workflow file

* Fix validation for transfer toggle

* remove duplicate tests

* fix subnet creation logic

* cargo fmt

* add new test

* bump spec version to 228

* Add test test_drain_alpha_childkey_parentkey

* spec bump

* commit Cargo.lock

* cargo clippy

* cargo fmt

* fix min lock

* fmt

* fix migration test

* cargo fmt

* fix root

* cargo fmt

* add moving price to metagraph

* use correct min burn init (#1265)

* use correct min brun init

* fmt

* no into

* no into 2

* bump spec

* cargo update to fix cargo audit vulnerabilities

* bump spec version

* moving price init from emission

* cargo fmt

* bump spec version

* commit Cargo.lock

* cargo clippy

* cargo fmt

* DefaultMinimumPoolLiquidity and tempos in rao migration

---------

Co-authored-by: Cameron Fairchild <[email protected]>
Co-authored-by: Greg Zaitsev <[email protected]>
Co-authored-by: JohnReedV <[email protected]>
Co-authored-by: open-junius <[email protected]>
Co-authored-by: gztensor <[email protected]>
Co-authored-by: Aliaksandr Tsurko <[email protected]>
Co-authored-by: Roman <[email protected]>
Co-authored-by: unconst <[email protected]>
Co-authored-by: Unconst <[email protected]>
Co-authored-by: camfairchild <[email protected]>
  • Loading branch information
11 people authored Feb 13, 2025
1 parent 8f39a58 commit e2b8367
Show file tree
Hide file tree
Showing 130 changed files with 20,200 additions and 11,161 deletions.
Empty file.
14 changes: 12 additions & 2 deletions .github/workflows/cargo-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- labeled
- unlabeled
- synchronize
- opened
concurrency:
group: cargo-audit-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -24,10 +25,19 @@ jobs:
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install cargo-audit
run: cargo install --version 0.20.1 --force cargo-audit
run: cargo install --force cargo-audit

- name: Display cargo-audit --version
run: cargo audit --version

- name: cargo audit
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this
run: |
cargo audit --ignore RUSTSEC-2024-0336 \
--ignore RUSTSEC-2021-0127 \
--ignore RUSTSEC-2024-0370 \
--ignore RUSTSEC-2022-0080 \
--ignore RUSTSEC-2022-0061 \
--ignore RUSTSEC-2020-0168 \
--ignore RUSTSEC-2024-0384 \
--ignore RUSTSEC-2024-0388 \
--ignore RUSTSEC-2024-0421
2 changes: 1 addition & 1 deletion .github/workflows/check-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Devnet Deploy Check
on:
pull_request:
branches: [devnet, devnet-ready]
types: [labeled, unlabeled, synchronize]
types: [labeled, unlabeled, synchronize, opened]

env:
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-finney.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Finney Deploy Check
on:
pull_request:
branches: [finney, main]
types: [labeled, unlabeled, synchronize]
types: [labeled, unlabeled, synchronize, opened]

env:
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Testnet Deploy Check
on:
pull_request:
branches: [testnet, testnet-ready]
types: [labeled, unlabeled, synchronize]
types: [labeled, unlabeled, synchronize, opened]

env:
CARGO_TERM_COLOR: always
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ on:
release:
types: [published]
workflow_dispatch:
inputs:
branch-or-tag:
description: "Branch or tag to use for the Docker image tag and ref to checkout (optional)"
required: false
default: ""

push:
branches:
- devnet-ready
- devnet
- testnet

permissions:
contents: read
Expand All @@ -16,8 +27,18 @@ jobs:
runs-on: SubtensorCI

steps:
- name: Determine Docker tag and ref
id: tag
run: |
branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
echo "Determined branch or tag: $branch_or_tag"
echo "tag=$branch_or_tag" >> $GITHUB_ENV
echo "ref=$branch_or_tag" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -32,18 +53,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/${{ github.repository }}:latest
labels: ${{ steps.meta.outputs.labels }}
ghcr.io/${{ github.repository }}:${{ env.tag }}
1 change: 1 addition & 0 deletions .github/workflows/e2e-bittensor-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
python3 -m pip install -e .
python3 -m pip install torch
python3 -m pip install pytest
python3 -m pip install -r requirements/dev.txt
- name: Run tests
working-directory: ${{ github.workspace }}/bittensor
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/label-triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened

permissions:
issues: write
Expand Down
Loading

0 comments on commit e2b8367

Please sign in to comment.