dcrpool icon indicating copy to clipboard operation
dcrpool copied to clipboard

Maximum rounding error exceeded

Open jholdstock opened this issue 1 year ago • 0 comments

User @sebitt27 reported the following error from their pool https://decred.miningandco.com/

2023-10-29 09:56:03.440 [ERR] POOL: unable to process payments: generatePayoutTxDetails: difference between total output values and the provided inputs (0.00000569 DCR) exceeds the maximum allowed for rounding errors (0.000005 DCR)

They mentioned the pool has >=500 clients. I have identified the following as a potential cause of the issue:

https://github.com/decred/dcrpool/blob/794bb7b1959142a7364a489678ca31bbbc5ad8d3/pool/paymentmgr.go#L276-L280

When calculating reward payments, any rounding errors are always resolved by reducing the payment by one atom. Hundreds of clients can cause this -1 to be triggered hundreds of times, leading too a huge rounding error which exceeds the hard-coded maximum.

jholdstock avatar Nov 13 '23 15:11 jholdstock