Skip to content

Commit 6fdf21e

Browse files
authored
Merge pull request #989 from opentensor/devnet
testnet deploy 11-18-2024
2 parents feaa764 + 804c9fe commit 6fdf21e

26 files changed

+1172
-502
lines changed

Diff for: .github/workflows/cargo-audit.yml

+4-13
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,11 @@ jobs:
2323
sudo apt-get update &&
2424
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
2525
26-
- name: Install Rust Stable
27-
uses: actions-rs/toolchain@v1.0.6
28-
with:
29-
toolchain: stable
30-
components: rustfmt, clippy
31-
profile: minimal
32-
33-
- name: Utilize Shared Rust Cache
34-
uses: Swatinem/rust-cache@v2.2.1
35-
with:
36-
key: ubuntu-latest-${{ env.RUST_BIN_DIR }}
37-
3826
- name: Install cargo-audit
39-
run: cargo install --version 0.20.1 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
4031

4132
- name: cargo audit
4233
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this

Diff for: .github/workflows/check-devnet.yml

-3
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

Diff for: .github/workflows/check-finney.yml

-3
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

Diff for: .github/workflows/check-rust.yml

+4-49
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/toolchain@v1.0.6
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/toolchain@v1.0.6
103-
with:
104-
toolchain: ${{ matrix.rust-branch }}
105-
components: rustfmt, clippy
106-
profile: minimal
107-
10898
- name: Utilize Shared Rust Cache
10999
uses: Swatinem/rust-cache@v2.2.1
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,13 +180,6 @@ 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/toolchain@v1.0.6
199-
with:
200-
toolchain: ${{ matrix.rust-branch }}
201-
components: rustfmt, clippy
202-
profile: minimal
203-
204183
- name: Utilize Shared Rust Cache
205184
uses: Swatinem/rust-cache@v2.2.1
206185
with:
@@ -215,8 +194,6 @@ jobs:
215194
runs-on: SubtensorCI
216195
strategy:
217196
matrix:
218-
rust-branch:
219-
- stable
220197
rust-target:
221198
- x86_64-unknown-linux-gnu
222199
# - x86_64-apple-darwin
@@ -229,7 +206,6 @@ jobs:
229206
env:
230207
RELEASE_NAME: development
231208
# RUSTFLAGS: -A warnings
232-
RUSTV: ${{ matrix.rust-branch }}
233209
RUST_BACKTRACE: full
234210
RUST_BIN_DIR: target/${{ matrix.rust-target }}
235211
SKIP_WASM_BUILD: 1
@@ -243,13 +219,6 @@ jobs:
243219
sudo apt-get update &&
244220
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
245221
246-
- name: Install Rust ${{ matrix.rust-branch }}
247-
uses: actions-rs/toolchain@v1.0.6
248-
with:
249-
toolchain: ${{ matrix.rust-branch }}
250-
components: rustfmt, clippy
251-
profile: minimal
252-
253222
- name: Utilize Rust shared cached
254223
uses: Swatinem/rust-cache@v2.2.1
255224
with:
@@ -278,7 +247,6 @@ jobs:
278247
env:
279248
RELEASE_NAME: development
280249
# RUSTFLAGS: -A warnings
281-
RUSTV: ${{ matrix.rust-branch }}
282250
RUST_BACKTRACE: full
283251
RUST_BIN_DIR: target/${{ matrix.rust-target }}
284252
SKIP_WASM_BUILD: 1
@@ -292,13 +260,6 @@ jobs:
292260
sudo apt-get update &&
293261
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
294262
295-
- name: Install Rust ${{ matrix.rust-branch }}
296-
uses: actions-rs/toolchain@v1.0.6
297-
with:
298-
toolchain: ${{ matrix.rust-branch }}
299-
components: rustfmt, clippy
300-
profile: minimal
301-
302263
- name: Utilize Rust shared cached
303264
uses: Swatinem/rust-cache@v2.2.1
304265
with:
@@ -322,12 +283,6 @@ jobs:
322283
runs-on: SubtensorCI
323284

