Skip to content

Bloom filter cache #232

@JonathanOppenheimer

Description

@JonathanOppenheimer

We can add a LRU cache for common.Hash to types.Bloom

OverrideHeaderBloom (rpc.go:295-301) reads raw receipts from DB and recomputes the bloom filter for every eth_getLogs filter scan. This is called per-block during log filter range queries, which means it could happen a ton of time.

There is no libevm equivalent because libevm stores blooms in headers directly.

The cache could be 2,048 entries (~512 KB — each Bloom is 256 bytes), and we could populate it when the blooms are computed and when blocks settle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions