forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
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.
- 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. - 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.
- 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.
Metadata
Metadata
Assignees
Labels
No labels