Skip to content
Draft

Typos #2245

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
10 changes: 5 additions & 5 deletions pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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<T: Config>() -> u64 {
T::InitialTxChildKeyTakeRateLimit::get()
Expand Down Expand Up @@ -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<T: Config> =
StorageMap<_, Identity, RateLimitKey<T::AccountId>, u64, ValueQuery, DefaultZeroU64<T>>;
Expand Down Expand Up @@ -2624,7 +2624,7 @@ impl<T: Config + pallet_balances::Config<Balance = u64>>
}

/// 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<AccountId> {
// The setting sn owner hotkey operation is rate limited per netuid
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,7 +45,7 @@ pub fn migrate_commit_reveal_settings<T: Config>() -> Weight {
}

if RevealPeriodEpochs::<T>::get(*netuid) == 0 {
RevealPeriodEpochs::<T>::insert(*netuid, MIN_COMMIT_REVEAL_PEROIDS);
RevealPeriodEpochs::<T>::insert(*netuid, MIN_COMMIT_REVEAL_PERIODS);
weight = weight.saturating_add(T::DbWeight::get().writes(1));
}
}
Expand Down
12 changes: 6 additions & 6 deletions pallets/subtensor/src/rpc_info/metagraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub struct Metagraph<AccountId: TypeInfo + Encode + Decode> {
coldkeys: Vec<AccountId>, // coldkey per UID
identities: Vec<Option<ChainIdentityOfV2>>, // coldkeys identities
axons: Vec<AxonInfo>, // UID axons
active: Vec<bool>, // Avtive per UID
active: Vec<bool>, // Active per UID
validator_permit: Vec<bool>, // Val permit per UID
pruning_score: Vec<Compact<u16>>, // Pruning per UID
last_update: Vec<Compact<u64>>, // Last update per UID
Expand Down Expand Up @@ -141,7 +141,7 @@ pub struct SelectiveMetagraph<AccountId: TypeInfo + Encode + Decode + Clone> {
alpha_in_emission: Option<Compact<AlphaCurrency>>, // amount injected outstanding per block
tao_in_emission: Option<Compact<TaoCurrency>>, // amount of tao injected per block
pending_alpha_emission: Option<Compact<AlphaCurrency>>, // pending alpha to be distributed
pending_root_emission: Option<Compact<TaoCurrency>>, // panding tao for root divs to be distributed
pending_root_emission: Option<Compact<TaoCurrency>>, // pending tao for root divs to be distributed
subnet_volume: Option<Compact<u128>>, // volume of the subnet in TAO
moving_price: Option<I96F32>, // subnet moving price.

Expand Down Expand Up @@ -190,7 +190,7 @@ pub struct SelectiveMetagraph<AccountId: TypeInfo + Encode + Decode + Clone> {
coldkeys: Option<Vec<AccountId>>, // coldkey per UID
identities: Option<Vec<Option<ChainIdentityOfV2>>>, // coldkeys identities
axons: Option<Vec<AxonInfo>>, // UID axons.
active: Option<Vec<bool>>, // Avtive per UID
active: Option<Vec<bool>>, // Active per UID
validator_permit: Option<Vec<bool>>, // Val permit per UID
pruning_score: Option<Vec<Compact<u16>>>, // Pruning per UID
last_update: Option<Vec<Compact<u64>>>, // Last update per UID
Expand Down Expand Up @@ -697,7 +697,7 @@ impl<T: Config> Pallet<T> {
pending_alpha_emission: PendingValidatorEmission::<T>::get(netuid)
.saturating_add(PendingServerEmission::<T>::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::<T>::get(netuid),

Expand Down Expand Up @@ -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::<u32> {
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());
}
6 changes: 3 additions & 3 deletions pallets/subtensor/src/subnets/weights.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down Expand Up @@ -1288,12 +1288,12 @@ impl<T: Config> Pallet<T> {

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::<T>::RevealPeriodTooLarge
);

ensure!(
reveal_period >= MIN_COMMIT_REVEAL_PEROIDS,
reveal_period >= MIN_COMMIT_REVEAL_PERIODS,
Error::<T>::RevealPeriodTooSmall
);

Expand Down
4 changes: 2 additions & 2 deletions pallets/subtensor/src/tests/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading