Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the ability to moving a portion of a stake from one subnet to another #749

Open
wants to merge 35 commits into
base: rao
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a02c3f1
Adding the ability to moving a portion of a stake from one subnet to …
roman-opentensor Aug 23, 2024
4a500dc
add checker if amount_moved <= origin_alpha
roman-opentensor Aug 23, 2024
110a004
add zero amount_moved and related Error
roman-opentensor Aug 26, 2024
3800307
fix unit test
open-junius Sep 5, 2024
ebe8dc6
fix more clippy
open-junius Sep 5, 2024
b3cfe62
fix clippy
open-junius Sep 5, 2024
490bbb8
fix last reference clippy
open-junius Sep 5, 2024
6456729
fix hotkey reference
open-junius Sep 5, 2024
130e9ca
fix clippy
open-junius Sep 6, 2024
ec31039
fmt code
open-junius Sep 6, 2024
68bc847
fix clippy
open-junius Sep 6, 2024
4b333bd
fix all clippy
open-junius Sep 6, 2024
d8c63b1
fix lint in test files
open-junius Sep 6, 2024
843565a
fix pallet manual inspect
open-junius Sep 6, 2024
044c04a
allow clippy in test
open-junius Sep 6, 2024
2df4df5
fix more clippy in test
open-junius Sep 6, 2024
21c4a0a
fix clippy of pallet in test
open-junius Sep 6, 2024
23b77c8
fix clippy in runtime
open-junius Sep 6, 2024
c18d526
fix test cases
open-junius Sep 6, 2024
2130fb4
fix test case
open-junius Sep 6, 2024
1c8dd97
Merge pull request #782 from opentensor/junius/fix/stake-move-add-amount
open-junius Sep 6, 2024
68e9344
feature set stakes
open-junius Sep 9, 2024
8e2a85b
add doc for set stakes
open-junius Sep 9, 2024
6377c95
keep
open-junius Sep 9, 2024
7e7dbd7
revert set stakes
open-junius Sep 9, 2024
e8f33f8
update extrinsic signature
open-junius Sep 9, 2024
ba76de8
correct extrinsic
open-junius Sep 10, 2024
0a6f45c
fix tests
open-junius Sep 10, 2024
208738e
fix all tests
open-junius Sep 10, 2024
9dc1361
more test cases
open-junius Sep 10, 2024
df66e66
fix wrong locks
open-junius Sep 10, 2024
481c8f4
more unit tests for lock
open-junius Sep 10, 2024
28f4232
complete the pr
open-junius Sep 11, 2024
411af02
update event type
open-junius Sep 20, 2024
8210981
Merge pull request #789 from opentensor/junius/feat/set-stake
open-junius Sep 20, 2024
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
825 changes: 660 additions & 165 deletions node/src/chain_spec/raonet.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sp_runtime::DispatchError;
use sp_runtime::{traits::Member, RuntimeAppPublic};

mod benchmarking;

