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

graphql: encode Long values as hex #26894

Merged
merged 1 commit into from
Apr 25, 2023
Merged

graphql: encode Long values as hex #26894

merged 1 commit into from
Apr 25, 2023

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Mar 15, 2023

Breaking-change All number fields (Big, or Long) will be hex-formatted for consistency.

We had inconsistent formatting for outputs of Long fields. Some returned decimal numbers while others returned hex-encoded string. They were initially all hex-encoded and later some but not all were converted to Long: #21883. This prompted #26118.

I think we should move back to hex-encoding when returning longs and have created a PR to disambiguate formatting of Long fields in the spec: ethereum/execution-apis#389. Inputs are now more flexible and will take decimal or string. String can be hex or decimal encoded. This will succeed #26730.

@s1na s1na requested a review from gballet as a code owner March 15, 2023 12:13
@holiman
Copy link
Contributor

holiman commented Mar 22, 2023

Is this ready or waiting for some spec-change or something?

@s1na
Copy link
Contributor Author

s1na commented Mar 23, 2023

Yes it's pending on ethereum/execution-apis#389

@fjl fjl changed the title graphql: consistent rule for Long field and args graphql: encode Long values as hex Apr 25, 2023
@fjl fjl added this to the 1.11.7 milestone Apr 25, 2023
@fjl fjl merged commit 2f98dd3 into ethereum:master Apr 25, 2023
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
This is a breaking GraphQL API change. All numeric values are now encoded as
hex strings. The motivation for this change is matching JSON-RPC outputs more
closely.

Numbers in query parameters are accepted as both decimal integers and hex strings.
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
This is a breaking GraphQL API change. All numeric values are now encoded as
hex strings. The motivation for this change is matching JSON-RPC outputs more
closely.

Numbers in query parameters are accepted as both decimal integers and hex strings.
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
This pull request was closed.
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

Successfully merging this pull request may close these issues.

3 participants