Node Removal Policy

Each subnet can have a customizable logical expression system for removing nodes via a node removal policy when a subnet's node slots are full.

Customizable Logical Expression System

A tree-based logic system where node removal conditions are expressed as composable Boolean logic expressions (AND, OR, XOR, NOT) over measurable properties (e.g., score, attestation rate, stake). This allows subnets to define dynamic, fine-grained removal policies using declarative logic.

Conditions

The following are the condition options for how a node is qualified to be removed. Each option is fully customizable alongside the other options using AND, OR, XOR, and NOT.

HardBelowScore

If below the reputation score (see Reputation).

HardBelowAverageAttestation

If below the average attestation (see Reputation).

HardBelowNodeDelegateStakeRate

If below node delegate stake rate (see subnet node section)

DeltaBelowScore

If below the delta score percentage of the activating node (see Reputation). i.e., if the DeltaBelowScore is 10% and the activating node has a score of 100; nodes with a score under 90 will qualify.

DeltaBelowAverageAttestation

If below the delta percentage average attestation ratio of the activating node (see Reputation). i.e., if the DeltaBelowAverageAttestation is 10% and the activating node has an average attestation ratio of 90%, nodes with a score under 81% will qualify.

DeltaBelowNodeDelegateStakeRate

If below the delta node delegate stake rate percentage of the activating node. i.e., if the DeltaBelowNodeDelegateStakeRate is 50% and the activating node has a delegate stake rate of 20%; all nodes with a delegate stake rate under 10% will qualify.

DeltaBelowNodeDelegateStakeBalance

If below the delta delegate stake balance percentage of the activating node. i.e., if the DeltaBelowNodeDelegateStakeBalance is 10% and the activating node has 10,000 TENSOR delegate staked to it by the community; all nodes with a delegate stake balance under 9,000 will qualify.

DeltaBelowStakeBalance

This works if the subnet is set to allow a range of stake between a minimum and maximum balance.

If below the delta delegate stake balance percentage of the activating node. i.e., if the DeltaBelowStakeBalance is 10% and the activating node has 1000 TENSOR staked, all nodes with a delegate stake balance under 900 will qualify.


Getting Started

This creates a policy where any nodes that qualify to be removed must be > 20% below the activating nodes' score, AND 10% below the activating nodes' delegate stake balance.

let removal_policy = NodeRemovalPolicy {
    logic: LogicExpr::And(
        Box::new(LogicExpr::Condition(NodeRemovalConditionType::DeltaBelowScore(200000000000000000))),
        Box::new(LogicExpr::Condition(NodeRemovalConditionType::DeltaBelowNodeDelegateStakeBalance(100000000000000000))),
    )
};

NodeRemovalSystemV2::<Test>::insert(subnet_id, removal_policy);

Tie Breakers

The lowest-reputation score of all qualified removable nodes will be removed. The tiebreaker is the start epoch of the nodes, with the node with the newest start epoch being removed first.

Last updated