#[allow(clippy::manual_inspect)]
#[deny(missing_docs)]
#[frame_support::pallet]
pub mod pallet {
Expand Down
1 change: 1 addition & 0 deletions pallets/collective/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ pub struct Votes<AccountId, BlockNumber> {
/// The hard end time of this vote.
end: BlockNumber,
}
#[allow(clippy::manual_inspect)]
#[deny(missing_docs)]
#[frame_support::pallet]
pub mod pallet {
Expand Down
1 change: 1 addition & 0 deletions pallets/collective/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ frame_support::construct_runtime!(
);
mod mock_democracy {
pub use pallet::*;
#[allow(clippy::manual_inspect)]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use frame_support::pallet_prelude::*;
Expand Down
1 change: 1 addition & 0 deletions pallets/commitments/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use sp_std::boxed::Box;

type BalanceOf<T> =
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
#[allow(clippy::manual_inspect)]
#[deny(missing_docs)]
#[frame_support::pallet]
pub mod pallet {
Expand Down
1 change: 1 addition & 0 deletions pallets/registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use sp_std::boxed::Box;

type BalanceOf<T> =
<<T as Config>::Currency as fungible::Inspect<<T as frame_system::Config>::AccountId>>::Balance;
#[allow(clippy::manual_inspect)]
#[deny(missing_docs)]
#[frame_support::pallet]
pub mod pallet {
Expand Down
21 changes: 16 additions & 5 deletions pallets/subtensor/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,15 @@ where
.map_err(|e| Error::RuntimeError(format!("Unable to get subnet info: {:?}", e)).into())
}

fn get_subnet_state(&self, netuid: u16, at: Option<<Block as BlockT>::Hash>) -> RpcResult<Vec<u8>> {
fn get_subnet_state(
&self,
netuid: u16,
at: Option<<Block as BlockT>::Hash>,
) -> RpcResult<Vec<u8>> {
let api = self.client.runtime_api();
let at = at.unwrap_or_else(|| self.client.info().best_hash);
api.get_subnet_state(at, netuid).map_err(|e| Error::RuntimeError(format!("Unable to get subnet state: {:?}", e)).into())
api.get_subnet_state(at, netuid)
.map_err(|e| Error::RuntimeError(format!("Unable to get subnet state: {:?}", e)).into())
}
fn get_subnets_info(&self, at: Option<<Block as BlockT>::Hash>) -> RpcResult<Vec<u8>> {
let api = self.client.runtime_api();
Expand All @@ -222,12 +227,18 @@ where
fn get_all_dynamic_info(&self, at: Option<<Block as BlockT>::Hash>) -> RpcResult<Vec<u8>> {
let api = self.client.runtime_api();
let at = at.unwrap_or_else(|| self.client.info().best_hash);
api.get_all_dynamic_info(at).map_err(|e| Error::RuntimeError(format!("Unable to get subnets info: {:?}", e)).into())
api.get_all_dynamic_info(at)
.map_err(|e| Error::RuntimeError(format!("Unable to get subnets info: {:?}", e)).into())
}
fn get_dynamic_info(&self, netuid: u16, at: Option<<Block as BlockT>::Hash>) -> RpcResult<Vec<u8>> {
fn get_dynamic_info(
&self,
netuid: u16,
at: Option<<Block as BlockT>::Hash>,
) -> RpcResult<Vec<u8>> {
let api = self.client.runtime_api();
let at = at.unwrap_or_else(|| self.client.info().best_hash);
api.get_dynamic_info(at, netuid).map_err(|e| Error::RuntimeError(format!("Unable to get subnets info: {:?}", e)).into())
api.get_dynamic_info(at, netuid)
.map_err(|e| Error::RuntimeError(format!("Unable to get subnets info: {:?}", e)).into())
}

fn get_network_lock_cost(&self, at: Option<<Block as BlockT>::Hash>) -> RpcResult<u64> {
Expand Down
3 changes: 2 additions & 1 deletion pallets/subtensor/src/coinbase/block_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ impl<T: Config> Pallet<T> {
Self::run_coinbase();
// --- 4. Adjust tempos every day.
// TODO(const) make this better.
if block_number.saturating_add(1) % 300 == 0 { // adjust every hour.
if block_number.saturating_add(1) % 300 == 0 {
// adjust every hour.
Self::adjust_tempos();
}
// Return ok.
Expand Down
78 changes: 52 additions & 26 deletions pallets/subtensor/src/coinbase/run_coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ impl<T: Config> Pallet<T> {
} // Skip root network
let mechid = SubnetMechanism::<T>::get(*netuid);
let subnet_tao = I96F32::from_num(SubnetTAO::<T>::get(*netuid));
*mechanism_tao.entry(mechid).or_insert(I96F32::from_num(0)) += subnet_tao;

mechanism_tao
.entry(mechid)
.and_modify(|e| *e = e.saturating_add(subnet_tao))
.or_insert(subnet_tao);
total_active_tao = total_active_tao.saturating_add(subnet_tao);
}
log::debug!("Mechanism TAO sums: {:?}", mechanism_tao);
Expand Down Expand Up @@ -136,12 +140,15 @@ impl<T: Config> Pallet<T> {

// --- 6.4 Decrement the emission by the owner cut.
// 9% cut for the owner.
let owner_cut: u64 = I96F32::from_num(subnet_emission).saturating_mul(Self::get_float_subnet_owner_cut()).to_num::<u64>();
let owner_cut: u64 = I96F32::from_num(subnet_emission)
.saturating_mul(Self::get_float_subnet_owner_cut())
.to_num::<u64>();
Self::distribute_owner_cut(*netuid, owner_cut);
let remaining_emission: u64 = subnet_emission.saturating_sub(owner_cut);

// --- 6.5 Pass emission through epoch() --> hotkey emission.
let hotkey_emission: Vec<(T::AccountId, u64, u64)> = Self::epoch_mock(*netuid, remaining_emission);
let hotkey_emission: Vec<(T::AccountId, u64, u64)> =
Self::epoch_mock(*netuid, remaining_emission);

// --- 6.6 Accumulate the tuples on hotkeys:
for (hotkey, mining_emission, validator_emission) in hotkey_emission {
Expand All @@ -158,13 +165,17 @@ impl<T: Config> Pallet<T> {
// Accounting
let mut processed_hotkeys_on_netuid: BTreeMap<T::AccountId, ()> = BTreeMap::new();
for (hotkey, netuid_j, emission) in hotkey_emission_tuples {
PendingdHotkeyEmissionOnNetuid::<T>::mutate( &hotkey, netuid_j, |total| { *total = total.saturating_add( emission ) });
PendingdHotkeyEmissionOnNetuid::<T>::mutate(&hotkey, netuid_j, |total| {
*total = total.saturating_add(emission)
});
// If the hotkey has not been processed yet, update the last emission drain block
if !processed_hotkeys_on_netuid.contains_key( &hotkey ) {
LastHotkeyEmissionOnNetuid::<T>::insert( &hotkey, netuid_j, emission);
processed_hotkeys_on_netuid.insert( hotkey.clone(), () );
if !processed_hotkeys_on_netuid.contains_key(&hotkey) {
LastHotkeyEmissionOnNetuid::<T>::insert(&hotkey, netuid_j, emission);
processed_hotkeys_on_netuid.insert(hotkey.clone(), ());
} else {
LastHotkeyEmissionOnNetuid::<T>::mutate( &hotkey, netuid_j, |total| { *total = total.saturating_add(emission) });
LastHotkeyEmissionOnNetuid::<T>::mutate(&hotkey, netuid_j, |total| {
*total = total.saturating_add(emission)
});
}
}
}
Expand Down Expand Up @@ -246,11 +257,14 @@ impl<T: Config> Pallet<T> {
// Calculate total global and alpha (subnet-specific) stakes from all parents
for (proportion, parent) in Self::get_parents(hotkey, netuid) {
// Get the last block this parent added some stake
let stake_add_block = LastAddStakeIncrease::<T>::get(&hotkey, Self::get_coldkey_for_hotkey(&hotkey));
let stake_add_block =
LastAddStakeIncrease::<T>::get(&hotkey, Self::get_coldkey_for_hotkey(hotkey));

// If the last block this parent added any stake is old enough (older than two subnet tempos),
// If the last block this parent added any stake is old enough (older than two subnet tempos),
// consider this parent's contribution
if Self::get_current_block_as_u64() - stake_add_block >= 2u64 * Self::get_tempo(netuid) as u64 {
if Self::get_current_block_as_u64().saturating_sub(stake_add_block)
>= (Self::get_tempo(netuid) as u64).saturating_mul(2_u64)
{
// Convert the parent's stake proportion to a fractional value
let parent_proportion: I96F32 =
I96F32::from_num(proportion).saturating_div(I96F32::from_num(u64::MAX));
Expand All @@ -261,7 +275,8 @@ impl<T: Config> Pallet<T> {
I96F32::from_num(Self::get_stake_for_hotkey_on_subnet(&parent, netuid));

// Calculate the parent's contribution to the hotkey's stakes
let parent_alpha_contribution: I96F32 = parent_alpha.saturating_mul(parent_proportion);
let parent_alpha_contribution: I96F32 =
parent_alpha.saturating_mul(parent_proportion);
let parent_global_contribution: I96F32 =
parent_global.saturating_mul(parent_proportion);

Expand Down Expand Up @@ -307,7 +322,7 @@ impl<T: Config> Pallet<T> {
hotkey_emission_tuples.push((parent, netuid, total_emission));

// Keep track of total emission distributed to parents
to_parents += total_emission;
to_parents = to_parents.saturating_add(total_emission);
}

// Calculate the final emission for the hotkey itself
Expand Down Expand Up @@ -375,15 +390,17 @@ impl<T: Config> Pallet<T> {
// Get the last block this nominator added some stake to this hotkey
let stake_add_block = LastAddStakeIncrease::<T>::get(&hotkey, &nominator);

// If the last block this nominator added any stake is old enough (older than one hotkey tempo),
// If the last block this nominator added any stake is old enough (older than one hotkey tempo),
// consider this nominator's contribution
if Self::get_current_block_as_u64() - stake_add_block >= HotkeyEmissionTempo::<T>::get() {
if Self::get_current_block_as_u64().saturating_sub(stake_add_block)
>= HotkeyEmissionTempo::<T>::get()
{
let alpha_contribution: I96F32 =
I96F32::from_num(Alpha::<T>::get((&hotkey, nominator.clone(), netuid)));
let global_contribution: I96F32 =
I96F32::from_num(Self::get_global_for_hotkey_and_coldkey(hotkey, &nominator));
total_global += global_contribution;
total_alpha += alpha_contribution;
total_global = total_global.saturating_add(global_contribution);
total_alpha = total_alpha.saturating_add(alpha_contribution);
contributions.push((nominator.clone(), alpha_contribution, global_contribution));
}
}
Expand Down Expand Up @@ -411,7 +428,7 @@ impl<T: Config> Pallet<T> {
.to_num::<u64>();
if total_emission > 0 {
// Record the emission for this nominator
to_nominators += total_emission;
to_nominators = to_nominators.saturating_add(total_emission);
emission_tuples.push((
hotkey.clone(),
nominator.clone(),
Expand All @@ -423,18 +440,21 @@ impl<T: Config> Pallet<T> {
}

// Get the last block the neuron owner added some stake to this hotkey
let stake_add_block = LastAddStakeIncrease::<T>::get(&hotkey, Self::get_coldkey_for_hotkey(&hotkey));
let stake_add_block =
LastAddStakeIncrease::<T>::get(&hotkey, Self::get_coldkey_for_hotkey(hotkey));

// If the last block this nominator added any stake is old enough (older than one hotkey tempo),
// If the last block this nominator added any stake is old enough (older than one hotkey tempo),
// consider this nominator's contribution
if Self::get_current_block_as_u64() - stake_add_block >= HotkeyEmissionTempo::<T>::get() {
if Self::get_current_block_as_u64().saturating_sub(stake_add_block)
>= HotkeyEmissionTempo::<T>::get()
{
// Calculate and distribute the remaining emission to the hotkey
let hotkey_owner: T::AccountId = Owner::<T>::get(hotkey);
let remainder: u64 = emission
.to_num::<u64>()
.saturating_sub(hotkey_take.to_num::<u64>())
.saturating_sub(to_nominators);
let final_hotkey_emission: u64 = hotkey_take.to_num::<u64>() + remainder;
let final_hotkey_emission: u64 = hotkey_take.to_num::<u64>().saturating_add(remainder);
emission_tuples.push((
hotkey.clone(),
hotkey_owner.clone(),
Expand Down Expand Up @@ -479,17 +499,23 @@ impl<T: Config> Pallet<T> {
/// - `u16`: The subnet ID (netuid).
/// - `u64`: The emission value to be added.
/// * `block` - The current block number.
pub fn accumulate_nominator_emission(nominator_tuples: &mut Vec<(T::AccountId, T::AccountId, u16, u64)>, block: u64) {
pub fn accumulate_nominator_emission(
nominator_tuples: &mut Vec<(T::AccountId, T::AccountId, u16, u64)>,
block: u64,
) {
// Track processed hotkeys to avoid redundant updates
let mut processed_hotkeys: BTreeMap<T::AccountId, ()> = BTreeMap::new();

// Iterate over each tuple in the nominator_tuples vector
for (hotkey, coldkey, netuid, emission) in nominator_tuples {
// If the emission value is greater than 0, update the subnet emission
if *emission > 0 {
Self::emit_into_subnet(hotkey, coldkey, *netuid, *emission);
// Record the last emission value for the hotkey-coldkey pair on the subnet
LastHotkeyColdkeyEmissionOnNetuid::<T>::insert((hotkey.clone(), coldkey.clone(), *netuid), *emission);
LastHotkeyColdkeyEmissionOnNetuid::<T>::insert(
(hotkey.clone(), coldkey.clone(), *netuid),
*emission,
);
}
// If the hotkey has not been processed yet, update the last emission drain block
if !processed_hotkeys.contains_key(hotkey) {
Expand Down Expand Up @@ -546,7 +572,7 @@ impl<T: Config> Pallet<T> {
let netuid_plus_one = (netuid as u64).saturating_add(1);
let tempo_plus_one = (tempo as u64).saturating_add(1);
let adjusted_block = block_number.wrapping_add(netuid_plus_one);
let remainder = adjusted_block % tempo_plus_one;
let remainder = adjusted_block.rem_euclid(tempo_plus_one);
(tempo as u64).saturating_sub(remainder)
}

Expand Down
30 changes: 20 additions & 10 deletions pallets/subtensor/src/epoch/run_epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@ use sp_std::vec;
use substrate_fixed::types::{I32F32, I64F64, I96F32};

impl<T: Config> Pallet<T> {


/// Calculates reward consensus and returns the emissions for uids/hotkeys in a given `netuid`.
/// (Dense version used only for testing purposes.)
#[allow(clippy::indexing_slicing)]
pub fn epoch_mock(netuid: u16, rao_emission: u64) -> Vec<(T::AccountId, u64, u64)> {
// Get subnetwork size.
let n: u16 = Self::get_subnetwork_n(netuid);
let hotkeys: Vec<(u16, T::AccountId)> = <Keys<T> as IterableStorageDoubleMap<u16, u16, T::AccountId>>::iter_prefix(netuid).collect();
let (stake, raw_alpha_stake, raw_global_tao_stake): (Vec<I32F32>, Vec<u64>, Vec<u64>) = Self::get_stake_weights_for_network(netuid);
let cloned_stake_weight: Vec<u16> = stake.iter().map(|xi| fixed_proportion_to_u16(*xi)).collect::<Vec<u16>>();
let emission: Vec<u64> = stake.iter()
.map(|&stake| I96F32::from_num(stake) * I96F32::from_num(rao_emission))
let hotkeys: Vec<(u16, T::AccountId)> =
<Keys<T> as IterableStorageDoubleMap<u16, u16, T::AccountId>>::iter_prefix(netuid)
.collect();
let (stake, raw_alpha_stake, raw_global_tao_stake): (Vec<I32F32>, Vec<u64>, Vec<u64>) =
Self::get_stake_weights_for_network(netuid);
let cloned_stake_weight: Vec<u16> = stake
.iter()
.map(|xi| fixed_proportion_to_u16(*xi))
.collect::<Vec<u16>>();
let emission: Vec<u64> = stake
.iter()
.map(|&stake| I96F32::from_num(stake).saturating_mul(I96F32::from_num(rao_emission)))
.map(|e| e.to_num::<u64>())
.collect();
LocalStake::<T>::insert(netuid, raw_alpha_stake.clone());
Expand All @@ -33,7 +38,10 @@ impl<T: Config> Pallet<T> {
PruningScores::<T>::insert(netuid, cloned_stake_weight.clone());
ValidatorTrust::<T>::insert(netuid, vec![0u16; n as usize]);
ValidatorPermit::<T>::insert(netuid, vec![true; n as usize]);
hotkeys.into_iter() .map(|(uid_i, hotkey)| { (hotkey, 0, emission[uid_i as usize])}).collect()
hotkeys
.into_iter()
.map(|(uid_i, hotkey)| (hotkey, 0, emission[uid_i as usize]))
.collect()
}

/// Calculates reward consensus and returns the emissions for uids/hotkeys in a given `netuid`.
Expand Down Expand Up @@ -96,7 +104,8 @@ impl<T: Config> Pallet<T> {
log::trace!("hotkeys: {:?}", &hotkeys);

// Access network stake as normalized vector.
let (stake, raw_alpha_stake, raw_global_tao_stake): (Vec<I32F32>, Vec<u64>, Vec<u64>) = Self::get_stake_weights_for_network(netuid);
let (stake, raw_alpha_stake, raw_global_tao_stake): (Vec<I32F32>, Vec<u64>, Vec<u64>) =
Self::get_stake_weights_for_network(netuid);
log::trace!("S:\n{:?}\n", &stake);

// =======================
Expand Down Expand Up @@ -428,7 +437,8 @@ impl<T: Config> Pallet<T> {
log::trace!("hotkeys: {:?}", &hotkeys);

// Access network stake as normalized vector.
let (stake, raw_alpha_stake, raw_global_tao_stake): (Vec<I32F32>, Vec<u64>, Vec<u64>) = Self::get_stake_weights_for_network(netuid);
let (stake, raw_alpha_stake, raw_global_tao_stake): (Vec<I32F32>, Vec<u64>, Vec<u64>) =
Self::get_stake_weights_for_network(netuid);
log::trace!("Normalised Stake: {:?}", &stake);

// =======================
Expand Down
9 changes: 6 additions & 3 deletions pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ pub mod pallet {
pub type HotkeyEmissionTempo<T> =
StorageValue<_, u64, ValueQuery, DefaultHotkeyEmissionTempo<T>>;
#[pallet::storage] // --- Map ( hot ) --> last_hotkey_emission_drain | Last block we drained this hotkey's emission.
pub type LastHotkeyEmissionDrain<T: Config> = StorageMap<_, Blake2_128Concat, T::AccountId, u64, ValueQuery, DefaultZeroU64<T>>;
pub type LastHotkeyEmissionDrain<T: Config> =
StorageMap<_, Blake2_128Concat, T::AccountId, u64, ValueQuery, DefaultZeroU64<T>>;
#[pallet::storage] // --- DMap ( hot, netuid ) --> emission | Accumulated hotkey emission.
pub type PendingdHotkeyEmissionOnNetuid<T: Config> = StorageDoubleMap<
_,
Expand Down Expand Up @@ -727,9 +728,11 @@ pub mod pallet {
StorageMap<_, Identity, u16, T::AccountId, ValueQuery, DefaultSubnetOwner<T>>;
// DEPRECATED
#[pallet::storage] // --- MAP ( netuid ) --> total_subnet_locked
pub type SubnetLocked<T: Config> = StorageMap<_, Identity, u16, u64, ValueQuery, DefaultZeroU64<T>>;
pub type SubnetLocked<T: Config> =
StorageMap<_, Identity, u16, u64, ValueQuery, DefaultZeroU64<T>>;
#[pallet::storage] // --- MAP ( netuid ) --> largest_locked
pub type LargestLocked<T: Config> = StorageMap<_, Identity, u16, u64, ValueQuery, DefaultZeroU64<T>>;
pub type LargestLocked<T: Config> =
StorageMap<_, Identity, u16, u64, ValueQuery, DefaultZeroU64<T>>;
#[pallet::storage] // --- ITEM( last_network_lock_cost )
pub type LockIntervalBlocks<T> = StorageValue<_, u64, ValueQuery, DefaultLockIntervalBlocks<T>>;
#[pallet::storage] // --- NMAP ( netuid, cold, hot ) --> (amount, start, end) | Returns the lock associated with a hotkey.
Expand Down
Loading