Subnet Node
Classification
Registration Phase & Queue, and Start Epoch
Unique Hotkeys
Inserted & Updated Storage
TotalSubnetNodeUids::<T>::mutate(subnet_id, |n: &mut u32| *n += 1);
let current_uid = TotalSubnetNodeUids::<T>::get(subnet_id);
HotkeySubnetNodeId::<T>::insert(subnet_id, &hotkey, current_uid);
// Insert subnet node ID -> hotkey
SubnetNodeIdHotkey::<T>::insert(subnet_id, current_uid, &hotkey);
// Insert hotkey -> coldkey
HotkeyOwner::<T>::insert(&hotkey, &coldkey);
// Insert coldkey -> hotkeys
hotkeys.insert(hotkey.clone());
ColdkeyHotkeys::<T>::insert(&coldkey, hotkeys);
// Insert subnet peer and bootstrap peer to keep peer_ids unique within subnets
PeerIdSubnetNode::<T>::insert(subnet_id, &peer_id, current_uid);
BootstrapPeerIdSubnetNode::<T>::insert(subnet_id, &bootstrap_peer_id, current_uid);
let classification: SubnetNodeClassification = SubnetNodeClassification {
class: SubnetNodeClass::Registered,
start_epoch: start_epoch,
};
let subnet_node: SubnetNode<T::AccountId> = SubnetNode {
id: current_uid,
hotkey: hotkey.clone(),
peer_id: peer_id.clone(),
bootstrap_peer_id: bootstrap_peer_id.clone(),
classification: classification,
delegate_reward_rate: delegate_reward_rate,
last_delegate_reward_rate_update: last_delegate_reward_rate_update,
a: a,
b: b,
c: c,
};
// Insert RegisteredSubnetNodesData
RegisteredSubnetNodesData::<T>::insert(subnet_id, current_uid, subnet_node);Deactivating
Inserted & Updated Storage
Reactivating
Inserted & Updated Storage
Note
Updating
Subnet Node Delegate Stake Rate
Call update_delegate_stake_rate to update the delegate stake rate
update_delegate_stake_rate to update the delegate stake rateLast updated