anchor.diff:          SyncItemCount::non_neg_integer(), LeafNodesAcc::non_neg_integer())
           -> NewStats::Stats
       when is_subtype(Stats, rr_recon_stats:stats()).
  -merkle_resolve_leaves_init([{inner, leaf, SigSize, LeafNodes0} | TL], Hashes,
  +merkle_resolve_leaves_init([{leaf, leaf, SigSize, LeafNode} | TL], Hashes,
                              DestRRPid, DestRCPid, Stats, OwnerL, Interval,
                              ToSend, ToReq, ToResolve, ResolveNonEmpty, SyncItemCount, LeafNAcc) ->
  -    <<X:SigSize, HashesT/bitstring>> = Hashes,
  -    LeafNodes = merkle_get_sync_leaves(LeafNodes0, X, SigSize, []),
  -    {NInterval, NSyncItemCount, NLeafNAcc} =
  -        lists:foldl(fun(N, {AccI, AccItems, LeafNAccX}) ->
  -                            ?ASSERT(merkle_tree:is_leaf(N)),
  -                            {intervals:union(AccI, merkle_tree:get_interval(N)),
  -                             AccItems + merkle_tree:get_item_count(N),
  -                             LeafNAccX + 1}
  -                    end, {Interval, SyncItemCount, LeafNAcc}, LeafNodes),
  -    merkle_resolve_leaves_init(TL, HashesT, DestRRPid, DestRCPid, Stats, OwnerL,
  -                               NInterval, ToSend, ToReq, ToResolve, ResolveNonEmpty,
  -                               NSyncItemCount, NLeafNAcc);
  -merkle_resolve_leaves_init([{leaf, leaf, SigSize0, LeafNode} | TL],
  +    % same handling as below -> simply convert:
  +    merkle_resolve_leaves_init(
  +      [{inner, leaf, SigSize, [LeafNode]} | TL], Hashes,
  +      DestRRPid, DestRCPid, Stats, OwnerL, Interval,
  +      ToSend, ToReq, ToResolve, ResolveNonEmpty, SyncItemCount, LeafNAcc);
  +merkle_resolve_leaves_init([{inner, leaf, SigSize0, LeafNodes} | TL],
                              <<BSize:8/integer-unit:1, HashesT/bitstring>>,
                              DestRRPid, DestRCPid, Stats, OwnerL, Interval,
                              ToSend, ToReq, ToResolve, ResolveNonEmpty, SyncItemCount, LeafNAcc) ->
  -    ?ASSERT(merkle_tree:is_leaf(_LeafNode)),
       {SigSize, VSize} = align_bitsize(SigSize0, get_min_version_bits()),
       OBucketBinSize = BSize * (SigSize + VSize),
       <<OBucketBin:OBucketBinSize/bitstring, NHashes/bitstring>> = HashesT,
       OBucketTree = decompress_kv_list(OBucketBin, gb_trees:empty(), SigSize, VSize),
  +
  +    {MyBuckets, NSyncItemCount, NLeafNAcc} =
  +        lists:foldl(fun(N, {AccBuckets, AccItems, LeafNAccX}) ->
  +                            ?ASSERT(merkle_tree:is_leaf(N)),
  +                            {lists:append(merkle_tree:get_bucket(N), AccBuckets),
  +                             AccItems + merkle_tree:get_item_count(N),
  +                             LeafNAccX + 1}
  +                    end, {[], SyncItemCount, LeafNAcc}, LeafNodes),
       {ToSend1, ToReq1, OBucketTree1} =
  -        get_full_diff(merkle_tree:get_bucket(LeafNode), OBucketTree,
  -                      ToSend, ToReq, SigSize, VSize),
  +        get_full_diff(MyBuckets, OBucketTree, ToSend, ToReq, SigSize, VSize),
       ToResolve1 = [gb_trees:keys(OBucketTree1) | ToResolve],
       ResolveNonEmpty1 = ?IIF(gb_trees:size(OBucketTree1) =/= 0, true, ResolveNonEmpty),
  -    NSyncItemCount = SyncItemCount + merkle_tree:get_item_count(LeafNode),
   
       merkle_resolve_leaves_init(TL, NHashes, DestRRPid, DestRCPid, Stats, OwnerL,
                                  Interval, ToSend1, ToReq1, ToResolve1, ResolveNonEmpty1,
  -                               NSyncItemCount, LeafNAcc + 1);
  +                               NSyncItemCount, NLeafNAcc);
   merkle_resolve_leaves_init([{leaf, inner, _SigSize, LeafNode} | TL], Hashes,
                              DestRRPid, DestRCPid, Stats, OwnerL, Interval,
                              ToSend, ToReq, ToResolve, ResolveNonEmpty, SyncItemCount, LeafNAcc) ->
  
positive.code:         Stats, OwnerL::comm:erl_local_pid(), SendKeysAcc::[?RT:key()])
          -> NewStats::Stats
      when is_subtype(Stats, rr_recon_stats:stats()).
  merkle_resolve_req_keys_noninit([{leaf, leaf, _SigSize, _LeafNode} | TL],
                          [[] | BinKeyList],
                          DestRRPid, Stats, OwnerL, SendKeys) ->
      merkle_resolve_req_keys_noninit(TL, BinKeyList, DestRRPid, Stats, OwnerL,
                                      SendKeys);
  merkle_resolve_req_keys_noninit([{leaf, leaf, SigSize0, LeafNode} | TL],
                          [[_|_] = ReqKeys | BinKeyList],
                          DestRRPid, Stats, OwnerL, SendKeys) ->
      ReqSet = gb_sets:from_list(ReqKeys),
      {SigSize, _VSize} = align_bitsize(SigSize0, get_min_version_bits()),
      SendKeys1 = [Key || {Key, _Version} <- merkle_tree:get_bucket(LeafNode),
  
negative.code:         LeafNodesAcc::non_neg_integer())
          -> {Hashes::bitstring(), ResolveRequests::0..1,
              LeafNodes::non_neg_integer()}.
  merkle_resolve_leaves_noninit([{inner, leaf, _SigSize, LeafNodes} | TL], Bin,
                                Dest, SID, OwnerL, Interval, Items, LeafNAcc)
    when is_list(LeafNodes) ->
  