Skip to content

Commit 29cd71e

Browse files
committed
Merge branch 'devnet-ready' into feat/evm-devnet-ready
2 parents f58977b + 2ad1381 commit 29cd71e

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

+4127
-1069
lines changed

.github/workflows/cargo-audit.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 Rust Stable
27+
uses: actions-rs/[email protected]
28+
with:
29+
toolchain: stable
30+
components: rustfmt, clippy
31+
profile: minimal
32+
33+
- name: Utilize Shared Rust Cache
34+
uses: Swatinem/[email protected]
35+
with:
36+
key: ubuntu-latest-${{ env.RUST_BIN_DIR }}
37+
38+
- name: Install cargo-audit
39+
run: cargo install cargo-audit
40+
41+
- name: cargo audit
42+
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this

.github/workflows/check-devnet.yml

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

.github/workflows/check-finney.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,3 @@ jobs:
3939
echo "network spec_version: $spec_version"
4040
if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi
4141
echo "$local_spec_version > $spec_version ✅"
42-
43-
check-finney-migrations:
44-
name: check finney migrations
45-
runs-on: SubtensorCI
46-
steps:
47-
- name: Checkout sources
48-
uses: actions/checkout@v4
49-
- name: Run Try Runtime Checks
50-
uses: "paritytech/[email protected]"
51-
with:
52-
runtime-package: "node-subtensor-runtime"
53-
node-uri: "wss://entrypoint-finney.opentensor.ai:443"
54-
checks: "pre-and-post"
55-
extra-args: "--disable-spec-version-check --no-weight-warnings"

.github/workflows/check-rust.yml

Lines changed: 22 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
branches: [main, devnet-ready, devnet, testnet, finney]
1010

1111
pull_request:
12-
types: [labeled, unlabeled, synchronize]
1312

1413
## Allow running workflow manually from the Actions tab
1514
workflow_dispatch:
@@ -114,30 +113,33 @@ jobs:
114113
- name: cargo clippy --workspace --all-targets -- -D warnings
115114
run: cargo clippy --workspace --all-targets -- -D warnings
116115

117-
cargo-check-lints:
118-
name: check custom lints
116+
cargo-clippy-all-features:
117+
name: cargo clippy --all-features
119118
runs-on: SubtensorCI
120119
strategy:
121120
matrix:
122121
rust-branch:
123122
- stable
124123
rust-target:
125124
- x86_64-unknown-linux-gnu
126-
# - x86_64-apple-darwin
125+
# - x86_64-apple-darwin
127126
os:
128127
- ubuntu-latest
129128
# - macos-latest
129+
include:
130+
- os: ubuntu-latest
131+
# - os: macos-latest
130132
env:
131133
RELEASE_NAME: development
134+
# RUSTFLAGS: -A warnings
132135
RUSTV: ${{ matrix.rust-branch }}
133-
RUSTFLAGS: -D warnings
134136
RUST_BACKTRACE: full
135137
RUST_BIN_DIR: target/${{ matrix.rust-target }}
136138
SKIP_WASM_BUILD: 1
137139
TARGET: ${{ matrix.rust-target }}
138140
steps:
139141
- name: Check-out repository under $GITHUB_WORKSPACE
140-
uses: actions/checkout@v4
142+
uses: actions/checkout@v2
141143

142144
- name: Install dependencies
143145
run: |
@@ -156,14 +158,12 @@ jobs:
156158
with:
157159
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
158160

159-
- name: check lints
160-
run: |
161-
set -o pipefail
162-
cargo check 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g" | grep "warning:" && exit 1
163-
echo "No warnings found."
161+
- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
162+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
164163

165-
cargo-clippy-all-features:
166-
name: cargo clippy --all-features
164+
# runs cargo test --workspace
165+
cargo-test:
166+
name: cargo test
167167
runs-on: SubtensorCI
168168
strategy:
169169
matrix:
@@ -188,43 +188,6 @@ jobs:
188188
TARGET: ${{ matrix.rust-target }}
189189
steps:
190190
- name: Check-out repository under $GITHUB_WORKSPACE
191-
uses: actions/checkout@v2
192-
193-
- name: Install dependencies
194-
run: |
195-
sudo apt-get update &&
196-
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
197-
198-
- name: Install Rust ${{ matrix.rust-branch }}
199-
uses: actions-rs/[email protected]
200-
with:
201-
toolchain: ${{ matrix.rust-branch }}
202-
components: rustfmt, clippy
203-
profile: minimal
204-
205-
- name: Utilize Shared Rust Cache
206-
uses: Swatinem/[email protected]
207-
with:
208-
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
209-
210-
- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
211-
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
212-
cargo-audit:
213-
name: cargo audit
214-
runs-on: SubtensorCI
215-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
216-
strategy:
217-
matrix:
218-
rust-branch:
219-
- stable
220-
rust-target:
221-
- x86_64-unknown-linux-gnu
222-
# - x86_64-apple-darwin
223-
os:
224-
- ubuntu-latest
225-
# - macos-latest
226-
steps:
227-
- name: Check-out repositoroy under $GITHUB_WORKSPACE
228191
uses: actions/checkout@v4
229192

