jrwashburn/mina-pool-payout

Null report in case of transaction error earlier

Closed this issue · 6 comments

What happens

If sending coins ended in an error, recalculation for the same epoch return zero-table.

The screenshots show two attempts to send tokens

2024-01-10_18-43-32

The first one fails because there are not enough funds in the wallet

2024-01-10_18-46-25

The second one fails because the script does not find blocks in the same epoch at the same validator

How to reproduce this issue:

Try to send tokens from account without balance

Probable cause

list of paid blocks is written to src/data/.paidblocks before sending. This file is not editable in case of failure sending
(Maybe other data files are also affecting it.)

Can you show the full output from the first run? I think it should have written the files and then you can use the resend command.

first run

....

### Processing signed payout for hash 30502c8e2560eb5956b43f3e696d17c43082cea3...
------------------- Summary & Totals ------------------
Calculations based on entire pool
Net Coinbase Received: 4333.319486384
Total Amounts Due To Stakers / To Burn: 4040.415579296
Net MINA to Pool Operator (after send transaction fees): 292.886907088
Total Coin Base Generated: 4320
User Transaction Fees Generated (net of snark fees): 13.319486384
Total Snark Fees Paid From Coinbase: 0
Total Payout Transaction Fees: 0.017
------------------- Summary & Totals ------------------
wrote payout information to ./src/data/payout_transactions_20240110111954416_316124_319973.json
wrote payout information to ./src/data/payout_details_20240110111954416_316124_319973.json
wrote payout information to ./src/data/payout_summary_20240110111954435_316124_319973.json
#### Processing nonce 289...
ApolloError: Couldn't send user_command: ["Insufficient_funds"]
    at new ApolloError (/home/minauser/node75-pool-payout/node_modules/@apollo/client/errors/index.js:39:28)
    at /home/minauser/node75-pool-payout/node_modules/@apollo/client/core/QueryManager.js:122:47
    at both (/home/minauser/node75-pool-payout/node_modules/@apollo/client/utilities/observables/asyncMap.js:22:31)
    at /home/minauser/node75-pool-payout/node_modules/@apollo/client/utilities/observables/asyncMap.js:11:72
    at new Promise (<anonymous>)
    at Object.then (/home/minauser/node75-pool-payout/node_modules/@apollo/client/utilities/observables/asyncMap.js:11:24)
    at Object.next (/home/minauser/node75-pool-payout/node_modules/@apollo/client/utilities/observables/asyncMap.js:24:49)
    at notifySubscription (/home/minauser/node75-pool-payout/node_modules/zen-observable/lib/Observable.js:135:18)
    at onNotify (/home/minauser/node75-pool-payout/node_modules/zen-observable/lib/Observable.js:179:3)
    at SubscriptionObserver.next (/home/minauser/node75-pool-payout/node_modules/zen-observable/lib/Observable.js:235:7) {
  graphQLErrors: [
    {
      message: `Couldn't send user_command: ["Insufficient_funds"]`,
      path: [Array]
    }
  ],
  protocolErrors: [],
  clientErrors: [],
  networkError: null,
  extraInfo: undefined
}
*** ERROR SENDING TRANSACTIONS - STOPPED SENDING AT NONCE 289 ***
#### Processing nonce 290...
Generated gql file for nonce 290; not attempting to send transaction
#### Processing nonce 291...
Generated gql file for nonce 291; not attempting to send transaction
#### Processing nonce 292...
Generated gql file for nonce 292; not attempting to send transaction
#### Processing nonce 293...
Generated gql file for nonce 293; not attempting to send transaction
#### Processing nonce 294...
Generated gql file for nonce 294; not attempting to send transaction
#### Processing nonce 295...
Generated gql file for nonce 295; not attempting to send transaction
#### Processing nonce 296...
Generated gql file for nonce 296; not attempting to send transaction
#### Processing nonce 297...
Generated gql file for nonce 297; not attempting to send transaction
#### Processing nonce 298...
Generated gql file for nonce 298; not attempting to send transaction
#### Processing nonce 299...
Generated gql file for nonce 299; not attempting to send transaction
#### Processing nonce 300...
Generated gql file for nonce 300; not attempting to send transaction
#### Processing nonce 301...
Generated gql file for nonce 301; not attempting to send transaction
#### Processing nonce 302...
Generated gql file for nonce 302; not attempting to send transaction
#### Processing nonce 303...
Generated gql file for nonce 303; not attempting to send transaction
#### Processing nonce 304...
Generated gql file for nonce 304; not attempting to send transaction
#### Processing nonce 305...
Generated gql file for nonce 305; not attempting to send transaction

That looks good - the best way to handle is not to rerun the calculation, but to resend the transactions after the payout account is funded.

See Handling Failed Transmissions in the readme.

Please confirm that handles your issue, and we can close.

I will improve the output to point the operator to the Resender command. Will keep this open for that change.

That looks good - the best way to handle is not to rerun the calculation, but to resend the transactions after the payout account is funded.

See Handling Failed Transmissions in the readme.

Ok I missed that point in the readme.
I must have misunderstood the logic of interacting with the script.

But it may be worth adding a warning. In case of the second launch, information that payments have already been sent (tried to send) for the specified periods.

Thank you for this tool!