Skip to content

feat(rpc): specialise contiguous receipt queries for logs #16441

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

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

Conversation

fgimenez
Copy link
Member

Closes #16437

  • Introduces RangeMode enum with Cached and Range variants and types associated to each
  • for recent and small ranges, uses the Cached variant and specialization, fetching blocks from the cache (falling back to storage on miss)
  • otherwise uses range queries to obtain the logs

@fgimenez fgimenez self-assigned this May 23, 2025
@fgimenez fgimenez requested review from mattsse and Rjected as code owners May 23, 2025 14:46
@fgimenez fgimenez added C-enhancement New feature or request A-rpc Related to the RPC implementation labels May 23, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker May 23, 2025
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

some early nits


// cache miss - fallback to storage to ensure correctness
if let Some(receipts) =
self.filter_inner.provider().receipts_by_block(block_hash.into())?
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have this fn

fn receipts_by_tx_range(
&self,
range: impl RangeBounds<TxNumber>,
) -> ProviderResult<Vec<Self::Receipt>> {

which I think we could adapt to return Vec of Vec for blocks as well this would likely be more efficient for entire block ranges

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, will prepare a separate PR for this

Copy link
Member Author

Choose a reason for hiding this comment

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

proposed here #16449

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker May 23, 2025
@fgimenez fgimenez changed the title feat(rpc): specialise contiguous receipt queries for filters feat(rpc): specialise contiguous receipt queries for logs May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

specialise contiguous receipt queries
2 participants