InvalidChild

Error Re-added v195 → v202, v205 → v212, v216 → v216, v217 → v219, v233 → v315, v320 → v326, v334 → v377, v385 → current 7.59

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 Re-added
v216 block 4,510,996 Re-added
v217 block 4,590,522 Re-added
v233 block 4,920,350 Re-added
v320 block 6,523,566 Re-added
v334 block 6,811,690 Re-added
v385 block 7,782,670 Re-added Current

Runtime Info

Pallet Index
7
Error Index
59
Error Code
7.59
Runtime Version
v393