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

Add error when accessing pruned chain data #636

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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.

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