InvalidChild

Error v195 → v202, v205 → v212, v216 → v216, v217 → v219, v233 → v315, v320 → v326, v334 → v377, v385 → v393, v401 → current 7.60

The child hotkey specified is not valid for this relationship.

Encountered by: validatorsdevelopers

Why This Error Exists

The child key system prevents circular references and self-referencing to maintain a clear authority hierarchy. A hotkey cannot be its own child, and chains like A->B->C->A are forbidden. This ensures weight-setting authority flows in one direction without loops.

Deep Dive

When you add a child key, the chain validates: 1) child != parent (no self-reference), 2) child doesn't already have parent as a descendant (no cycles), 3) child address is a valid hotkey format. ParentKeys storage lets you trace the authority chain upward from any hotkey.

Debugging Example

You call set_children(netuid=1, hotkey=5Parent..., children=[(5Parent..., 50%)]). Error: InvalidChild. You're trying to make a hotkey its own child. Solution: Use a different hotkey as the child. Generate a new hotkey if needed.

Prevention Tips

  • Never use the same address for parent and child
  • Before adding a child, query ParentKeys(child) to check its existing parent chain
  • Draw out your authority hierarchy to visualize and avoid cycles

From Chain Metadata

Attempting to set an invalid child for a hotkey on a network.

What This Means

The child hotkey specified is not valid for this relationship.

Common Causes

  • Child hotkey doesn't exist
  • Child would create circular relationship
  • Child is the same as parent

How to Fix

  • Verify the child hotkey address is correct
  • Ensure no circular parent-child relationships
  • Use a different hotkey as child

Storage to Check

Thrown By

Version History

v195 block 3,791,350 Added
v205 block 4,209,446 Shape modified
v216 block 4,510,996 Shape modified
v217 block 4,590,522 Shape modified
v233 block 4,920,350 Shape modified
v320 block 6,523,566 Shape modified
v334 block 6,811,690 Shape modified
v385 block 7,782,670 Shape modified
v401 block 8,036,576 Shape modified Current

Runtime Info

Pallet Index
7
Error Index
60
Error Code
7.60
Runtime Version
v411