Skip to content
Open
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
1 change: 0 additions & 1 deletion pallets/subtensor/src/coinbase/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ impl<T: Config> Pallet<T> {
// --- 14. Locks & toggles.
TransferToggle::<T>::remove(netuid);
SubnetLocked::<T>::remove(netuid);
LargestLocked::<T>::remove(netuid);

// --- 15. Mechanism step / emissions bookkeeping.
FirstEmissionBlockNumber::<T>::remove(netuid);
Expand Down
13 changes: 0 additions & 13 deletions pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,10 +1111,6 @@ pub mod pallet {
DefaultZeroU64<T>,
>;

/// Ensures unique IDs for StakeJobs storage map
#[pallet::storage]
pub type NextStakeJobId<T> = StorageValue<_, u64, ValueQuery, DefaultZeroU64<T>>;

/// ============================
/// ==== Staking Variables ====
/// ============================
Expand Down Expand Up @@ -1496,10 +1492,6 @@ pub mod pallet {
/// ============================
/// ==== Global Parameters =====
/// ============================
/// --- StorageItem Global Used Work.
#[pallet::storage]
pub type UsedWork<T: Config> = StorageMap<_, Identity, Vec<u8>, u64, ValueQuery>;

/// --- ITEM( global_max_registrations_per_block )
#[pallet::storage]
pub type MaxRegistrationsPerBlock<T> =
Expand Down Expand Up @@ -1571,11 +1563,6 @@ pub mod pallet {
pub type SubnetLocked<T: Config> =
StorageMap<_, Identity, NetUid, TaoCurrency, ValueQuery, DefaultZeroTao<T>>;

/// --- MAP ( netuid ) --> largest_locked
#[pallet::storage]
pub type LargestLocked<T: Config> =
StorageMap<_, Identity, NetUid, u64, ValueQuery, DefaultZeroU64<T>>;

/// =================
/// ==== Tempos =====
/// =================
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/src/macros/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ mod genesis {
NetworkRegistrationAllowed::<T>::insert(netuid, true);
SubnetOwner::<T>::insert(netuid, hotkey.clone());
SubnetLocked::<T>::insert(netuid, TaoCurrency::from(1));
LargestLocked::<T>::insert(netuid, 1);
Alpha::<T>::insert(
// Lock the initial funds making this key the owner.
(hotkey.clone(), hotkey.clone(), netuid),
Expand Down
6 changes: 2 additions & 4 deletions pallets/subtensor/src/subnets/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,9 @@ impl<T: Config> Pallet<T> {
Error::<T>::InvalidDifficulty
); // Check that the work meets difficulty.

// --- 9. Check Work is the product of the nonce, the block number, and hotkey. Add this as used work.
// --- 9. Check Work is the product of the nonce, the block number, and hotkey.
let seal: H256 = Self::create_seal_hash(block_number, nonce, &hotkey);
ensure!(seal == work_hash, Error::<T>::InvalidSeal);
UsedWork::<T>::insert(work.clone(), current_block_number);

// --- 10. If the network account does not exist we will create it here.
Self::create_account_if_non_existent(&coldkey, &hotkey);
Expand Down Expand Up @@ -367,10 +366,9 @@ impl<T: Config> Pallet<T> {
Error::<T>::InvalidDifficulty
); // Check that the work meets difficulty.

// --- 4. Check Work is the product of the nonce, the block number, and hotkey. Add this as used work.
// --- 4. Check Work is the product of the nonce, the block number, and hotkey.
let seal: H256 = Self::create_seal_hash(block_number, nonce, &coldkey);
ensure!(seal == work_hash, Error::<T>::InvalidSeal);
UsedWork::<T>::insert(work.clone(), current_block_number);

// --- 5. Add Balance via faucet.
let balance_to_add: u64 = 1_000_000_000_000;
Expand Down
2 changes: 0 additions & 2 deletions pallets/subtensor/src/tests/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ fn dissolve_clears_all_per_subnet_storages() {
// Subnet locks
TransferToggle::<Test>::insert(net, true);
SubnetLocked::<Test>::insert(net, TaoCurrency::from(1));
LargestLocked::<Test>::insert(net, 1u64);

// Subnet parameters & pending counters
FirstEmissionBlockNumber::<Test>::insert(net, 1u64);
Expand Down Expand Up @@ -535,7 +534,6 @@ fn dissolve_clears_all_per_subnet_storages() {
// Subnet locks
assert!(!TransferToggle::<Test>::contains_key(net));
assert!(!SubnetLocked::<Test>::contains_key(net));
assert!(!LargestLocked::<Test>::contains_key(net));

// Subnet parameters & pending counters
assert!(!FirstEmissionBlockNumber::<Test>::contains_key(net));
Expand Down