       (->>
         {:data/type data-type
          ::height height
-         ::keys (vec (drop 1 child-keys))
+         ::keys (vec (rest child-keys))
          ::children new-children
          ::record/count record-count
          ::record/first-key (first child-keys)

  `:merkle-db.data/families`. Returns an updated persisted root node if any
  records remain in the tree."
  [store params root changes]
  (if (nil? root)
    ; Empty tree.
    (->> changes
         (part/partition-records store params)
         (from-partitions store params))
    ; Check root node type.
    (condp = (:data/type root)
      part/data-type
        (if (seq changes)
          (some->>
            (part/update-root! store params root changes)
            (from-partitions store params))
          root)
      data-type
        (letfn [(store!  ; TODO: factor out?
                  [node]
                  (if (mdag/link? node)
                    node
                    (->> (::children node)
                         (map store!)
                         (relink-children)
                         (assoc node ::children)
                         (mdag/store-node! store nil)
                         (::node/data))))]
          (store! (update-index-node store params nil [root changes])))
      (throw (ex-info (str "Unsupported index-tree node type: "
                           (pr-str (:data/type root)))
                      {:data/type (:data/type root)})))))

  "Rewrite a vector of childen into numbered links."
  [children]
  (into []
        (map-indexed #(mdag/link (format "%03d" %1) %2))
        children))


