Skip to content

Commit 8624c93

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/add-adjust-senate-call
2 parents a570df6 + e8eae82 commit 8624c93

File tree

17 files changed

+298
-84
lines changed

17 files changed

+298
-84
lines changed

.github/workflows/check-rust.yml

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
strategy:
7272
matrix:
7373
rust-branch:
74-
- nightly-2024-03-05
74+
- stable
7575
rust-target:
7676
- x86_64-unknown-linux-gnu
7777
# - x86_64-apple-darwin
@@ -119,55 +119,7 @@ jobs:
119119
strategy:
120120
matrix:
121121
rust-branch:
122-
- nightly-2024-03-05
123-
rust-target:
124-
- x86_64-unknown-linux-gnu
125-
# - x86_64-apple-darwin
126-
os:
127-
- ubuntu-latest
128-
# - macos-latest
129-
include:
130-
- os: ubuntu-latest
131-
# - os: macos-latest
132-
env:
133-
RELEASE_NAME: development
134-
# RUSTFLAGS: -A warnings
135-
RUSTV: ${{ matrix.rust-branch }}
136-
RUST_BACKTRACE: full
137-
RUST_BIN_DIR: target/${{ matrix.rust-target }}
138-
SKIP_WASM_BUILD: 1
139-
TARGET: ${{ matrix.rust-target }}
140-
steps:
141-
- name: Check-out repository under $GITHUB_WORKSPACE
142-
uses: actions/checkout@v2
143-
144-
- name: Install dependencies
145-
run: |
146-
sudo apt-get update &&
147-
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
148-
149-
- name: Install Rust ${{ matrix.rust-branch }}
150-
uses: actions-rs/[email protected]
151-
with:
152-
toolchain: ${{ matrix.rust-branch }}
153-
components: rustfmt, clippy
154-
profile: minimal
155-
156-
- name: Utilize Shared Rust Cache
157-
uses: Swatinem/[email protected]
158-
with:
159-
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
160-
161-
- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
162-
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
163-
164-
cargo-clippy-all-features:
165-
name: cargo clippy --all-features
166-
runs-on: SubtensorCI
167-
strategy:
168-
matrix:
169-
rust-branch:
170-
- nightly-2024-03-05
122+
- stable
171123
rust-target:
172124
- x86_64-unknown-linux-gnu
173125
# - x86_64-apple-darwin
@@ -208,15 +160,14 @@ jobs:
208160

209161
- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
210162
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
211-
212163
# runs cargo test --workspace
213164
cargo-test:
214165
name: cargo test
215166
runs-on: SubtensorCI
216167
strategy:
217168
matrix:
218169
rust-branch:
219-
- nightly-2024-03-05
170+
- stable
220171
rust-target:
221172
- x86_64-unknown-linux-gnu
222173
# - x86_64-apple-darwin
@@ -265,7 +216,7 @@ jobs:
265216
strategy:
266217
matrix:
267218
rust-branch:
268-
- nightly-2024-03-05
219+
- stable
269220
rust-target:
270221
- x86_64-unknown-linux-gnu
271222
# - x86_64-apple-darwin
@@ -314,7 +265,7 @@ jobs:
314265
strategy:
315266
matrix:
316267
rust-branch:
317-
- nightly-2024-03-05
268+
- stable
318269
rust-target:
319270
- x86_64-unknown-linux-gnu
320271
# - x86_64-apple-darwin

.github/workflows/devnet-labels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Tested on Devnet
22
on:
33
pull_request:
44
types: [opened, labeled, unlabeled, synchronize]
5+
branches: [main]
56
jobs:
67
check-labels:
78
runs-on: ubuntu-latest

.github/workflows/testnet-labels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Tested on Testnet
22
on:
33
pull_request:
44
types: [opened, labeled, unlabeled, synchronize]
5+
branches: [main]
56
jobs:
67
check-labels:
78
runs-on: ubuntu-latest

node/src/rpc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub struct FullDeps<C, P, B> {
4242
/// Grandpa block import setup.
4343
pub grandpa: GrandpaDeps<B>,
4444
/// Backend used by the node.
45-
pub backend: Arc<B>,
45+
pub _backend: Arc<B>,
4646
}
4747

4848
/// Instantiate all full RPC extensions.
@@ -74,7 +74,7 @@ where
7474
pool,
7575
deny_unsafe,
7676
grandpa,
77-
backend: _,
77+
_backend: _,
7878
} = deps;
7979

8080
// Custom RPC methods for Paratensor

node/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
266266
subscription_executor: subscription_executor.clone(),
267267
finality_provider: finality_proof_provider.clone(),
268268
},
269-
backend: rpc_backend.clone(),
269+
_backend: rpc_backend.clone(),
270270
};
271271
crate::rpc::create_full(deps).map_err(Into::into)
272272
},

pallets/admin-utils/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub use weights::WeightInfo;
77
use sp_runtime::DispatchError;
88
use sp_runtime::{traits::Member, RuntimeAppPublic};
99

10-
#[cfg(feature = "runtime-benchmarks")]
1110
mod benchmarking;
1211

1312
#[deny(missing_docs)]

pallets/commitments/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#![cfg_attr(not(feature = "std"), no_std)]
22

3+
mod benchmarking;
34
#[cfg(test)]
45
mod tests;
56

6-
#[cfg(feature = "runtime-benchmarks")]
7-
mod benchmarking;
8-
97
pub mod types;
108
pub mod weights;
119

@@ -234,7 +232,7 @@ where
234232
pub fn get_priority_vanilla() -> u64 {
235233
// Return high priority so that every extrinsic except set_weights function will
236234
// have a higher priority than the set_weights call
237-
u64::max_value()
235+
u64::MAX
238236
}
239237
}
240238

pallets/registry/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#[cfg(test)]
44
mod tests;
55

6-
#[cfg(feature = "runtime-benchmarks")]
76
mod benchmarking;
87
pub mod types;
98
pub mod weights;

pallets/subtensor/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use sp_std::marker::PhantomData;
2929
// ============================
3030
// ==== Benchmark Imports =====
3131
// ============================
32-
#[cfg(feature = "runtime-benchmarks")]
3332
mod benchmarks;
3433

3534
// =========================
@@ -2072,7 +2071,7 @@ pub mod pallet {
20722071
let current_block_number: u64 = Self::get_current_block_as_u64();
20732072
let default_priority: u64 =
20742073
current_block_number - Self::get_last_update_for_uid(netuid, uid);
2075-
return default_priority + u32::max_value() as u64;
2074+
return default_priority + u32::MAX as u64;
20762075
}
20772076
0
20782077
}
@@ -2150,7 +2149,7 @@ where
21502149
pub fn get_priority_vanilla() -> u64 {
21512150
// Return high priority so that every extrinsic except set_weights function will
21522151
// have a higher priority than the set_weights call
2153-
u64::max_value()
2152+
u64::MAX
21542153
}
21552154

21562155
pub fn get_priority_set_weights(who: &T::AccountId, netuid: u16) -> u64 {
@@ -2228,9 +2227,9 @@ where
22282227
Err(InvalidTransaction::Call.into())
22292228
}
22302229
}
2231-
Some(Call::set_root_weights { netuid, .. }) => {
2232-
if Self::check_weights_min_stake(who) {
2233-
let priority: u64 = Self::get_priority_set_weights(who, *netuid);
2230+
Some(Call::set_root_weights { netuid, hotkey, .. }) => {
2231+
if Self::check_weights_min_stake(hotkey) {
2232+
let priority: u64 = Self::get_priority_set_weights(hotkey, *netuid);
22342233
Ok(ValidTransaction {
22352234
priority,
22362235
longevity: 1,

pallets/subtensor/src/root.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,12 +1112,12 @@ impl<T: Config> Pallet<T> {
11121112
NetworkRegisteredAt::<T>::remove(netuid);
11131113

11141114
// --- 8. Remove incentive mechanism memory.
1115-
let _ = Uids::<T>::clear_prefix(netuid, u32::max_value(), None);
1116-
let _ = Keys::<T>::clear_prefix(netuid, u32::max_value(), None);
1117-
let _ = Bonds::<T>::clear_prefix(netuid, u32::max_value(), None);
1115+
let _ = Uids::<T>::clear_prefix(netuid, u32::MAX, None);
1116+
let _ = Keys::<T>::clear_prefix(netuid, u32::MAX, None);
1117+
let _ = Bonds::<T>::clear_prefix(netuid, u32::MAX, None);
11181118

11191119
// --- 8. Removes the weights for this subnet (do not remove).
1120-
let _ = Weights::<T>::clear_prefix(netuid, u32::max_value(), None);
1120+
let _ = Weights::<T>::clear_prefix(netuid, u32::MAX, None);
11211121

11221122
// --- 9. Iterate over stored weights and fill the matrix.
11231123
for (uid_i, weights_i) in

0 commit comments

Comments
 (0)