anchor.diff:  
   -define(RPCS(Tree), {rpcs, Tree}).
   -define(REPLAY(Tree), {replay, Tree}).
  +-define(DEDUP(Tree), {dedup, Tree}).
   
   -type(rpcs() :: ?RPCS(gb_tree())).
   -type(replay() :: ?REPLAY(gb_tree())).
  +
  +-define(SETS, sets).
  +-type(dedup() :: ?DEDUP(set())).
   
   -record(state, {
             connect_args = undefined :: {
  
positive.code:           parse_fun :: erlmqtt_framing:parse(),
            rpcs = empty_rpcs() :: rpcs(),
            replay = empty_replay() :: replay(),
            id_counter = 1 :: pos_integer(),
            receiver :: pid(),
            receiver_monitor :: reference(),
  
negative.code:     ?OPENED(S0#state{ replay = Replay1 });
  
  %% This is step three of exactly once; we receive it if we send pubrec
  %% to acknowledge a publish with QoS = exactly_once. Once we've seen
  %% this frame, we no longer have to remember the message for
  %% deduplication.
  %%
  %% These frames might get resent, but the pubcomp must be sent in any
  %% case (since that will stop the sender sending pubrel).
  opened({frame, #pubrel{ message_id = Id }}, S0) ->
      #state{ dedup = Dedup } = S0,
      Dedup1 = remove_from_dedup(Id, Dedup),
      write(S0, #pubcomp{ message_id = Id }),
      ?OPENED(S0#state{ dedup = Dedup1 });
  
  %% These two ff frames end a "guaranteed delivery" exchange.
  opened({frame, #puback{ message_id = Id }}, S0) ->
  