anchor.diff:      lists:usort(lists:flatten(AllDiff)).
   
   % @doc Return the number of partitions in this Riak ring.
  -% @spec num_partitions(State :: hstate()) -> integer()
  +% @spec num_partitions(State :: chstate()) -> integer()
   num_partitions(State) ->
  -    chash:size(State#hstate.ring).
  +    chash:size(State#chstate.chring).
   
   % @doc For a given object key, produce the ordered list of
   %      {partition,node} pairs that could be responsible for that object.
  -% @spec preflist(Key :: binary(), State :: hstate()) ->
  +% @spec preflist(Key :: binary(), State :: chstate()) ->
   %                                 [{Index :: integer(), Node :: term()}]
   preflist(Key, State) ->
  -    chash:successors(Key, State#hstate.ring).
  +    chash:successors(Key, State#chstate.chring).
   
   filtered_preflist(Key, State, N) ->
       Preflist = preflist(Key, State),
  
positive.code:     
  
  % @doc Return a value from the cluster metadata dict
  % @spec get_meta(Key :: term(), State :: hstate()) -> 
  %    {ok, term()} | error | undefined
  get_meta(Key, State) -> 
      case dict:find(Key, State#hstate.meta) of
          error -> undefined;
          {ok, M} -> {ok, M#meta_entry.value}
      end.
  
                  
  % @doc Set a key in the cluster metadata dict
  % @spec update_meta(Key :: term(), Val :: term(), State :: hstate()) ->
  %     State :: hstate() | error
  update_meta(Key, Val, State) ->
      M = #meta_entry { 
          lastmod = calendar:datetime_to_gregorian_seconds(calendar:universal_time()),
          value = Val
      },    
      VClock = vclock:increment(State#hstate.nodename, State#hstate.vclock),
      State#hstate{vclock=VClock, meta=dict:store(Key, M, State#hstate.meta)}.
  
  
  sequence_test() ->
      I1 = 365375409332725729550921208179070754913983135744,
      I2 = 730750818665451459101842416358141509827966271488,
      A = fresh(4,a),
      B1 = A#hstate{nodename=b},
      B2 = transfer_node(I1, b, B1),
      ?assertEqual(B2, transfer_node(I1, b, B2)),
      {new_ring, A1} = reconcile(B1,A),
      C1 = A#hstate{nodename=c},
      C2 = transfer_node(I1, c, C1),
      {new_ring, A2} = reconcile(C2,A1),
      {new_ring, A3} = reconcile(B2,A2),
  
negative.code: 
  % @doc riak_ring manages a riak node's local view of partition
  %      ownership.  The functions in this module revolve around use
  %      of the chstate record, which should be treated as opaque by
  %      other modules.  Riak nodes exchange instances of
  %      these records via gossip in order to converge on a common
  %      view of node/partition ownership.
  