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

Precision loss in JSON RPC due to using float #1558

Closed
medvedev1088 opened this issue Dec 24, 2018 · 10 comments
Closed

Precision loss in JSON RPC due to using float #1558

medvedev1088 opened this issue Dec 24, 2018 · 10 comments

Comments

@medvedev1088
Copy link

medvedev1088 commented Dec 24, 2018

Some transactions show negative fee because JSON RPC returns wrong value https://dogechain.info/tx/fddfe44a58de2432979e6ca340b2e0bffeebb3704edcf87f689bc057f6e5f358
84,841,299.38699999 is supposed to be 84,841,299.38700000

@langerhans
Copy link
Member

On which Dogecoin Core version did you test this? Does this also happen on 1.14?

@medvedev1088
Copy link
Author

I used 1.10 but will try 1.14. Was it fixed in 1.14?

@langerhans
Copy link
Member

There have been so many changes in 1.14 I can't tell for sure but it might have been fixed there 😅

@rnicoll
Copy link
Contributor

rnicoll commented Dec 25, 2018

I'm trying to build a reproduction case, but have to admit normally I process transactions by taking the whole raw block off the client and then processing it in code, rather than than querying transactions individually. Mostly it's a lot faster, but also avoids issues like this.

I suspect we have the same precision behavior as Bitcoin Core, but because our transaction values are much larger, floating point precision issues only show up in Dogecoin Core. Will check.

@medvedev1088
Copy link
Author

medvedev1088 commented Dec 25, 2018

@medvedev1088
Copy link
Author

medvedev1088 commented Jan 14, 2019

Any ETA for when it will be fixed? We're building datasets in BigQuery which among others will include Dogecoin data, similar to this. It would be nice if I could still rely on JSON RPC instead of parsing raw transactions.

@langerhans
Copy link
Member

You said you're going to try 1.14, did you? If it still happens there we can look into fixing it there.

@medvedev1088
Copy link
Author

medvedev1088 commented Jan 14, 2019

Sorry I didn't have a chance to verify it on 1.14. Was pretty confident it'd reproduce there since the fix of the analogous issue from Bitcoin bitcoin/bitcoin#6239 isn't merged to Dogecoin master. Will report here as soon as I have a chance to verify it.

@medvedev1088
Copy link
Author

Amazing, it's not reproduced in 1.14.2. Could you point to the commit where it was fixed?

@rnicoll
Copy link
Contributor

rnicoll commented Jan 16, 2019

1.14 was completely rebuilt based on Bitcoin Core 0.14, so it will have been from the Bitcoin code we've used as the base.

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

3 participants