Skip to content

Commit 4e2c494

Browse files
authored
Merge pull request #1016 from opentensor/testnet
finney deploy 11-25-2025
2 parents 3fe9797 + f643d8f commit 4e2c494

Some content is hidden

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

69 files changed

+58350
-52273
lines changed

.github/workflows/cargo-audit.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: cargo audit
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
- unlabeled
7+
- synchronize
8+
concurrency:
9+
group: cargo-audit-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
cargo-audit:
14+
name: cargo audit
15+
runs-on: SubtensorCI
16+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
17+
steps:
18+
- name: Check-out repositoroy under $GITHUB_WORKSPACE
19+
uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update &&
24+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
25+
26+
- name: Install cargo-audit
27+
run: cargo install --version 0.20.1 --force cargo-audit
28+
29+
- name: Display cargo-audit --version
30+
run: cargo audit --version
31+
32+
- name: cargo audit
33+
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this

.github/workflows/check-devnet.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
sudo apt-get install -y curl clang curl libssl-dev llvm \
2121
libudev-dev protobuf-compiler
2222
23-
- name: Set up Rust Toolchain
24-
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
25-
2623
- name: Install substrate-spec-version
2724
run: cargo install substrate-spec-version
2825

.github/workflows/check-finney.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
sudo apt-get install -y curl clang curl libssl-dev llvm \
2121
libudev-dev protobuf-compiler
2222
23-
- name: Set up Rust Toolchain
24-
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
25-
2623
- name: Install substrate-spec-version
2724
run: cargo install substrate-spec-version
2825

.github/workflows/check-rust.yml

Lines changed: 4 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ jobs:
4343
env:
4444
RELEASE_NAME: development
4545
# RUSTFLAGS: -A warnings
46-
RUSTV: ${{ matrix.rust-branch }}
4746
RUST_BACKTRACE: full
48-
RUST_BIN_DIR: target/${{ matrix.rust-target }}
4947
SKIP_WASM_BUILD: 1
5048
TARGET: ${{ matrix.rust-target }}
5149
steps:
@@ -55,10 +53,10 @@ jobs:
5553
- name: Install dependencies
5654
run: sudo apt-get update && sudo apt-get install -y build-essential
5755

58-
- name: Install Rust ${{ matrix.rust-branch }}
56+
- name: Install Rust Nightly
5957
uses: actions-rs/[email protected]
6058
with:
61-
toolchain: ${{ matrix.rust-branch }}
59+
toolchain: nightly
6260
components: rustfmt
6361
profile: minimal
6462

@@ -84,11 +82,10 @@ jobs:
8482
env:
8583
RELEASE_NAME: development
8684
# RUSTFLAGS: -A warnings
87-
RUSTV: ${{ matrix.rust-branch }}
8885
RUST_BACKTRACE: full
89-
RUST_BIN_DIR: target/${{ matrix.rust-target }}
9086
SKIP_WASM_BUILD: 1
9187
TARGET: ${{ matrix.rust-target }}
88+
RUST_BIN_DIR: target/${{ matrix.rust-target }}
9289
steps:
9390
- name: Check-out repository under $GITHUB_WORKSPACE
9491
uses: actions/checkout@v4
@@ -98,13 +95,6 @@ jobs:
9895
sudo apt-get update &&
9996
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
10097
101-
- name: Install Rust ${{ matrix.rust-branch }}
102-
uses: actions-rs/[email protected]
103-
with:
104-
toolchain: ${{ matrix.rust-branch }}
105-
components: rustfmt, clippy
106-
profile: minimal
107-
10898
- name: Utilize Shared Rust Cache
10999
uses: Swatinem/[email protected]
110100
with:
@@ -128,12 +118,11 @@ jobs:
128118
# - macos-latest
129119
env:
130120
RELEASE_NAME: development
131-
RUSTV: ${{ matrix.rust-branch }}
132121
RUSTFLAGS: -D warnings
133122
RUST_BACKTRACE: full
134-
RUST_BIN_DIR: target/${{ matrix.rust-target }}
135123
SKIP_WASM_BUILD: 1
136124
TARGET: ${{ matrix.rust-target }}
125+
RUST_BIN_DIR: target/${{ matrix.rust-target }}
137126
steps:
138127
- name: Check-out repository under $GITHUB_WORKSPACE
139128
uses: actions/checkout@v4
@@ -166,8 +155,6 @@ jobs:
166155
runs-on: SubtensorCI
167156
strategy:
168157
matrix:
169-
rust-branch:
170-
- stable
171158
rust-target:
172159
- x86_64-unknown-linux-gnu
173160
# - x86_64-apple-darwin
@@ -180,7 +167,6 @@ jobs:
180167
env:
181168
RELEASE_NAME: development
182169
# RUSTFLAGS: -A warnings
183-
RUSTV: ${{ matrix.rust-branch }}
184170
RUST_BACKTRACE: full
185171
RUST_BIN_DIR: target/${{ matrix.rust-target }}
186172
SKIP_WASM_BUILD: 1
@@ -194,60 +180,20 @@ jobs:
194180
sudo apt-get update &&
195181
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
196182
197-
- name: Install Rust ${{ matrix.rust-branch }}
198-
uses: actions-rs/[email protected]
199-
with:
200-
toolchain: ${{ matrix.rust-branch }}
201-
components: rustfmt, clippy
202-
profile: minimal
203-
204183
- name: Utilize Shared Rust Cache
205184
uses: Swatinem/[email protected]
206185
with:
207186
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
208187

