Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = "Implementation of the bittensor blockchain"
authors = ["Substrate DevHub <https://github.com/substrate-developer-hub>"]
homepage = "https://substrate.io/"
edition = "2021"
edition = "2024"
license = "Unlicense"
publish = false
repository = "https://github.com/opentensor/subtensor"
Expand Down Expand Up @@ -46,6 +46,7 @@ arithmetic-side-effects = "deny"
type_complexity = "allow"
unwrap-used = "deny"
manual_inspect = "allow"
useless_conversion = "allow" # until polkadot is patched

[workspace.dependencies]
async-trait = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "4.0.0-dev"
description = "A fresh FRAME-based Substrate node, ready for hacking."
authors = ["Substrate DevHub <https://github.com/substrate-developer-hub>"]
homepage = "https://substrate.io/"
edition = "2021"
edition = "2024"
license = "Unlicense"
publish = false
repository = "https://github.com/opentensor/subtensor"
Expand Down
4 changes: 2 additions & 2 deletions node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use sc_service::ChainType;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::crypto::Ss58Codec;
use sp_core::{bounded_vec, sr25519, Pair, Public, H256};
use sp_runtime::traits::{IdentifyAccount, Verify};
use sp_core::{H256, Pair, Public, bounded_vec, sr25519};
use sp_runtime::AccountId32;
use sp_runtime::traits::{IdentifyAccount, Verify};
use std::collections::HashSet;
use std::env;
use std::str::FromStr;
Expand Down
2 changes: 1 addition & 1 deletion node/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use node_subtensor_runtime::{opaque::Block, RuntimeApi};
use node_subtensor_runtime::{RuntimeApi, opaque::Block};
use sc_executor::WasmExecutor;

/// Full backend.
Expand Down
10 changes: 5 additions & 5 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use crate::{
ethereum::db_config_dir,
service,
};
use fc_db::{kv::frontier_database_dir, DatabaseSource};
use fc_db::{DatabaseSource, kv::frontier_database_dir};

use futures::TryFutureExt;
use node_subtensor_runtime::Block;
use sc_cli::SubstrateCli;
use sc_service::{
config::{ExecutorConfiguration, RpcConfiguration},
Configuration,
config::{ExecutorConfiguration, RpcConfiguration},
};

impl SubstrateCli for Cli {
Expand Down Expand Up @@ -115,7 +115,7 @@ pub fn run() -> sc_cli::Result<()> {
"Cannot purge `{:?}` database",
config.database
)
.into())
.into());
}
};
cmd.run(frontier_database_config)?;
Expand All @@ -134,7 +134,7 @@ pub fn run() -> sc_cli::Result<()> {
"Cannot purge `{:?}` database: {:?}",
db_path, err,
)
.into())
.into());
}
};
}
Expand All @@ -157,7 +157,7 @@ pub fn run() -> sc_cli::Result<()> {
#[cfg(feature = "runtime-benchmarks")]
Some(Subcommand::Benchmark(cmd)) => {
use crate::benchmarking::{
inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder,
RemarkBuilder, TransferKeepAliveBuilder, inherent_benchmark_data,
};
use frame_benchmarking_cli::{
BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE,
Expand Down
10 changes: 5 additions & 5 deletions node/src/ethereum.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
pub use fc_consensus::FrontierBlockImport;
use fc_rpc::{
pending::AuraConsensusDataProvider, Debug, DebugApiServer, Eth, EthApiServer, EthConfig,
EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub, EthPubSubApiServer, EthSigner, EthTask,
Net, NetApiServer, Web3, Web3ApiServer,
Debug, DebugApiServer, Eth, EthApiServer, EthConfig, EthDevSigner, EthFilter,
EthFilterApiServer, EthPubSub, EthPubSubApiServer, EthSigner, EthTask, Net, NetApiServer, Web3,
Web3ApiServer, pending::AuraConsensusDataProvider,
};
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
/// Frontier DB backend type.
pub use fc_storage::{StorageOverride, StorageOverrideHandler};
use fp_rpc::ConvertTransaction;
use futures::future;
use futures::StreamExt;
use futures::future;
use jsonrpsee::RpcModule;
use node_subtensor_runtime::opaque::Block;
use sc_client_api::client::BlockchainEvents;
use sc_network_sync::SyncingService;
use sc_rpc::SubscriptionTaskExecutor;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
use sc_service::{Configuration, TaskManager, error::Error as ServiceError};
use sc_transaction_pool::ChainApi;
use sc_transaction_pool_api::TransactionPool;
use sp_inherents::CreateInherentDataProviders;
Expand Down
2 changes: 1 addition & 1 deletion node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub use fc_rpc::EthBlockDataCacheTask;
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
use fc_storage::StorageOverride;
use jsonrpsee::RpcModule;
use node_subtensor_runtime::opaque::Block;
use node_subtensor_runtime::Hash;
use node_subtensor_runtime::opaque::Block;
use sc_consensus_manual_seal::EngineCommand;
use sc_network::service::traits::NetworkService;
use sc_network_sync::SyncingService;
Expand Down
16 changes: 8 additions & 8 deletions node/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.

use fp_consensus::{ensure_log, FindLogError};
use fp_consensus::{FindLogError, ensure_log};
use fp_rpc::EthereumRuntimeRPCApi;
use futures::{channel::mpsc, future, FutureExt};
use node_subtensor_runtime::{opaque::Block, RuntimeApi, TransactionConverter};
use futures::{FutureExt, channel::mpsc, future};
use node_subtensor_runtime::{RuntimeApi, TransactionConverter, opaque::Block};
use sc_client_api::{Backend as BackendT, BlockBackend};
use sc_consensus::{
BasicQueue, BlockCheckParams, BlockImport, BlockImportParams, BoxBlockImport, ImportResult,
};
use sc_consensus_grandpa::BlockNumberOps;
use sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging;
use sc_network_sync::strategy::warp::{WarpSyncConfig, WarpSyncProvider};
use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager};
use sc_telemetry::{log, Telemetry, TelemetryHandle, TelemetryWorker};
use sc_service::{Configuration, PartialComponents, TaskManager, error::Error as ServiceError};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, log};
use sc_transaction_pool::FullPool;
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_api::ProvideRuntimeApi;
Expand All @@ -27,9 +27,9 @@ use substrate_prometheus_endpoint::Registry;
use crate::cli::Sealing;
use crate::client::{FullBackend, FullClient, HostFunctions, RuntimeExecutor};
use crate::ethereum::{
db_config_dir, new_frontier_partial, spawn_frontier_tasks, BackendType, EthConfiguration,
FrontierBackend, FrontierBlockImport, FrontierPartialComponents, StorageOverride,
StorageOverrideHandler,
BackendType, EthConfiguration, FrontierBackend, FrontierBlockImport, FrontierPartialComponents,
StorageOverride, StorageOverrideHandler, db_config_dir, new_frontier_partial,
spawn_frontier_tasks,
};

/// The minimum period of blocks on which justifications will be
Expand Down
2 changes: 1 addition & 1 deletion pallets/admin-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "4.0.0-dev"
description = "FRAME pallet for extending admin utilities."
authors = ["Bittensor Nucleus Team"]
homepage = "https://bittensor.com"
edition = "2021"
edition = "2024"
license = "Unlicense"
publish = false
repository = "https://github.com/opentensor/subtensor"
Expand Down
10 changes: 5 additions & 5 deletions pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use frame_system::pallet_prelude::BlockNumberFor;
// - we could use a type parameter for `AuthorityId`, but there is
// no sense for this as GRANDPA's `AuthorityId` is not a parameter -- it's always the same
use sp_consensus_grandpa::AuthorityList;
use sp_runtime::{traits::Member, DispatchResult, RuntimeAppPublic};
use sp_runtime::{DispatchResult, RuntimeAppPublic, traits::Member};

mod benchmarking;

Expand Down Expand Up @@ -586,10 +586,10 @@ pub mod pallet {
target_registrations_per_interval,
);
log::debug!(
"RegistrationPerIntervalSet( netuid: {:?} target_registrations_per_interval: {:?} ) ",
netuid,
target_registrations_per_interval
);
"RegistrationPerIntervalSet( netuid: {:?} target_registrations_per_interval: {:?} ) ",
netuid,
target_registrations_per_interval
);
Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/admin-utils/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use frame_support::{
weights,
};
use frame_system as system;
use frame_system::{limits, EnsureNever, EnsureRoot};
use frame_system::{EnsureNever, EnsureRoot, limits};
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_consensus_grandpa::AuthorityList as GrandpaAuthorityList;
use sp_core::U256;
use sp_core::{ConstU64, H256};
use sp_runtime::{
BuildStorage, KeyTypeId, Perbill,
testing::TestXt,
traits::{BlakeTwo256, ConstU32, IdentityLookup},
BuildStorage, KeyTypeId, Perbill,
};
use sp_std::cmp::Ordering;
use sp_weights::Weight;
Expand Down Expand Up @@ -326,8 +326,8 @@ pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"test");

