anchor.diff:      end.
   
   -compile({nowarn_unused_function, {init_gossip_task_feeder, 3}}).
  --spec init_gossip_task_feeder(cb_module_name(), [1..50], state()) -> {cb_module_name(), list(), state()}.
  +-spec init_gossip_task_feeder(cb_module_id(), [1..50], state()) -> {cb_module_id(), list(), state()}.
   init_gossip_task_feeder(CBModule, Args, State) ->
       Args1 = if length(Args)>1 -> [hd(Args)];
                  true -> Args
  
positive.code: 
  
  %% checks the convergence of the current round (only called at leader)
  -spec is_end_of_round(CBModule::cb_module_name(), State::state()) -> boolean().
  is_end_of_round(CBModule, State) ->
      Cycles = state_get(cycles, CBModule, State),
      log:log(debug, "[ Gossip ] check_end_of_round. Cycles: ~w", [Cycles]),
  
negative.code: 
  %% @doc Sets the given value for the given key in the given state.
  %%      Allowed keys see state_get/3
  -spec state_set(Key::state_key_cb(), Value::any(), CBModule::cb_module_id(), State::state()) -> ok.
  state_set(Key, Value, CBModule, State) ->
      state_set({Key, CBModule}, Value, State).
  
  %% updates the state with the given function
  -spec state_update(Key::state_key_cb(), UpdateFun::fun(), CBModule::cb_module_id(), State::state()) -> ok.
  state_update(Key, Fun, CBModule, State) ->
      Value = apply(Fun, [state_get(Key, CBModule, State)]),
      state_set(Key, Value, CBModule, State).
  