230193
- name: Install dependencies
@@ -239,20 +202,17 @@ jobs:
239202
components: rustfmt, clippy
240203
profile: minimal
241204

242-
- name: Utilize Shared Rust Cache
205+
- name: Utilize Rust shared cached
243206
uses: Swatinem/[email protected]
244207
with:
245208
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
246209

247-
- name: Install cargo-audit
248-
run: cargo install cargo-audit
210+
- name: cargo test --workspace
211+
run: cargo test --workspace
249212

250-
- name: cargo audit
251-
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this
252-
253-
# runs cargo test --workspace
254-
cargo-test:
255-
name: cargo test
213+
# runs cargo test --workspace --features=runtime-benchmarks
214+
cargo-test-benchmarks:
215+
name: cargo test w/benchmarks
256216
runs-on: SubtensorCI
257217
strategy:
258218
matrix:
@@ -296,8 +256,8 @@ jobs:
296256
with:
297257
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
298258

299-
- name: cargo test --workspace --all-features
300-
run: cargo test --workspace --all-features
259+
- name: cargo test --workspace --features=runtime-benchmarks
260+
run: cargo test --workspace --features=runtime-benchmarks
301261

302262
# ensures cargo fix has no trivial changes that can be applied
303263
cargo-fix:
@@ -379,3 +339,4 @@ jobs:
379339

380340
- name: Check features
381341
run: zepter run check
342+

.github/workflows/check-testnet.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,3 @@ jobs:
3939
echo "network spec_version: $spec_version"
4040
if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi
4141
echo "$local_spec_version > $spec_version ✅"
42-
43-
check-testnet-migrations:
44-
name: check testnet migrations
45-
runs-on: ubuntu-22.04
46-
steps:
47-
- name: Checkout sources
48-
uses: actions/checkout@v3
49-
50-
- name: Run Try Runtime Checks
51-
uses: "paritytech/[email protected]"
52-
with:
53-
runtime-package: "node-subtensor-runtime"
54-
node-uri: "wss://test.chain.opentensor.ai:443"
55-
checks: "pre-and-post"
56-
extra-args: "--disable-spec-version-check --no-weight-warnings"

.github/workflows/try-runtime.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Try Runtime
2+
3+
on:
4+
pull_request:
5+
branches: [main, devnet-ready, devnet, testnet, finney]
6+
types: [labeled, unlabeled, synchronize]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
check-devnet:
13+
name: check devnet
14+
runs-on: SubtensorCI
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v3
18+
19+
- name: Run Try Runtime Checks
20+
uses: "paritytech/[email protected]"
21+
with:
22+
runtime-package: "node-subtensor-runtime"
23+
node-uri: "wss://dev.chain.opentensor.ai:443"
24+
checks: "all"
25+
extra-args: "--disable-spec-version-check --no-weight-warnings"
26+
27+
check-testnet:
28+
name: check testnet
29+
runs-on: SubtensorCI
30+
steps:
31+
- name: Checkout sources
32+
uses: actions/checkout@v3
33+
34+
- name: Run Try Runtime Checks
35+
uses: "paritytech/[email protected]"
36+
with:
37+
runtime-package: "node-subtensor-runtime"
38+
node-uri: "wss://test.chain.opentensor.ai:443"
39+
checks: "all"
40+
extra-args: "--disable-spec-version-check --no-weight-warnings"
41+
42+
check-finney:
43+
name: check finney
44+
runs-on: SubtensorCI
45+
steps:
46+
- name: Checkout sources
47+
uses: actions/checkout@v4
48+
- name: Run Try Runtime Checks
49+
uses: "paritytech/[email protected]"
50+
with:
51+
runtime-package: "node-subtensor-runtime"
52+
node-uri: "wss://archive.chain.opentensor.ai:443"
53+
checks: "all"
54+
extra-args: "--disable-spec-version-check --no-weight-warnings"

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ fn main() {
5959
}
6060
};
6161

62+
track_lint(ForbidAsPrimitiveConversion::lint(&parsed_file));
6263
track_lint(RequireFreezeStruct::lint(&parsed_file));
6364
track_lint(RequireExplicitPalletIndex::lint(&parsed_file));
6465
});

pallets/admin-utils/src/benchmarking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ mod benchmarks {
228228
}
229229

230230
#[benchmark]
231-
fn sudo_set_commit_reveal_weights_interval() {
231+
fn sudo_set_commit_reveal_weights_periods() {
232232
pallet_subtensor::Pallet::<T>::init_new_network(
233233
1u16, /*netuid*/
234234
1u16, /*sudo_tempo*/
235235
);
236236

237237
#[extrinsic_call]
238-
_(RawOrigin::Root, 1u16/*netuid*/, 3u64/*interval*/)/*set_commit_reveal_weights_interval()*/;
238+
_(RawOrigin::Root, 1u16/*netuid*/, 3u64/*interval*/)/*set_commit_reveal_weights_periods()*/;
239239
}
240240

241241
#[benchmark]

0 commit comments

Comments
 (0)