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

Improve range filter performance #2633

Closed
mattsse opened this issue May 11, 2023 · 2 comments · Fixed by #2635
Closed

Improve range filter performance #2633

mattsse opened this issue May 11, 2023 · 2 comments · Fixed by #2635
Labels
A-rpc Related to the RPC implementation C-enhancement New feature or request C-perf A change motivated by improving speed, memory usage or disk footprint

Comments

@mattsse
Copy link
Collaborator

mattsse commented May 11, 2023

Describe the feature

Currently, the range filter fetches the entire block one by one:

if let Some(block) = self.block_by_number(block_number).await? {

this is suboptimal because we only need the body if the bloom matches

we do however need to read all the headers, this should be done first via the headers_range API which should be fast and then only fetch the full body via cache

TODO

  • read header range (use some reasonable chunks so that we're not reading the entire range)
  • only read full body if bloom is a match (reading the full block could likely be further optimized in the caching service if we already have already have the header so we only need to read the body)

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request A-rpc Related to the RPC implementation C-perf A change motivated by improving speed, memory usage or disk footprint labels May 11, 2023
@jerusan
Copy link

jerusan commented May 11, 2023

I can work on this

@mattsse
Copy link
Collaborator Author

mattsse commented May 11, 2023

hey @jerusan I already took this on in #2635

if you want to contribute, there are a few good first issues, like #2624

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 C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants