DuplicateChild

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

The same child hotkey appears multiple times in the list.

Encountered by: validatorsdevelopers

Why This Error Exists

Each child key can only appear once in a parent's child list. This prevents ambiguous weight allocations - if the same child appeared twice with different percentages, the system wouldn't know which to use. The chain enforces uniqueness to maintain clear, deterministic stake/weight distribution.

Deep Dive

The children array in set_children contains (child_hotkey, proportion) tuples. The chain deduplicates by hotkey - if the same hotkey appears twice, you get this error regardless of whether the proportions match. The total of all proportions should equal 100% (or u16::MAX in basis points).

Debugging Example

You call set_children(netuid=1, hotkey=5Parent..., children=[(5Child1..., 25%), (5Child2..., 25%), (5Child1..., 50%)]). Error: DuplicateChild. 5Child1... appears twice (positions 0 and 2). Solution: Remove the duplicate. Use [(5Child1..., 75%), (5Child2..., 25%)] to give Child1 combined 75%.

Prevention Tips

  • Deduplicate your children array before calling set_children
  • Use a Set or dictionary to build the children list, keyed by hotkey
  • If you need to change a child's proportion, update the single entry instead of adding another

From Chain Metadata

Duplicate child when setting children.

What This Means

The same child hotkey appears multiple times in the list.

Common Causes

  • Accidentally included same child twice
  • Copy-paste error in child array

How to Fix

  • Remove duplicate entries from children array
  • Each child should appear only once

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
60
Error Code
7.60
Runtime Version
v393