Activate
Subnet nodes can activate themselves after the queue period, up to the grace epochs. Nodes cannot activate themselves before or after this period. If a node fails to activate itself within the allowed timeframe, the node must remove itself to reregister again.
Call activate_subnet_node
to activate
activate_subnet_node
to activatepub fn activate_subnet_node(
origin: OriginFor<T>,
subnet_id: u32,
subnet_node_id: u32,
)
Inserted & Updated Storage
// Remove RegisteredSubnetNodesData
let mut subnet_node = RegisteredSubnetNodesData::<T>::take(subnet_id, subnet_node_id);
// Insert into active nodes
SubnetNodesData::<T>::insert(subnet_id, subnet_node.id, subnet_node);
// Increase active nodes count
TotalSubnetNodes::<T>::mutate(subnet_id, |n: &mut u32| *n += 1);
Once registered, the node is given the Idle classification and will stay in this classification for the length of the subnet's idle classification epochs (IdleClassificationEpochs
). The node is upgraded to the Included classification after the idle classification epochs automatically if the subnet achieves a greater than 66% attestation ratio; otherwise, it will be upgraded on the next successful epoch.
Full Node Slots
If a subnet's node slots are full and the subnet has a node removal policy, the activating node can either replace one of the nodes or be pushed back into the queue.
Note
To be pushed back into the queue in a full subnet, you must call activate_subnet_node
in the period the node can activate, otherwise you will no longer be able to activate.
Last updated