ethclient: Fix eth_getBlockReceipts call when using block numbers or labels#28358
Merged
holiman merged 2 commits intoethereum:masterfrom Oct 25, 2023
Merged
ethclient: Fix eth_getBlockReceipts call when using block numbers or labels#28358holiman merged 2 commits intoethereum:masterfrom
holiman merged 2 commits intoethereum:masterfrom
Conversation
…labels The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
MariusVanDerWijden
approved these changes
Oct 17, 2023
holiman
reviewed
Oct 17, 2023
holiman
reviewed
Oct 17, 2023
holiman
reviewed
Oct 17, 2023
holiman
reviewed
Oct 17, 2023
holiman
reviewed
Oct 17, 2023
Contributor
Author
|
Happy to apply those changes to the test once the run of morning meetings is over, but worth noting that I just copied the test above it so it currently matches the style of testing used through that file. Do you want to make these style changes to all tests in the file while I'm at it? |
Contributor
Author
|
@holiman Updated just the new test for now as suggested and left the others. Happy to rework them to the same style if you'd like though but feels out of scope of this PR. |
Contributor
Author
|
Looks like CI failed because the VisualStudio run hit the 60 minute time out. |
holiman
approved these changes
Oct 25, 2023
devopsbo3
pushed a commit
to HorizenOfficial/go-ethereum
that referenced
this pull request
Nov 10, 2023
…thereum#28358) The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
devopsbo3
added a commit
to HorizenOfficial/go-ethereum
that referenced
this pull request
Nov 10, 2023
…rHash (ethereum#28358)" This reverts commit b7be93f.
devopsbo3
added a commit
to HorizenOfficial/go-ethereum
that referenced
this pull request
Nov 10, 2023
…rHash (ethereum#28358)" This reverts commit b7be93f.
sduchesneau
pushed a commit
to streamingfast/go-ethereum
that referenced
this pull request
Dec 19, 2023
…thereum#28358) Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
marun
pushed a commit
to ava-labs/coreth
that referenced
this pull request
Dec 19, 2023
darioush
pushed a commit
to ava-labs/coreth
that referenced
this pull request
Dec 20, 2023
* Copy ethereum/go-ethereum#27702 * Fix TestRPCGetBlockReceipts * Get ethclient compiling * Copy ethereum/go-ethereum#28087 * Copy ethereum/go-ethereum#28358
Dergarcon
pushed a commit
to MetaMask/mev-geth-0x2mev
that referenced
this pull request
Jan 31, 2024
…thereum#28358) The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
colinlyguo
pushed a commit
to scroll-tech/go-ethereum
that referenced
this pull request
Oct 31, 2024
…thereum#28358) The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
gzliudan
pushed a commit
to gzliudan/XDPoSChain
that referenced
this pull request
Apr 28, 2025
…hereum#28358 The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
Merged
19 tasks
gzliudan
added a commit
to XinFinOrg/XDPoSChain
that referenced
this pull request
Apr 28, 2025
…hereum#28358 (#1006) The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API. Co-authored-by: Adrian Sutton <adrian@oplabs.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
The incorrect encoding was introduced in #28087 when switching from the working but non-standard object encoding (e.g.
{"blockNumber":"0x7fffffffffffffff"}) that comes from JSON serialisingBlockNumberOrHashto usingString()to return a single value. With this implementation ofString()it matches the execution-apis spec for block hash, block number and block labels.