Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum rounding error exceeded #425

Open
jholdstock opened this issue Nov 13, 2023 · 0 comments
Open

Maximum rounding error exceeded #425

jholdstock opened this issue Nov 13, 2023 · 0 comments

Comments

@jholdstock
Copy link
Member

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:

dcrpool/pool/paymentmgr.go

Lines 276 to 280 in 794bb7b

// Reduce the amount by an atom if float conversion accuracy was
// above the actual value.
if accuracy > 0 {
amt -= dcrutil.Amount(1)
}

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant