Skip to content

Commit c8b5ea0

Browse files
Merge branch 'main' into fix/add-adjust-senate-call
2 parents 8624c93 + 8cb6cb1 commit c8b5ea0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+109058
-258547
lines changed

.github/workflows/check-devnet.yml

+15
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,18 @@ jobs:
3737
echo "network spec_version: $spec_version"
3838
if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi
3939
echo "$local_spec_version > $spec_version ✅"
40+
41+
check-devnet-migrations:
42+
name: check devnet migrations
43+
runs-on: ubuntu-22.04
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v3
47+
48+
- name: Run Try Runtime Checks
49+
uses: "paritytech/try-runtime-gha@v0.1.0"
50+
with:
51+
runtime-package: "node-subtensor-runtime"
52+
node-uri: "wss://dev.chain.opentensor.ai:443"
53+
checks: "pre-and-post"
54+
extra-args: "--disable-spec-version-check --no-weight-warnings"

.github/workflows/check-finney.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Finney Deploy Check
22

33
on:
44
pull_request:
5-
branches: [finney]
5+
branches: [finney, main]
66

77
env:
88
CARGO_TERM_COLOR: always
@@ -37,3 +37,17 @@ jobs:
3737
echo "network spec_version: $spec_version"
3838
if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi
3939
echo "$local_spec_version > $spec_version ✅"
40+
41+
check-finney-migrations:
42+
name: check finney migrations
43+
runs-on: SubtensorCI
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v4
47+
- name: Run Try Runtime Checks
48+
uses: "paritytech/try-runtime-gha@v0.1.0"
49+
with:
50+
runtime-package: "node-subtensor-runtime"
51+
node-uri: "wss://entrypoint-finney.opentensor.ai:443"
52+
checks: "pre-and-post"
53+
extra-args: "--disable-spec-version-check --no-weight-warnings"

.github/workflows/check-rust.yml

-41
Original file line numberDiff line numberDiff line change
@@ -339,47 +339,6 @@ jobs:
339339
- name: Check features
340340
run: zepter run check
341341

342-
check-finney-migrations:
343-
name: check finney migrations
344-
runs-on: SubtensorCI
345-
steps:
346-
- name: Checkout sources
347-
uses: actions/checkout@v4
348342

349-
- name: Run Try Runtime Checks
350-
uses: "paritytech/try-runtime-gha@v0.1.0"
351-
with:
352-
runtime-package: "node-subtensor-runtime"
353-
node-uri: "wss://entrypoint-finney.opentensor.ai:443"
354-
checks: "pre-and-post"
355-
extra-args: "--disable-spec-version-check --no-weight-warnings"
356-
357-
check-devnet-migrations:
358-
name: check devnet migrations
359-
runs-on: ubuntu-22.04
360-
steps:
361-
- name: Checkout sources
362-
uses: actions/checkout@v3
363343

364-
- name: Run Try Runtime Checks
365-
uses: "paritytech/try-runtime-gha@v0.1.0"
366-
with:
367-
runtime-package: "node-subtensor-runtime"
368-
node-uri: "wss://dev.chain.opentensor.ai:443"
369-
checks: "pre-and-post"
370-
extra-args: "--disable-spec-version-check --no-weight-warnings"
371-
372-
check-testnet-migrations:
373-
name: check testnet migrations
374-
runs-on: ubuntu-22.04
375-
steps:
376-
- name: Checkout sources
377-
uses: actions/checkout@v3
378344

379-
- name: Run Try Runtime Checks
380-
uses: "paritytech/try-runtime-gha@v0.1.0"
381-
with:
382-
runtime-package: "node-subtensor-runtime"
383-
node-uri: "wss://test.chain.opentensor.ai:443"
384-
checks: "pre-and-post"
385-
extra-args: "--disable-spec-version-check --no-weight-warnings"

.github/workflows/check-testnet.yml

+15
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,18 @@ jobs:
3737
echo "network spec_version: $spec_version"
3838
if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi
3939
echo "$local_spec_version > $spec_version ✅"
40+
41+
check-testnet-migrations:
42+
name: check testnet migrations
43+
runs-on: ubuntu-22.04
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v3
47+
48+
- name: Run Try Runtime Checks
49+
uses: "paritytech/try-runtime-gha@v0.1.0"
50+
with:
51+
runtime-package: "node-subtensor-runtime"
52+
node-uri: "wss://test.chain.opentensor.ai:443"
53+
checks: "pre-and-post"
54+
extra-args: "--disable-spec-version-check --no-weight-warnings"
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: devnet-companion Label Check
2+
on:
3+
pull_request:
4+
types: [opened, labeled, unlabeled, synchronize]
5+
branches: [devnet-ready]
6+
jobs:
7+
check-labels:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
steps:
13+
- uses: mheap/github-action-required-labels@v5
14+
with:
15+
mode: minimum
16+
count: 1
17+
labels: devnet-companion
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: testnet-companion Label Check
2+
on:
3+
pull_request:
4+
types: [opened, labeled, unlabeled, synchronize]
5+
branches: [testnet-ready]
6+
jobs:
7+
check-labels:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
steps:
13+
- uses: mheap/github-action-required-labels@v5
14+
with:
15+
mode: minimum
16+
count: 1
17+
labels: testnet-companion
+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Update Chainspecs
2+
3+
concurrency:
4+
group: update-chainspec-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [main, testnet, staging, staging-ready]
10+
11+
workflow_dispatch:
12+
inputs:
13+
verbose:
14+
description: "Output more information when triggered manually"
15+
required: false
16+
default: ""
17+
18+
env:
19+
CARGO_TERM_COLOR: always
20+
VERBOSE: ${{ github.events.input.verbose }}
21+
22+
jobs:
23+
update-chainspecs:
24+
runs-on: SubtensorCI
25+
permissions:
26+
contents: write
27+
28+
strategy:
29+
matrix:
30+
rust-branch:
31+
- nightly-2024-03-05
32+
rust-target:
33+
- x86_64-unknown-linux-gnu
34+
os:
35+
- ubuntu-latest
36+
include:
37+
- os: ubuntu-latest
38+
env:
39+
RELEASE_NAME: development
40+
RUSTV: ${{ matrix.rust-branch }}
41+
RUST_BACKTRACE: full
42+
RUST_BIN_DIR: target/${{ matrix.rust-target }}
43+
TARGET: ${{ matrix.rust-target }}
44+
steps:
45+
- name: Check-out repository under $GITHUB_WORKSPACE
46+
uses: actions/checkout@v2
47+
48+
- name: Install dependencies
49+
run: |
50+
sudo apt-get update &&
51+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
52+
53+
- name: Install Rust ${{ matrix.rust-branch }}
54+
uses: actions-rs/toolchain@v1.0.6
55+
with:
56+
toolchain: ${{ matrix.rust-branch }}
57+
components: rustfmt, clippy
58+
profile: minimal
59+
60+
- name: Utilize Shared Rust Cache
61+
uses: Swatinem/rust-cache@v2.2.1
62+
with:
63+
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
64+
65+
- name: Build chainspecs
66+
run: ./scripts/build_all_chainspecs.sh
67+
68+
- uses: stefanzweifel/git-auto-commit-action@v5
69+
name: Commit any updated chainspecs
70+
with:
71+
commit_message: Update chainspecs

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ specs/*.json
4040
.idea
4141

4242
# Runtime upgrade snapshot
43-
bt.snap
43+
bt.snap
44+
45+
# localnet spec
46+
scripts/specs/local.json

CONTRIBUTING.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
add appropriate labels to your PR as shown below. Three positive reviews are required.
1616
4. Once the required passing reviews have been obtained, you are ready to request that your PR
1717
be included in the next `devnet` deploy. To do this, you should open a companion PR merging
18-
your branch into the `devnet-ready` branch. You must include a link to the parent PR in the
19-
description and preface your PR title with "(Devnet Ready)" or the PR will be
20-
closed/ignored.
18+
a copy of your branch into the `devnet-ready` branch. You must include a link to the parent
19+
PR in the description and preface your PR title with "(Devnet Ready)" or the PR will be
20+
closed/ignored. Your companion PR should have the `devnet-companion` label.
2121
5. A core team administrator will review your "(Devnet Ready)" PR, verifying that it logically
2222
matches the changes introduced in the parent PR (there will sometimes be minor differences
2323
due to merge conflicts) and will either request changes or approve the PR and merge it. Once
@@ -86,11 +86,13 @@
8686
| `runtime` | PR contains substantive changes to runtime / pallet code | none |
8787
| `breaking-change` | PR requires synchronized changes with bittensor | Triggers an automatic bot message so the relevant teams are made aware of the change well in advance |
8888
| `migration` | PR contains one or more migrations | none |
89+
| `devnet-companion` | Designates a devnet companion PR | Presence of `devnet-companion` label is checked |
8990
| `devnet-ready` | PR's branch has been merged into the `devnet-ready` branch and will be included in the next `devnet` deploy | none |
9091
| `on-devnet` | PR has been deployed to `devnet` | Removes `devnet-ready` |
9192
| `devnet-pass` | PR has passed manual testing on `devnet` | `devnet-pass` or `devnet-skip` required |
9293
| `devnet-skip` | Allows a critical hotfix PR to skip required testing on `devnet` | `devnet-pass` or `devnet-skip` required |
9394
| `devnet-fail` | PR has failed manual testing on `devnet` and requires modification | none |
95+
| `testnet-companion` | Designates a testnet companion PR | Presence of `testnet-companion` label is checked |
9496
| `on-testnet` | PR has been deployed to `testnet` | none |
9597
| `testnet-pass` | PR has passed manual testing on `testnet` | `testnet-pass` or `testnet-skip` required |
9698
| `testnet-skip` | Allows a critical hotfix PR to skip required manual testing and SOP on `testnet` | `testnet-pass` or `testnet-skip` required |

Cargo.lock

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ members = [
88
resolver = "2"
99

1010
[workspace.lints.clippy]
11+
indexing-slicing = "deny"
12+
arithmetic-side-effects = "deny"
1113
type_complexity = "allow"
14+
unwrap-used = "deny"
1215

1316
[workspace.dependencies]
1417
cargo-husky = { version = "1", default-features = false }

Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ COPY Cargo.lock Cargo.toml /subtensor/
3838

3939
# Specs
4040
COPY ./snapshot.json /subtensor/snapshot.json
41-
COPY ./raw_spec.json /subtensor/raw_spec.json
42-
COPY ./raw_testspec.json /subtensor/raw_testspec.json
41+
COPY ./raw_spec_testfinney.json /subtensor/raw_spec_testfinney.json
42+
COPY ./raw_spec_finney.json /subtensor/raw_spec_finney.json
4343

4444
# Copy our sources
4545
COPY ./node /subtensor/node
@@ -52,13 +52,13 @@ RUN /subtensor/scripts/init.sh
5252

5353
# Cargo build
5454
WORKDIR /subtensor
55-
RUN cargo build --release --features runtime-benchmarks --locked
55+
RUN cargo build --profile production --features runtime-benchmarks --locked
5656
EXPOSE 30333 9933 9944
5757

5858

5959
FROM $BASE_IMAGE AS subtensor
6060

6161
COPY --from=builder /subtensor/snapshot.json /
62-
COPY --from=builder /subtensor/raw_spec.json /
63-
COPY --from=builder /subtensor/raw_testspec.json /
64-
COPY --from=builder /subtensor/target/release/node-subtensor /usr/local/bin
62+
COPY --from=builder /subtensor/raw_spec_testfinney.json /
63+
COPY --from=builder /subtensor/raw_spec_finney.json /
64+
COPY --from=builder /subtensor/target/production/node-subtensor /usr/local/bin

docker-compose.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3.8'
1+
version: "3.8"
22

33
volumes:
44
mainnet-lite-volume:
@@ -38,7 +38,7 @@ services:
3838
- |
3939
node-subtensor \
4040
--base-path /tmp/blockchain \
41-
--chain raw_spec.json \
41+
--chain raw_spec_finney.json \
4242
--rpc-external --rpc-cors all \
4343
--no-mdns \
4444
--in-peers 500 --out-peers 500 \
@@ -56,7 +56,7 @@ services:
5656
- |
5757
node-subtensor \
5858
--base-path /tmp/blockchain \
59-
--chain raw_spec.json \
59+
--chain raw_spec_finney.json \
6060
--rpc-external --rpc-cors all \
6161
--no-mdns \
6262
--in-peers 500 --out-peers 500 \
@@ -74,7 +74,7 @@ services:
7474
- |
7575
node-subtensor \
7676
--base-path /tmp/blockchain \
77-
--chain raw_testspec.json \
77+
--chain raw_spec_testfinney.json \
7878
--rpc-external --rpc-cors all \
7979
--no-mdns \
8080
--in-peers 500 --out-peers 500 \
@@ -94,7 +94,7 @@ services:
9494
- |
9595
node-subtensor \
9696
--base-path /tmp/blockchain \
97-
--chain raw_testspec.json \
97+
--chain raw_spec_testfinney.json \
9898
--rpc-external --rpc-cors all \
9999
--no-mdns \
100100
--in-peers 500 --out-peers 500 \

0 commit comments

Comments
 (0)