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

Refactor batch payer #639

Closed rvermootenct closed 1 year ago

rvermootenct commented 1 year ago

name: Pull Request about: Create a pull request to make a contribution labels:


IMPORTANT NOTICE: I read and understood the guidelines for contributions to the TRD. The contribution may qualify for being compensated by the TRD grant if approved by the maintainers.

Please be aware that the failing tests can be seen on master as well atm..

This PR resolves the issue 641. The following steps were performed:

Work effort: 20h

GIF TAX:

jdsika commented 1 year ago

I merged #623 in order to have a solution for the release.

dansan566 commented 1 year ago

Did a dry run, and got this:

Error, response ->Failed to parse the request body: Malformed value<-
2023-01-17 17:22:19,980 - consumer0 - ERROR - Error in run_operation
2023-01-17 17:22:19,980 - consumer0 - INFO - Payment to KT1XGnEMZYXJWKgwNCctGNzPYT7hXVSSMABe script could not be processed. Possible reason: liquidated contract. Skipping. Think about redirecting the payout to the owner address using the maps rules. Please refer to the TRD documentation or to one of the TRD maintainers.
2023-01-17 17:22:19,981 - consumer0 - ERROR - Error, request ->POST http://127.0.0.1:8732/chains/main/blocks/head/helpers/scripts/run_operation<-, params ->None<-,

Payouts to the address worked on the main branch, and the contract is not liquidated! https://tzkt.io/KT1XGnEMZYXJWKgwNCctGNzPYT7hXVSSMABe/operations/

I had this error on more than 30 addresses, all of them KT1... (smart contracts)

jdsika commented 1 year ago

@dansan566 ok thank you for the insight! retry failed payments on master and we will investigate

dansan566 commented 1 year ago

@jdsika, there are no failed payments if skipped!

jdsika commented 1 year ago

Did a dry run, and got this:

Error, response ->Failed to parse the request body: Malformed value<-
2023-01-17 17:22:19,980 - consumer0 - ERROR - Error in run_operation
2023-01-17 17:22:19,980 - consumer0 - INFO - Payment to KT1XGnEMZYXJWKgwNCctGNzPYT7hXVSSMABe script could not be processed. Possible reason: liquidated contract. Skipping. Think about redirecting the payout to the owner address using the maps rules. Please refer to the TRD documentation or to one of the TRD maintainers.
2023-01-17 17:22:19,981 - consumer0 - ERROR - Error, request ->POST http://127.0.0.1:8732/chains/main/blocks/head/helpers/scripts/run_operation<-, params ->None<-,

Payouts to the address worked on the main branch, and the contract is not liquidated! https://tzkt.io/KT1XGnEMZYXJWKgwNCctGNzPYT7hXVSSMABe/operations/

I had this error on more than 30 addresses, all of them KT1... (smart contracts)

Two issues.

rvermootenct commented 1 year ago

Diff of calculations on dry run mainnet between master and this branch: Screenshot 2023-01-20 at 13 08 42

Diff of payments on dry run mainnet between master and this branch

Screenshot 2023-01-20 at 13 11 21

NOTE: On the payments there is a diff but it is only the position of the entry, the entry itself is identical.

dansan566 commented 1 year ago

@jdsika I did a dry run on the branch, and it worked so the error has been fixed by @rvermootenct
The next payout will be on this one! My help with debugging: 1.5h

jdsika commented 1 year ago

Diff of calculations on dry run mainnet between master and this branch: Screenshot 2023-01-20 at 13 08 42

Diff of payments on dry run mainnet between master and this branch

Screenshot 2023-01-20 at 13 11 21

NOTE: On the payments there is a diff but it is only the position of the entry, the entry itself is identical.

Please create a follow up ticket why the heck those sortings are non-deterministic. This is killing my test engineering soul

nicolasochem commented 1 year ago

:fire: :fire:

nicolasochem commented 1 year ago

You know what else is "unmanageable" (per #641)? The producer/consumer pattern. See points made in https://github.com/tezos-reward-distributor-organization/tezos-reward-distributor/issues/491

TRD would be so much simpler if it was doing what it needs to do in order, without a central "bus" of tasks.