209188
- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
210189
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
211-
# runs cargo audit
212-
cargo-audit:
213-
name: cargo audit
214-
runs-on: SubtensorCI
215-
if: ${{ github.event_name != 'push' && !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
216-
steps:
217-
- name: Check-out repositoroy under $GITHUB_WORKSPACE
218-
uses: actions/checkout@v4
219-
220-
- name: Install dependencies
221-
run: |
222-
sudo apt-get update &&
223-
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
224-
225-
- name: Install Rust Stable
226-
uses: actions-rs/[email protected]
227-
with:
228-
toolchain: stable
229-
components: rustfmt, clippy
230-
profile: minimal
231-
232-
- name: Utilize Shared Rust Cache
233-
uses: Swatinem/[email protected]
234-
with:
235-
key: ubuntu-latest-${{ env.RUST_BIN_DIR }}
236-
237-
- name: Install cargo-audit
238-
run: cargo install cargo-audit
239-
240-
- name: cargo audit
241-
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this
242190

243191
# runs cargo test --workspace
244192
cargo-test:
245193
name: cargo test
246194
runs-on: SubtensorCI
247195
strategy:
248196
matrix:
249-
rust-branch:
250-
- stable
251197
rust-target:
252198
- x86_64-unknown-linux-gnu
253199
# - x86_64-apple-darwin
@@ -260,7 +206,6 @@ jobs:
260206
env:
261207
RELEASE_NAME: development
262208
# RUSTFLAGS: -A warnings
263-
RUSTV: ${{ matrix.rust-branch }}
264209
RUST_BACKTRACE: full
265210
RUST_BIN_DIR: target/${{ matrix.rust-target }}
266211
SKIP_WASM_BUILD: 1
@@ -274,13 +219,6 @@ jobs:
274219
sudo apt-get update &&
275220
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
276221
277-
- name: Install Rust ${{ matrix.rust-branch }}
278-
uses: actions-rs/[email protected]
279-
with:
280-
toolchain: ${{ matrix.rust-branch }}
281-
components: rustfmt, clippy
282-
profile: minimal
283-
284222
- name: Utilize Rust shared cached
285223
uses: Swatinem/[email protected]
286224
with:
@@ -309,7 +247,6 @@ jobs:
309247
env:
310248
RELEASE_NAME: development
311249
# RUSTFLAGS: -A warnings
312-
RUSTV: ${{ matrix.rust-branch }}
313250
RUST_BACKTRACE: full
314251
RUST_BIN_DIR: target/${{ matrix.rust-target }}
315252
SKIP_WASM_BUILD: 1
@@ -323,13 +260,6 @@ jobs:
323260
sudo apt-get update &&
324261
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
325262
326-
- name: Install Rust ${{ matrix.rust-branch }}
327-
uses: actions-rs/[email protected]
328-
with:
329-
toolchain: ${{ matrix.rust-branch }}
330-
components: rustfmt, clippy
331-
profile: minimal
332-
333263
- name: Utilize Rust shared cached
334264
uses: Swatinem/[email protected]
335265
with:
@@ -353,12 +283,6 @@ jobs:
353283
runs-on: SubtensorCI
354284

355285
steps:
356-
- name: Install stable Rust
357-
uses: actions-rs/toolchain@v1
358-
with:
359-
profile: minimal
360-
toolchain: stable
361-
362286
- name: Install Zepter
363287
run: cargo install --locked -q zepter && zepter --version
364288

.github/workflows/check-testnet.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
sudo apt-get install -y curl clang curl libssl-dev llvm \
2121
libudev-dev protobuf-compiler
2222
23-
- name: Set up Rust Toolchain
24-
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
25-
2623
- name: Install substrate-spec-version
2724
run: cargo install substrate-spec-version
2825

.github/workflows/hotfixes.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Handle Hotfix PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
11+
jobs:
12+
handle-hotfix-pr:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check if PR is a hotfix into `main`
16+
if: >
17+
github.event.pull_request.base.ref == 'main' &&
18+
github.event.pull_request.head.ref != 'testnet'
19+
run: |
20+
echo "Hotfix PR detected. Proceeding to label and comment."
21+
22+
- name: Add `hotfix` label
23+
if: >
24+
github.event.pull_request.base.ref == 'main' &&
25+
github.event.pull_request.head.ref != 'testnet'
26+
run: |
27+
curl -X POST \
28+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
29+
-H "Accept: application/vnd.github.v3+json" \
30+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
31+
-d '{"labels":["hotfix"]}'
32+
33+
- name: Add hotfix bot comment
34+
if: >
35+
github.event.pull_request.base.ref == 'main' &&
36+
github.event.pull_request.head.ref != 'testnet'
37+
run: |
38+
COMMENT_BODY=$(cat <<EOF
39+
## 🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨
40+
41+
It looks like you are trying to merge a hotfix PR into `main`. If this isn't what you wanted to do, and you just wanted to make a regular PR, please close this PR, base your changes off the `devnet-ready` branch and open a new PR into `devnet ready`.
42+
43+
If you _are_ trying to merge a hotfix PR, please complete the following essential steps:
44+
1. [ ] go ahead and get this PR into \`main\` merged, so we can get the change in as quickly as possible!
45+
2. [ ] merge \`main\` into \`testnet\`, bumping \`spec_version\`
46+
3. [ ] deploy \`testnet\`
47+
4. [ ] merge \`testnet\` into \`devnet\`, bumping \`spec_version\`
48+
5. [ ] deploy \`devnet\`
49+
6. [ ] merge \`devnet\` into \`devnet-ready\`
50+
51+
52+
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to \`main\`, so it is essential that you do so.
53+
EOF
54+
)
55+
56+
curl -X POST \
57+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
58+
-H "Accept: application/vnd.github.v3+json" \
59+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
60+
-d "$(jq -n --arg body "$COMMENT_BODY" '{body: $body}')"
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/try-runtime.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: SubtensorCI
1515
steps:
1616
- name: Checkout sources
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: Run Try Runtime Checks
2020
uses: "paritytech/[email protected]"
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: SubtensorCI
3030
steps:
3131
- name: Checkout sources
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333

3434
- name: Run Try Runtime Checks
3535
uses: "paritytech/[email protected]"

0 commit comments

Comments
 (0)