anchor.diff:  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % type definitions
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  --export_type([method/0, request/0,
  -              db_chunk_kv/0, db_chunk_kvv/0]).
  +-export_type([method/0, request/0]).
   
   -type method()         :: trivial | shash | bloom | merkle_tree | art.% | iblt.
   -type stage()          :: req_shared_interval | build_struct | reconciliation | resolve.
  
positive.code: %%      or the entry in MyEntries has a newer version than the one in the tree
  %%      and returns them as FBItems. ReqItems contains items in the tree but
  %%      where the version in MyEntries is older than the one in the tree.
  -spec get_full_diff
          (MyEntries::[], MyIOtherKvTree::kvi_tree(),
           AccFBItems::FBItems, AccReqItems::[non_neg_integer()],
           SigSize::signature_size(), VSize::signature_size())
          -> {FBItems::FBItems, ReqItemsIdx::[non_neg_integer()], MyIOtherKvTree::kvi_tree()}
              when is_subtype(FBItems, rr_resolve:kvv_list() | [?RT:key()]);
          (MyEntries::'db_chunk_kvv+'(), MyIOtherKvTree::kvi_tree(),
           AccFBItems::rr_resolve:kvv_list(), AccReqItems::[non_neg_integer()],
           SigSize::signature_size(), VSize::signature_size())
          -> {FBItems::rr_resolve:kvv_list(), ReqItemsIdx::[non_neg_integer()], MyIOtherKvTree::kvi_tree()};
          (MyEntries::'db_chunk_kv+'(), MyIOtherKvTree::kvi_tree(),
           AccFBItems::[?RT:key()], AccReqItems::[non_neg_integer()],
           SigSize::signature_size(), VSize::signature_size())
          -> {FBItems::[?RT:key()], ReqItemsIdx::[non_neg_integer()], MyIOtherKvTree::kvi_tree()}.
  get_full_diff(MyEntries, MyIOtKvTree, FBItems, ReqItemsIdx, SigSize, VSize) ->
      get_full_diff_(MyEntries, MyIOtKvTree, FBItems, ReqItemsIdx, SigSize,
                    util:pow(2, VSize)).
  
  %% @doc Helper for get_full_diff/6.
  -spec get_full_diff_
          (MyEntries::[], MyIOtherKvTree::kvi_tree(),
           AccFBItems::FBItems, AccReqItems::[non_neg_integer()],
           SigSize::signature_size(), VMod::pos_integer())
          -> {FBItems::FBItems, ReqItemsIdx::[non_neg_integer()], MyIOtherKvTree::kvi_tree()}
              when is_subtype(FBItems, rr_resolve:kvv_list() | [?RT:key()]);
          (MyEntries::'db_chunk_kvv+'(), MyIOtherKvTree::kvi_tree(),
           AccFBItems::rr_resolve:kvv_list(), AccReqItems::[non_neg_integer()],
           SigSize::signature_size(), VMod::pos_integer())
          -> {FBItems::rr_resolve:kvv_list(), ReqItemsIdx::[non_neg_integer()], MyIOtherKvTree::kvi_tree()};
          (MyEntries::'db_chunk_kv+'(), MyIOtherKvTree::kvi_tree(),
           AccFBItems::[?RT:key()], AccReqItems::[non_neg_integer()],
           SigSize::signature_size(), VMod::pos_integer())
          -> {FBItems::[?RT:key()], ReqItemsIdx::[non_neg_integer()], MyIOtherKvTree::kvi_tree()}.
  get_full_diff_([], MyIOtKvTree, FBItems, ReqItemsIdx, _SigSize, _VMod) ->
      {FBItems, ReqItemsIdx, MyIOtKvTree};
  get_full_diff_([Tpl | Rest], MyIOtKvTree, FBItems, ReqItemsIdx, SigSize, VMod) ->
      Key = element(1, Tpl),
      Version = element(2, Tpl),
      TplSize = tuple_size(Tpl),
      {KeyBin, VersionShort} = compress_kv_pair(Key, Version, SigSize, VMod),
      case gb_trees:lookup(KeyBin, MyIOtKvTree) of
          none when TplSize =:= 3 ->
              Value = element(3, Tpl),
              get_full_diff_(Rest, MyIOtKvTree, [{Key, Value, Version} | FBItems],
                             ReqItemsIdx, SigSize, VMod);
          none when TplSize =:= 2 ->
              get_full_diff_(Rest, MyIOtKvTree, [Key | FBItems],
                             ReqItemsIdx, SigSize, VMod);
          {value, {OtherVersionShort, Idx}} ->
              MyIOtKvTree2 = gb_trees:delete(KeyBin, MyIOtKvTree),
              if VersionShort > OtherVersionShort andalso TplSize =:= 3 ->
                     Value = element(3, Tpl),
                     get_full_diff_(Rest, MyIOtKvTree2, [{Key, Value, Version} | FBItems],
                                    ReqItemsIdx, SigSize, VMod);
                 VersionShort > OtherVersionShort andalso TplSize =:= 2 ->
                     get_full_diff_(Rest, MyIOtKvTree2, [Key | FBItems],
                                    ReqItemsIdx, SigSize, VMod);
                 VersionShort =:= OtherVersionShort ->
  
negative.code:             P1E_p1 = trivial_worst_case_failprob(SigSize, OrigDBChunkLen, OrigDBChunkLen),
              ?DBG_ASSERT(Misc =:= []),
              Misc1 = [{db_chunk, DBChunkSet},
                       {oicount, OrigDBChunkLen}];
          bloom ->
              #bloom_recon_struct{interval = MySyncI,
                                  reconPid = DestReconPid,
  