code: func (t *Tr) commit() []*Payload {
  	items := make([]*Payload, 0, len(t.context.seenNodes))
  	for _, n := range t.context.seenNodes {
  		n.ChildValues, n.ChildKeys = n.flatten()
  		buf, err := n.MarshalMsg(nil)
  		if err != nil {
  			panic(`unable to encode node`)
  		}
  
  		n.ChildValues, n.ChildKeys = nil, nil
  		item := &Payload{n.ID, buf}
  		items = append(items, item)
  	}
  
  	return items
  }
docs: // commit will gather up all created nodes and serialize them into
  // items that can be persisted.