go-ethereum/eth/filters
minh-bq 68de26e346
core/types: create block's bloom by merging receipts' bloom (#31129)
Currently, when calculating block's bloom, we loop through all the
receipt logs to calculate the hash value. However, normally, after going
through applyTransaction, the receipt's bloom is already calculated
based on the receipt log, so the block's bloom can be calculated by just
ORing these receipt's blooms.
```
goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: Apple M1 Pro
BenchmarkCreateBloom
BenchmarkCreateBloom/small
BenchmarkCreateBloom/small-10             810922              1481 ns/op             104 B/op          5 allocs/op
BenchmarkCreateBloom/large
BenchmarkCreateBloom/large-10               8173            143764 ns/op            9614 B/op        401 allocs/op
BenchmarkCreateBloom/small-mergebloom
BenchmarkCreateBloom/small-mergebloom-10                 5178918               232.0 ns/op             0 B/op          0 allocs/op
BenchmarkCreateBloom/large-mergebloom
BenchmarkCreateBloom/large-mergebloom-10                   54110             22207 ns/op               0 B/op          0 allocs/op
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2025-02-13 18:05:58 +01:00
..
api.go eth/filters: ensure API timeoutLoop terminates with event system (#31056) 2025-01-21 13:11:05 +01:00
api_test.go rpc: change BlockNumber constant values to match ethclient (#27219) 2023-05-23 13:18:38 +02:00
filter.go eth/filters: remove support for pending logs (#29574) 2024-04-22 10:31:17 +02:00
filter_system.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
filter_system_test.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
filter_test.go core/types: create block's bloom by merging receipts' bloom (#31129) 2025-02-13 18:05:58 +01:00