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

Discussion: differences in graphQL responses between Besu and Geth due to number encoding #1577

Closed
renaynay opened this issue Nov 17, 2020 · 5 comments

Comments

@renaynay
Copy link

The hive test suite GraphQL tests found inconsistencies in the responses between the besu and geth clients in the number encoding, where Geth returns hex for certain fields as opposed to Besu which returns number/float.

I've created a gist documenting the queries for which the responses of Geth and Besu differ due to different number encoding here. (The GraphQL test logs can also be viewed on our hive test run visualizer).

Geth uses hex strings because JSON numbers are often implemented as floats, which cannot reliably represent all possible 64-bit integers. It would be nice to have a discussion about this to see if Besu wants to potentially switch to using hex as well.

cc @fjl

@shemnon
Copy link
Contributor

shemnon commented Nov 17, 2020

Any change to GraphQL output would involve changing the spec and the schema - https://eips.ethereum.org/EIPS/eip-1767. Our GraphQL library strongly maps the types in the schema with it's output, and any change to the output requires a change in the schema.

@renaynay
Copy link
Author

Okay thank you for your response @shemnon , we are working on fixing some query responses to align better with the spec.

I noticed however that we're failing to serve a couple of queries on Account, but I do not see that queries on Account are defined in the spec. There was some discussion about it over a year ago in this thread: https://ethereum-magicians.org/t/graphql-interface-to-ethereum-node-data/2710/40 , but beyond that, I don't see that the spec has been formally updated to include queries on Account.

Do you have any further insights on this?

@atoulme
Copy link
Contributor

atoulme commented Dec 5, 2020

I had a chat with Danno:
-no need to move away from numbers, as most values are well within the valid range.
-hive should update tests to remove queries to Account, replacing them by querying for account in the latest or pending block.
-Besu will deprecate and remove the top level account query, with low priority.

@renaynay
Copy link
Author

renaynay commented Dec 8, 2020

Thanks @atoulme and @shemnon, will update hive to remove the queries on Account from the graphql tests.

@renaynay
Copy link
Author

renaynay commented Jan 6, 2021

Okay, closing this issue as geth has been working on getting spec-compliant. Thanks for your help @shemnon @atoulme

@renaynay renaynay closed this as completed Jan 6, 2021
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