mod test_crypto {
use super::KEY_TYPE;
use sp_core::sr25519::{Public as Sr25519Public, Signature as Sr25519Signature};
use sp_core::U256;
use sp_core::sr25519::{Public as Sr25519Public, Signature as Sr25519Signature};
use sp_runtime::{
app_crypto::{app_crypto, sr25519},
traits::IdentifyAccount,
Expand Down
4 changes: 2 additions & 2 deletions pallets/admin-utils/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use pallet_subtensor::Error as SubtensorError;
// use pallet_subtensor::{migrations, Event};
use pallet_subtensor::Event;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{ed25519, Pair, U256};
use sp_core::{Pair, U256, ed25519};

use crate::pallet::PrecompileEnable;
use crate::Error;
use crate::pallet::PrecompileEnable;
use mock::*;

mod mock;
Expand Down
2 changes: 1 addition & 1 deletion pallets/collective/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "pallet-collective"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>, Opentensor Technologies"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
homepage = "https://bittensor.com"
repository = "https://github.com/opentensor/subtensor"
Expand Down
44 changes: 22 additions & 22 deletions pallets/collective/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use frame_support::{
use scale_info::TypeInfo;
use sp_io::storage;
use sp_runtime::traits::Dispatchable;
use sp_runtime::{traits::Hash, RuntimeDebug, Saturating};
use sp_runtime::{RuntimeDebug, Saturating, traits::Hash};
use sp_std::{marker::PhantomData, prelude::*, result};

#[cfg(test)]
Expand Down Expand Up @@ -1107,10 +1107,10 @@ where

pub struct EnsureMember<AccountId, I: 'static>(PhantomData<(AccountId, I)>);
impl<
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
I,
AccountId: Decode,
> EnsureOrigin<O> for EnsureMember<AccountId, I>
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
I,
AccountId: Decode,
> EnsureOrigin<O> for EnsureMember<AccountId, I>
{
type Success = AccountId;
fn try_origin(o: O) -> Result<Self::Success, O> {
Expand All @@ -1131,11 +1131,11 @@ impl<

pub struct EnsureMembers<AccountId, I: 'static, const N: u32>(PhantomData<(AccountId, I)>);
impl<
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
AccountId,
I,
const N: u32,
> EnsureOrigin<O> for EnsureMembers<AccountId, I, N>
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
AccountId,
I,
const N: u32,
> EnsureOrigin<O> for EnsureMembers<AccountId, I, N>
{
type Success = (MemberCount, MemberCount);
fn try_origin(o: O) -> Result<Self::Success, O> {
Expand All @@ -1155,12 +1155,12 @@ pub struct EnsureProportionMoreThan<AccountId, I: 'static, const N: u32, const D
PhantomData<(AccountId, I)>,
);
impl<
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
AccountId,
I,
const N: u32,
const D: u32,
> EnsureOrigin<O> for EnsureProportionMoreThan<AccountId, I, N, D>
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
AccountId,
I,
const N: u32,
const D: u32,
> EnsureOrigin<O> for EnsureProportionMoreThan<AccountId, I, N, D>
{
type Success = ();
fn try_origin(o: O) -> Result<Self::Success, O> {
Expand All @@ -1180,12 +1180,12 @@ pub struct EnsureProportionAtLeast<AccountId, I: 'static, const N: u32, const D:
PhantomData<(AccountId, I)>,
);
impl<
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
AccountId,
I,
const N: u32,
const D: u32,
> EnsureOrigin<O> for EnsureProportionAtLeast<AccountId, I, N, D>
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
AccountId,
I,
const N: u32,
const D: u32,
> EnsureOrigin<O> for EnsureProportionAtLeast<AccountId, I, N, D>
{
type Success = ();
fn try_origin(o: O) -> Result<Self::Success, O> {
Expand Down
4 changes: 2 additions & 2 deletions pallets/collective/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
use super::{Event as CollectiveEvent, *};
use crate as pallet_collective;
use frame_support::{
assert_noop, assert_ok, derive_impl, parameter_types, traits::ConstU64, Hashable,
Hashable, assert_noop, assert_ok, derive_impl, parameter_types, traits::ConstU64,
};
use frame_system::{EnsureRoot, EventRecord, Phase};
use sp_core::H256;
use sp_runtime::{
BuildStorage,
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
BuildStorage,
};

pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
Expand Down
2 changes: 1 addition & 1 deletion pallets/commitments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "4.0.0-dev"
description = "Add the ability to commit generic hashed data for network participants."
authors = ["Bittensor Nucleus Team"]
homepage = "https://bittensor.com"
edition = "2021"
edition = "2024"
license = "Unlicense"
publish = false
repository = "https://github.com/opentensor/subtensor"
Expand Down
2 changes: 1 addition & 1 deletion pallets/commitments/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub use types::*;
pub use weights::WeightInfo;

use frame_support::traits::Currency;
use sp_runtime::{traits::Zero, Saturating};
use sp_runtime::{Saturating, traits::Zero};
use sp_std::boxed::Box;

type BalanceOf<T> =
Expand Down
Loading
Loading