Skip to content

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Jun 2, 2025

This changes the API backend to return null for not-found blocks. This behavior is required by the RPC When BlockByNumberOrHash always returned an error for this case ever since being added in #19491. The backend method has a couple of call sites, and all of them handle a nil block result because BlockByNumber returns nil for not-found.

The only case where this makes a real difference is for eth_getBlockReceipts, which was changed in #31361 to actually forward the error from BlockByNumberOrHash to the caller.

@fjl fjl requested a review from rjl493456442 as a code owner June 2, 2025 13:53
Copy link
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fjl fjl merged commit c87b856 into ethereum:master Jun 2, 2025
3 of 4 checks passed
@fjl fjl added this to the 1.15.12 milestone Jun 2, 2025
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 2025
This changes the API backend to return null for not-found blocks. This behavior
is required by the RPC When `BlockByNumberOrHash` always returned an error
for this case ever since being added in ethereum#19491.
The backend method has a couple of call sites, and all of them handle a `nil`
block result because `BlockByNumber` returns `nil` for not-found.

The only case where this makes a real difference is for `eth_getBlockReceipts`,
which was changed in ethereum#31361 to actually forward the error from `BlockByNumberOrHash`
to the caller.
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.

2 participants