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

eth_getLogs optimizations #560

Closed
s1na opened this issue Jun 18, 2024 · 4 comments
Closed

eth_getLogs optimizations #560

s1na opened this issue Jun 18, 2024 · 4 comments

Comments

@s1na
Copy link

s1na commented Jun 18, 2024

Hello I got a report from @0xbeny that eth_getLogs can be slow at times. I want to list a few optimizations that have been applied upstream. They yielded around 30% improvement in speed. They need to be applied in order.

  1. core/rawdb: avoid unnecessary receipt processing for log filtering ethereum/go-ethereum#23147 Logs are stored as part of receipts in the database. Crucially not all fields of a receipt are persisted to disk. Some are re-computed on read. The most expensive field to re-compute is the bloom filter which will not even be returned in eth_getLogs. Here we define a new decoding of receipts specifically for this use-case which avoids extra processing.
  2. eth/filters: add global block logs cache ethereum/go-ethereum#25459 Previous PR caused an accidental regression in which receipts would not be cached anymore. Hence concurrently querying same blocks would slow down. This PR re-introduces a cache specifically for logs.
  3. eth/filters: avoid block body retrieval when no matching logs ethereum/go-ethereum#25199 as the title suggests we postpone fetching block bodies from disk until we are sure that it is a matching log that needs to be returned to user.
@JukLee0ira
Copy link

JukLee0ira commented Jun 28, 2024

Thank you, s1na! We have checked the performance. PR # 568 will solve this problem

@JukLee0ira
Copy link

JukLee0ira commented Jul 22, 2024

This issue has been resolved in PR #583

@gzliudan
Copy link
Collaborator

I will review tomorrow.

This issue has been resolved in PR #583

@gzliudan
Copy link
Collaborator

gzliudan commented Aug 3, 2024

fixed by #583

@gzliudan gzliudan closed this as completed Aug 3, 2024
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

No branches or pull requests

3 participants