anchor.diff:              {true, null}
       end.
   
  -%(prbr_bottom, _WriteFilter, _Next) ->
  -%            {false, lease_does_not_exist};
  -
  -
  -%-spec is_valid_handover(non_neg_integer(), non_neg_integer()) ->
  -%    fun ((any(), any(), any()) -> {boolean(), null}). %% content check
  -%is_valid_handover(Epoch, Version) ->
  -%    fun (Current, _WriteFilter, Next) ->
  -%            Res = standard_check(Current, Next, Epoch, Version)
  -%            %% checks for debugging
  -%                andalso (Current#lease.epoch+1 == Next#lease.epoch)
  -%                andalso (Current#lease.owner == comm:make_global(pid_groups:get_my(dht_node)))
  -%                andalso (Current#lease.owner =/= Next#lease.owner)
  -%                andalso (Current#lease.range == Next#lease.range)
  -%                andalso (Current#lease.aux == Next#lease.aux)
  -%                andalso (Current#lease.timeout < Next#lease.timeout)
  -%                andalso (os:timestamp() <  Next#lease.timeout),
  -%            {Res, null}
  -%    end.
  -
   -spec is_valid_split_step1() ->
       fun ((any(), any(), any()) -> {boolean(), split_step1_failed_reason() | null}). %% content check
   is_valid_split_step1() ->
  
positive.code:                                | unexpected_version
                                 | timeout_is_not_newer_than_current_lease.
  
  %-type renewal_failed_reason() :: lease_does_not_exist
  %                               | unexpected_owner
  %                               | unexpected_aux
  %                               | unexpected_range
  %                               | unexpected_epoch
  %                               | unexpected_version
  %                               | timeout_is_not_newer_than_current_lease.
  
  -type update_failed_reason() :: lease_does_not_exist
                                | epoch_or_version_mismatch.
  
  -type split_step1_failed_reason() :: lease_already_exists.
  %-type split_step2_failed_reason() :: lease_does_not_exist
  %                                   | epoch_or_version_mismatch
  %                                   | owner_changed
  %                                   | range_unchanged
  %                                   | aux_unchanged
  %                                   | timeout_is_not_newer_than_current_lease
  %                                   | timeout_is_not_in_the_future.
  %
  %-type split_step3_failed_reason() :: lease_does_not_exist
  %                                   | epoch_or_version_mismatch
  %                                   | owner_changed
  %                                   | range_changed
  %                                   | aux_unchanged
  %                                   | timeout_is_not_newer_than_current_lease
  %                                   | timeout_is_not_in_the_future.
  %
  %-type split_step4_failed_reason() :: lease_does_not_exist
  %                                   | epoch_or_version_mismatch
  %                                   | owner_changed
  %                                   | range_changed
  %                                   | aux_unchanged
  %                                   | timeout_is_not_newer_than_current_lease
  %                                   | timeout_is_not_in_the_future.
  
  -spec delta() -> pos_integer().
  delta() -> 10.
  
negative.code:             {true, null}
      end.
  
  -spec is_valid_update(non_neg_integer(), non_neg_integer()) ->
      fun ((any(), any(), any()) -> {boolean(), update_failed_reason() | null}). %% content check
  is_valid_update(CurrentEpoch, CurrentVersion) ->
  