go-ethereum/eth/filters
Sina Mahmoodi 2def62b99b
eth/filters: avoid block body retrieval when no matching logs (#25199)
Logs stored on disk have minimal information. Contextual information such as block
number, index of log in block, index of transaction in block are filled in upon request.
We can fill in all these fields only having the block header and list of receipts.
But determining the transaction hash of a log requires the block body.

The goal of this PR is postponing this retrieval until we are sure we the transaction hash.
It happens often that the header bloom filter signals there might be matches in a block,
but after actually checking them reveals the logs do not match. We want to avoid fetching
the body in this case.

Note that this changes the semantics of Backend.GetLogs. Downstream callers of
GetLogs now assume log context fields have not been derived, and need to call
DeriveFields on the logs if necessary.
2023-02-13 10:59:27 +01:00
..
api_test.go all: change format 0x%x to %#x (#25221) 2022-07-04 11:03:32 +03:00
api.go eth/filters: fix typo in comment (#26515) 2023-01-17 23:29:08 +01:00
bench_test.go eth/filters: add global block logs cache (#25459) 2022-08-19 11:14:59 +02:00
filter_system_test.go eth/filters: avoid block body retrieval when no matching logs (#25199) 2023-02-13 10:59:27 +01:00
filter_system.go eth/filters: avoid block body retrieval when no matching logs (#25199) 2023-02-13 10:59:27 +01:00
filter_test.go eth/filters: fix failing benchmark-test (#26144) 2022-11-09 09:49:42 +01:00
filter.go eth/filters: avoid block body retrieval when no matching logs (#25199) 2023-02-13 10:59:27 +01:00