tezos-reward-distributor-organization / tezos-reward-distributor

Tezos Reward Distributor (TRD): A reward distribution software for tezos bakers.
https://tezos-reward-distributor-organization.github.io/tezos-reward-distributor/
GNU General Public License v3.0
87 stars 51 forks source link

Loop stuck when baker not active in payment cycle #616

Closed redref closed 1 month ago

redref commented 2 years ago

Describe the bug TRD tries to compute on payment cycle, but get stuck on this cycle if baker was not active (no delegators, no rewards) for this cycle.

To Reproduce

  1. Bootstrap a new baker address
  2. Start TRD
  3. TRD should be stuck at payment cycle (current - 3 - X)

Expected behavior Payment computations should proceed to next cycle in this case.

Screenshots

2022-09-02 13:31:46,773 - producer  - ERROR - [try_to_pay] API provider error Max sequent calls number exceeded (256)
2022-09-02 13:31:46,774 - producer  - ERROR - tzkt error at payment producer loop: 'Max sequent calls number exceeded (256)', will try again.

Environment

Additional context I have pinpointed issue to the TZKT api response NO_CONTENT treatment. https://github.com/tezos-reward-distributor-organization/tezos-reward-distributor/blob/master/src/tzkt/tzkt_api.py#L89 https://github.com/tezos-reward-distributor-organization/tezos-reward-distributor/blob/master/src/tzkt/tzkt_api.py#L194

It seems TZKT return 204 in this case (no delegators, no rewards) for this cycle. This is processed as a request error, and looping indefinitely on this cycle as a result.