324285
steps:
325-
- name: Install stable Rust
326-
uses: actions-rs/toolchain@v1
327-
with:
328-
profile: minimal
329-
toolchain: stable
330-
331286
- name: Install Zepter
332287
run: cargo install --locked -q zepter && zepter --version
333288

Diff for: .github/workflows/check-testnet.yml

-3
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

Diff for: .github/workflows/try-runtime.yml

+2-2
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/try-runtime-gha@v0.1.0"
@@ -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/try-runtime-gha@v0.1.0"

Diff for: build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ fn main() {
6060
};
6161

6262
track_lint(ForbidAsPrimitiveConversion::lint(&parsed_file));
63+
track_lint(ForbidKeysRemoveCall::lint(&parsed_file));
6364
track_lint(RequireFreezeStruct::lint(&parsed_file));
6465
track_lint(RequireExplicitPalletIndex::lint(&parsed_file));
6566
});

Diff for: node/src/benchmarking.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! Should only be used for benchmarking as it may break in other contexts.
44
5-
use crate::service::Client;
5+
use crate::client::FullClient;
66

77
use node_subtensor_runtime as runtime;
88
use node_subtensor_runtime::check_nonce;
@@ -21,12 +21,12 @@ use std::{sync::Arc, time::Duration};
2121
//
2222
// Note: Should only be used for benchmarking.
2323
pub struct RemarkBuilder {
24-
client: Arc<Client>,
24+
client: Arc<FullClient>,
2525
}
2626

2727
impl RemarkBuilder {
2828
// Creates a new [`Self`] from the given client.
29-
pub fn new(client: Arc<Client>) -> Self {
29+
pub fn new(client: Arc<FullClient>) -> Self {
3030
Self { client }
3131
}
3232
}
@@ -58,14 +58,14 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
5858
//
5959
// Note: Should only be used for benchmarking.
6060
pub struct TransferKeepAliveBuilder {
61-
client: Arc<Client>,
61+
client: Arc<FullClient>,
6262
dest: AccountId,
6363
value: Balance,
6464
}
6565

6666
impl TransferKeepAliveBuilder {
6767
// Creates a new [`Self`] from the given client.
68-
pub fn new(client: Arc<Client>, dest: AccountId, value: Balance) -> Self {
68+
pub fn new(client: Arc<FullClient>, dest: AccountId, value: Balance) -> Self {
6969
Self {
7070
client,
7171
dest,
@@ -105,7 +105,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
105105
//
106106
// Note: Should only be used for benchmarking.
107107
pub fn create_benchmark_extrinsic(
108-
client: &Client,
108+
client: &FullClient,
109109
sender: sp_core::sr25519::Pair,
110110
call: runtime::RuntimeCall,
111111
nonce: u32,

Diff for: node/src/chain_spec/localnet.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use super::*;
55

6-
pub fn localnet_config() -> Result<ChainSpec, String> {
6+
pub fn localnet_config(single_authority: bool) -> Result<ChainSpec, String> {
77
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
88

99
// Give front-ends necessary data to present to users
@@ -32,11 +32,15 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
3232
.with_genesis_config_patch(localnet_genesis(
3333
// Initial PoA authorities (Validators)
3434
// aura | grandpa
35-
vec![
36-
// Keys for debug
37-
authority_keys_from_seed("Alice"),
38-
authority_keys_from_seed("Bob"),
39-
],
35+
if single_authority {
36+
// single authority allows you to run the network using a single node
37+
vec![authority_keys_from_seed("Alice")]
38+
} else {
39+
vec![
40+
authority_keys_from_seed("Alice"),
41+
authority_keys_from_seed("Bob"),
42+
]
43+
},
4044
// Pre-funded accounts
4145
true,
4246
))

0 commit comments

Comments
 (0)