Skip to content

Commit eeb5b99

Browse files
Provide option for caching logs bloom
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
1 parent a18d151 commit eeb5b99

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

pkg/ethblocklistener/blocklistener.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type BlockListenerConfig struct {
4343
BlockPollingInterval time.Duration `json:"blockPollingInterval"`
4444
HederaCompatibilityMode bool `json:"hederaCompatibilityMode"`
4545
BlockCacheSize int `json:"blockCacheSize"`
46+
CacheLogsBloom bool `json:"cacheLogsBloom"`
4647
}
4748

4849
type BlockListener interface {

pkg/ethblocklistener/blocklistener_blockquery.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ import (
3131
)
3232

3333
func (bl *blockListener) addToBlockCache(blockInfo *ethrpc.BlockInfoJSONRPC) {
34+
if !bl.CacheLogsBloom {
35+
blockInfo.LogsBloom = nil
36+
}
3437
bl.blockCache.Add(blockInfo.Hash.String(), blockInfo)
3538
bl.blockCache.Add(blockInfo.Number.BigInt().String(), blockInfo)
3639
}

pkg/ethrpc/ethrpc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ type BlockInfoJSONRPC struct {
7676
Hash ethtypes.HexBytes0xPrefix `json:"hash"`
7777
ParentHash ethtypes.HexBytes0xPrefix `json:"parentHash"`
7878
Timestamp *ethtypes.HexInteger `json:"timestamp"`
79+
LogsBloom ethtypes.HexBytes0xPrefix `json:"logsBloom"`
7980
Transactions []ethtypes.HexBytes0xPrefix `json:"transactions"`
8081
}

0 commit comments

Comments
 (0)