Skip to content

Conversation

lightclient
Copy link
Member

This adds an error in the RPC when a users requests data that has been pruned.

Affected RPC:

  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getBlockTransactionCountByHash
  • eth_getBlockTransactionCountByNumber
  • eth_getUncleCountByBlockHash
  • eth_getUncleCountByBlockNumber
  • eth_getBlockReceipts
  • eth_getTransactionByBlockHashAndIndex
  • eth_getTransactionByBlockNumberAndIndex
  • eth_getTransactionReceipt

It would be better to create a reusable error for this, but that will require reorganzing the project structure, updating the build pipeline, and resolving the site generation issues. I started working on this here, but wasn't able to get the site generator working. We need to just move to docausauraus.

Copy link

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

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

I like it, LGTM

@s1na
Copy link
Contributor

s1na commented Mar 12, 2025

It should be the same for debug_getRawBlock and debug_getRawReceipts.

@s1na
Copy link
Contributor

s1na commented Mar 12, 2025

There is an open question on eth_getLogs: if the range goes beyond the cutoff point, do we return an error or only return logs for post-cutoff point? I am thinking the latter but want to raise it in case others disagree.

@fjl
Copy link
Contributor

fjl commented Mar 12, 2025

We think it should be like this: if the starting point of a getLogs query is before the defined history cutoff point on a pruned node, the query should be rejected. It's incorrect to return partial logs.

@fjl fjl changed the title Add error when accessing pruned chain data debug, eth: define error when accessing pruned chain data Oct 14, 2025
@fjl fjl merged commit 86f3a41 into ethereum:main Oct 14, 2025
6 checks passed
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.

5 participants