diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 6d61baadf3..a57f6b986d 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -116,9 +116,9 @@ pub mod pallet { pub const MIN_BALANCE_TO_PERFORM_COLDKEY_SWAP: TaoCurrency = TaoCurrency::new(100_000_000); // 0.1 TAO in RAO /// Minimum commit reveal periods - pub const MIN_COMMIT_REVEAL_PEROIDS: u64 = 1; + pub const MIN_COMMIT_REVEAL_PERIODS: u64 = 1; /// Maximum commit reveal periods - pub const MAX_COMMIT_REVEAL_PEROIDS: u64 = 100; + pub const MAX_COMMIT_REVEAL_PERIODS: u64 = 100; #[pallet::pallet] #[pallet::without_storage_info] @@ -896,7 +896,7 @@ pub mod pallet { T::InitialTxDelegateTakeRateLimit::get() } - /// Default value for chidlkey take rate limiting + /// Default value for childkey take rate limiting #[pallet::type_value] pub fn DefaultTxChildKeyTakeRateLimit() -> u64 { T::InitialTxChildKeyTakeRateLimit::get() @@ -1533,7 +1533,7 @@ pub mod pallet { /// ============================ /// ==== Rate Limiting ===== /// ============================ - /// --- MAP ( RateLimitKey ) --> Block number in which the last rate limited operation occured + /// --- MAP ( RateLimitKey ) --> Block number in which the last rate limited operation occurred #[pallet::storage] pub type LastRateLimitedBlock = StorageMap<_, Identity, RateLimitKey, u64, ValueQuery, DefaultZeroU64>; @@ -2624,7 +2624,7 @@ impl> } /// Enum that defines types of rate limited operations for -/// storing last block when this operation occured +/// storing last block when this operation occurred #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)] pub enum RateLimitKey { // The setting sn owner hotkey operation is rate limited per netuid diff --git a/pallets/subtensor/src/migrations/migrate_commit_reveal_settings.rs b/pallets/subtensor/src/migrations/migrate_commit_reveal_settings.rs index 54df469600..ebfb1c986d 100644 --- a/pallets/subtensor/src/migrations/migrate_commit_reveal_settings.rs +++ b/pallets/subtensor/src/migrations/migrate_commit_reveal_settings.rs @@ -1,6 +1,6 @@ use alloc::string::String; -use crate::MIN_COMMIT_REVEAL_PEROIDS; +use crate::MIN_COMMIT_REVEAL_PERIODS; use frame_support::IterableStorageMap; use frame_support::{traits::Get, weights::Weight}; use subtensor_runtime_common::NetUid; @@ -45,7 +45,7 @@ pub fn migrate_commit_reveal_settings() -> Weight { } if RevealPeriodEpochs::::get(*netuid) == 0 { - RevealPeriodEpochs::::insert(*netuid, MIN_COMMIT_REVEAL_PEROIDS); + RevealPeriodEpochs::::insert(*netuid, MIN_COMMIT_REVEAL_PERIODS); weight = weight.saturating_add(T::DbWeight::get().writes(1)); } } diff --git a/pallets/subtensor/src/rpc_info/metagraph.rs b/pallets/subtensor/src/rpc_info/metagraph.rs index ea24657aeb..e402534894 100644 --- a/pallets/subtensor/src/rpc_info/metagraph.rs +++ b/pallets/subtensor/src/rpc_info/metagraph.rs @@ -90,7 +90,7 @@ pub struct Metagraph { coldkeys: Vec, // coldkey per UID identities: Vec>, // coldkeys identities axons: Vec, // UID axons - active: Vec, // Avtive per UID + active: Vec, // Active per UID validator_permit: Vec, // Val permit per UID pruning_score: Vec>, // Pruning per UID last_update: Vec>, // Last update per UID @@ -141,7 +141,7 @@ pub struct SelectiveMetagraph { alpha_in_emission: Option>, // amount injected outstanding per block tao_in_emission: Option>, // amount of tao injected per block pending_alpha_emission: Option>, // pending alpha to be distributed - pending_root_emission: Option>, // panding tao for root divs to be distributed + pending_root_emission: Option>, // pending tao for root divs to be distributed subnet_volume: Option>, // volume of the subnet in TAO moving_price: Option, // subnet moving price. @@ -190,7 +190,7 @@ pub struct SelectiveMetagraph { coldkeys: Option>, // coldkey per UID identities: Option>>, // coldkeys identities axons: Option>, // UID axons. - active: Option>, // Avtive per UID + active: Option>, // Active per UID validator_permit: Option>, // Val permit per UID pruning_score: Option>>, // Pruning per UID last_update: Option>>, // Last update per UID @@ -697,7 +697,7 @@ impl Pallet { pending_alpha_emission: PendingValidatorEmission::::get(netuid) .saturating_add(PendingServerEmission::::get(netuid)) .into(), // pending alpha to be distributed - pending_root_emission: TaoCurrency::from(0u64).into(), // panding tao for root divs to be distributed + pending_root_emission: TaoCurrency::from(0u64).into(), // pending tao for root divs to be distributed subnet_volume: subnet_volume.into(), moving_price: SubnetMovingPrice::::get(netuid), @@ -1650,13 +1650,13 @@ fn test_selective_metagraph() { metagraph.merge_value(&metagraph_name, name_index); assert!(metagraph.name.is_some()); - let alph_low_index: usize = 50; + let alpha_low_index: usize = 50; let metagraph_alpha_low = SelectiveMetagraph:: { netuid: NetUid::ROOT.into(), alpha_low: Some(0_u16.into()), ..Default::default() }; assert!(metagraph.alpha_low.is_none()); - metagraph.merge_value(&metagraph_alpha_low, alph_low_index); + metagraph.merge_value(&metagraph_alpha_low, alpha_low_index); assert!(metagraph.alpha_low.is_some()); } diff --git a/pallets/subtensor/src/subnets/weights.rs b/pallets/subtensor/src/subnets/weights.rs index f1a2df56e2..d9a22fb5f5 100644 --- a/pallets/subtensor/src/subnets/weights.rs +++ b/pallets/subtensor/src/subnets/weights.rs @@ -1,6 +1,6 @@ use super::*; use crate::epoch::math::*; -use crate::{Error, MAX_COMMIT_REVEAL_PEROIDS, MIN_COMMIT_REVEAL_PEROIDS}; +use crate::{Error, MAX_COMMIT_REVEAL_PERIODS, MIN_COMMIT_REVEAL_PERIODS}; use codec::Compact; use frame_support::dispatch::DispatchResult; use safe_math::*; @@ -1288,12 +1288,12 @@ impl Pallet { pub fn set_reveal_period(netuid: NetUid, reveal_period: u64) -> DispatchResult { ensure!( - reveal_period <= MAX_COMMIT_REVEAL_PEROIDS, + reveal_period <= MAX_COMMIT_REVEAL_PERIODS, Error::::RevealPeriodTooLarge ); ensure!( - reveal_period >= MIN_COMMIT_REVEAL_PEROIDS, + reveal_period >= MIN_COMMIT_REVEAL_PERIODS, Error::::RevealPeriodTooSmall ); diff --git a/pallets/subtensor/src/tests/epoch.rs b/pallets/subtensor/src/tests/epoch.rs index cdf44df645..75f89ebb6b 100644 --- a/pallets/subtensor/src/tests/epoch.rs +++ b/pallets/subtensor/src/tests/epoch.rs @@ -1696,7 +1696,7 @@ fn test_outdated_weights() { U256::from(new_key), U256::from(new_key) )); - let deregistered_uid: u16 = n - 1; // since uid=n-1 only recieved 1/3 of weight, it will get pruned first + let deregistered_uid: u16 = n - 1; // since uid=n-1 only received 1/3 of weight, it will get pruned first assert_eq!( U256::from(new_key), SubtensorModule::get_hotkey_for_net_and_uid(netuid, deregistered_uid) @@ -2078,7 +2078,7 @@ fn test_deregistered_miner_bonds() { U256::from(new_key), U256::from(new_key) )); - let deregistered_uid: u16 = n - 1; // since uid=n-1 only recieved 1/3 of weight, it will get pruned first + let deregistered_uid: u16 = n - 1; // since uid=n-1 only received 1/3 of weight, it will get pruned first assert_eq!( U256::from(new_key), SubtensorModule::get_hotkey_for_net_and_uid(netuid, deregistered_uid)