Skip to content

Commit

Permalink
Merge pull request #987 from opentensor/devnet-ready
Browse files Browse the repository at this point in the history
devnet deploy 11-15-2024 (evm balance hotfix)
  • Loading branch information
unconst authored Nov 16, 2024
2 parents e28dc9c + 03527fa commit 804c9fe
Show file tree
Hide file tree
Showing 26 changed files with 1,172 additions and 502 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/cargo-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,11 @@ jobs:
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust Stable
uses: actions-rs/[email protected]
with:
toolchain: stable
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/[email protected]
with:
key: ubuntu-latest-${{ env.RUST_BIN_DIR }}

- name: Install cargo-audit
run: cargo install --version 0.20.1 cargo-audit
run: cargo install --version 0.20.1 --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
3 changes: 0 additions & 3 deletions .github/workflows/check-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
sudo apt-get install -y curl clang curl libssl-dev llvm \
libudev-dev protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install substrate-spec-version
run: cargo install substrate-spec-version

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/check-finney.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
sudo apt-get install -y curl clang curl libssl-dev llvm \
libudev-dev protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install substrate-spec-version
run: cargo install substrate-spec-version

Expand Down
53 changes: 4 additions & 49 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ jobs:
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
Expand All @@ -55,10 +53,10 @@ jobs:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential

- name: Install Rust ${{ matrix.rust-branch }}
- name: Install Rust Nightly
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
toolchain: nightly
components: rustfmt
profile: minimal

Expand All @@ -84,11 +82,10 @@ jobs:
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
RUST_BIN_DIR: target/${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4
Expand All @@ -98,13 +95,6 @@ jobs:
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/[email protected]
with:
Expand All @@ -128,12 +118,11 @@ jobs:
# - macos-latest
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUSTFLAGS: -D warnings
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
RUST_BIN_DIR: target/${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4
Expand Down Expand Up @@ -166,8 +155,6 @@ jobs:
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- stable
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
Expand All @@ -180,7 +167,6 @@ jobs:
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
Expand All @@ -194,13 +180,6 @@ jobs:
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/[email protected]
with:
Expand All @@ -215,8 +194,6 @@ jobs:
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- stable
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
Expand All @@ -229,7 +206,6 @@ jobs:
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
Expand All @@ -243,13 +219,6 @@ jobs:
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Rust shared cached
uses: Swatinem/[email protected]
with:
Expand Down Expand Up @@ -278,7 +247,6 @@ jobs:
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
Expand All @@ -292,13 +260,6 @@ jobs:
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Rust shared cached
uses: Swatinem/[email protected]
with:
Expand All @@ -322,12 +283,6 @@ jobs:
runs-on: SubtensorCI

steps:
- name: Install stable Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Install Zepter
run: cargo install --locked -q zepter && zepter --version

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/check-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
sudo apt-get install -y curl clang curl libssl-dev llvm \
libudev-dev protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install substrate-spec-version
run: cargo install substrate-spec-version

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/try-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: SubtensorCI
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run Try Runtime Checks
uses: "paritytech/[email protected]"
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: SubtensorCI
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run Try Runtime Checks
uses: "paritytech/[email protected]"
Expand Down
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ fn main() {
};

track_lint(ForbidAsPrimitiveConversion::lint(&parsed_file));
track_lint(ForbidKeysRemoveCall::lint(&parsed_file));
track_lint(RequireFreezeStruct::lint(&parsed_file));
track_lint(RequireExplicitPalletIndex::lint(&parsed_file));
});
Expand Down
12 changes: 6 additions & 6 deletions node/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! Should only be used for benchmarking as it may break in other contexts.
use crate::service::Client;
use crate::client::FullClient;

use node_subtensor_runtime as runtime;
use node_subtensor_runtime::check_nonce;
Expand All @@ -21,12 +21,12 @@ use std::{sync::Arc, time::Duration};
//
// Note: Should only be used for benchmarking.
pub struct RemarkBuilder {
client: Arc<Client>,
client: Arc<FullClient>,
}

impl RemarkBuilder {
// Creates a new [`Self`] from the given client.
pub fn new(client: Arc<Client>) -> Self {
pub fn new(client: Arc<FullClient>) -> Self {
Self { client }
}
}
Expand Down Expand Up @@ -58,14 +58,14 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
//
// Note: Should only be used for benchmarking.
pub struct TransferKeepAliveBuilder {
client: Arc<Client>,
client: Arc<FullClient>,
dest: AccountId,
value: Balance,
}

impl TransferKeepAliveBuilder {
// Creates a new [`Self`] from the given client.
pub fn new(client: Arc<Client>, dest: AccountId, value: Balance) -> Self {
pub fn new(client: Arc<FullClient>, dest: AccountId, value: Balance) -> Self {
Self {
client,
dest,
Expand Down Expand Up @@ -105,7 +105,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
//
// Note: Should only be used for benchmarking.
pub fn create_benchmark_extrinsic(
client: &Client,
client: &FullClient,
sender: sp_core::sr25519::Pair,
call: runtime::RuntimeCall,
nonce: u32,
Expand Down
16 changes: 10 additions & 6 deletions node/src/chain_spec/localnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use super::*;

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

// Give front-ends necessary data to present to users
Expand Down Expand Up @@ -32,11 +32,15 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
.with_genesis_config_patch(localnet_genesis(
// Initial PoA authorities (Validators)
// aura | grandpa
vec![
// Keys for debug
authority_keys_from_seed("Alice"),
authority_keys_from_seed("Bob"),
],
if single_authority {
// single authority allows you to run the network using a single node
vec![authority_keys_from_seed("Alice")]
} else {
vec![
authority_keys_from_seed("Alice"),
authority_keys_from_seed("Bob"),
]
},
// Pre-funded accounts
true,
))
Expand Down
Loading

0 comments on commit 804c9fe

Please sign in to comment.