Cinder

Sparse eth_getLogs: the header bloom says yes too often

TL;DR

A filter for a rare address or topic must find the few blocks with a match. The header bloom of a mainnet block is now so full that it lets 31 to 46% of the blocks through. Only 0.1 to 0.5% of the blocks have a match. Cinder 0.9.5 writes a log filter row for each block: the sorted 24-bit fingerprints of its log keys, about 3.5 KB. We compared it with reth 2.7 on the measurement server, on the same head. Sparse queries over 10 000 blocks took 12 to 13 ms against 1.6 to 1.8 s. Cinder served 113 to 143 times the requests per second. Dense queries now take 0.51 to 0.71 of the reth time. In 0.9.2 they took 2.41 times the reth time. All 1 195 compared answers were equal.

Ask a mainnet node for the logs of one DEX pool factory over the last 10 000 blocks. There are about 63 such logs. On the same head and the same blocks, reth 2.7 answered in 1 593 ms by median, and Cinder 0.9.5 in 12.7 ms. With 4 connections, Cinder served 113 times the requests per second of reth. For a Transfer to one wallet, the factor was 143.

The reason is not a faster way to read receipts. The node reads far fewer of them. This post explains why the bloom filter in each block header no longer does its job on mainnet, what we put next to it, the variants we measured and rejected, and what the row costs in disk and write time.

What eth_getLogs does, and what a sparse filter is

eth_getLogs returns the events (logs) that contracts emitted in a range of blocks. A filter names an address, topics (the event type and its indexed arguments), or both. Indexers, wallets and dashboards send these requests all day, often over thousands of blocks.

A filter is sparse when few blocks have a match: one factory contract, one rare event, the transfers to one wallet. A filter is dense when most blocks have a match: a stablecoin address, the ERC-20 Transfer event. A dense query costs the time to read and send many logs. A sparse query should cost almost nothing, because the answer is small. On mainnet today it does not, because of the bloom.

The bloom says yes on almost half of the blocks

Each block header has a 2 048-bit log bloom. Each address and topic of each log in the block sets 3 bits in it. To check a block, a node looks at the 3 bits of the filter’s address. If one bit is 0, the block surely has no match, and the node skips it. If all 3 bits are 1, the block can have a match, and the node must read the receipts of the block to find out.

This worked when blocks had few logs. Today a mainnet block has about 1 150 distinct log keys (addresses and topics), so most of the 2 048 bits are 1. We measured it on 50 000 blocks:

For each 100 blocks that the header bloom lets through, the new row lets through 0.41 to 1.65.

RowHeader bloom lets it throughLog filter row lets it through
A DEX pool factory (one address) (196 blocks have a match)19 627 blocks196 blocks
A pool-creation event (one topic) (259 blocks have a match)15 688 blocks259 blocks
Transfer to one wallet (two topics) (70 blocks have a match)22 993 blocks95 blocks
Blocks that each check lets through, out of 50 000 mainnet blocks (26 111 237 to 26 161 236). Log axis: each step is 10 times more. A block that a check lets through costs a read of all its receipts. Development computer, read-only probe, 2026-10-21. Record: docs/results/2026-10-getlogs-filter-rows.md.

On these blocks, the header bloom let a sparse filter through on 31 to 46% of the blocks, but only 0.1 to 0.5% of the blocks had a match. Every block that the bloom passes costs a read of all its receipts, about 260 KB. On a 50 000-block query, 85% of the time was this walk.

The wallet row shows one more thing. 25 of its 95 blocks are not false passes. These blocks have a Transfer log and a log with the wallet as topic 2, but not in the same log. A check per block cannot remove them. Only a read of the logs can.

The fix: a row of fingerprints for each block

For each block, Cinder 0.9.5 writes a log filter row in a new database table:

When the header bloom lets a filter through, the node reads the row. The row must have the fingerprint of an address of the filter, and of a topic at each topic position of the filter. If not, the block has no match, and the node does not read its receipts.

Two properties keep the answer the same:

  1. A key of the block always has its fingerprint in the row. The row never removes a block that has a match.
  2. A fingerprint can also match a key that the block does not have (a false pass). Then the node reads the receipts, as before.

A block without a row, with a row of another version, or with the hash of another block (after a reorg) is read as before. A database of an older Cinder works without rows, and cinder --build-log-filters writes the rows of the blocks that have none, also while a node runs on the database.

The variants we measured, and why 24 bits

Before the change, a read-only probe wrote the real rows of 50 000 blocks and ran the same filters through each variant. The gate was: a sparse filter must pass less than 10% of the blocks that the header bloom passes. The 24-bit fingerprints passed 1.0%, 1.65% and 0.41%.

Variant Bytes per block Blocks passed: factory, event, wallet Decision
A bigger bloom, 4 KB, 3 bits per key 4 104 274, 334, 192 rejected: more than one database page per block
A bloom of one page (4 064 bytes), 6 bits per key 4 073 268, 324, 170 rejected: passes more blocks for the same size
16-bit fingerprints smaller 492, 563, 493 rejected: too many false passes
32-bit fingerprints 4 597 196, 259, 95 rejected: the same blocks as 24 bits, 25% larger
24-bit fingerprints 3 450 196, 259, 95 kept

A bloom of one page lets 40 to 80% more blocks through than the 24-bit row, for about the same size. A bloom tests bits. A sorted list of fingerprints tests exact 24-bit values. With about 1 150 keys in a block, a false match of 24 bits is rare.

What the row costs

Disk. On a database with the history of 51 239 blocks, the new table took 252 MB, 4.9 KB per block with the database overhead. That is 1.9% of the receipts. For the 92 000 blocks of a full node’s history window, it is about 450 MB.

Write time. The writer thread (the thread that writes executed blocks to the database, after the node answers the consensus client) builds the row from the receipts of the block. In two write runs, the row added 118 and 85 microseconds per block. engine_newPayload does not wait for it.

Dense queries. A dense query reads one row per block, in 1 to 2 microseconds. On a development computer, the dense queries stayed within 2.3% of the time before, inside the noise of that computer.

Against reth 2.7, on the same head

On sparse filters, Cinder answered in 12 to 54 ms, and reth took 1.6 to 6.0 s.

RowCinder 0.9.5reth 2.7
DEX pool factory, 10 000 blocks (about 63 logs)12.7 ms1 593 ms
Transfer to one wallet, 10 000 blocks (about 23 logs)12 ms1 814 ms
DEX pool factory, 40 000 blocks (301 logs)51.2 ms5 967 ms
Transfer to one wallet, 40 000 blocks53.8 ms5 999 ms
Median answer time of sparse eth_getLogs at 1 connection, in ms. Log axis: each step is 10 times more. Both nodes at the same head, the same requests on the same blocks, the measurement server, live mainnet, 2026-10-21. Record: docs/results/2026-10-rpc-vs-reth-095.md.
Sparse case reth 2.7, median Cinder 0.9.5, median reth req/s Cinder req/s Cinder / reth, req/s
DEX pool factory, 10 000 blocks, 4 connections 1 673 ms 14.5 ms 2.40 272 113
Transfer to one wallet, 10 000 blocks, 4 connections 1 893 ms 12.9 ms 2.13 305 143
DEX pool factory, 40 000 blocks, 1 connection 5 967 ms 51.2 ms 0.15 19.5 130
Transfer to one wallet, 40 000 blocks, 1 connection 5 999 ms 53.8 ms 0.15 18.5 123

The record gives the cause: the log filter rows. Cinder 0.9.4 read the receipts of each block that the header bloom let through. Cinder 0.9.5 reads them only for the blocks that the row lets through. The gain comes from the reads that the row removes, not from a faster read.

Dense queries: from 2.41 times reth’s time to about two thirds

The row does nothing for a dense filter: almost every block has a match. Dense queries were slow on Cinder for other reasons. In the 0.9.2 record, a 100-block query on a stablecoin address took 2.41 times reth’s time. A profile of that query found two causes:

The fixes:

At 1 connection, Cinder 0.9.5 took 0.51 to 0.71 of reth’s time on dense queries.

RowCinder 0.9.5reth 2.7
Stablecoin, 100 recent blocks (about 8 000 logs, 5.2 MB)48.7 ms68.2 ms
Stablecoin, 100 older blocks (16 944 logs, 10.8 MB)131 ms257 ms
Transfer event, 30 blocks (about 17 500 logs, 11.3 MB)107 ms158 ms
Median answer time of dense eth_getLogs at 1 connection, in ms, bars from zero. The times include the transfer of each answer through the network forward, for both nodes. The measurement server, live mainnet, 2026-10-21. Record: docs/results/2026-10-rpc-vs-reth-095.md.
Dense case, 1 connection reth 2.7 Cinder 0.9.5 Cinder / reth
Stablecoin, 100 recent blocks 68.2 ms 48.7 ms 0.71
Stablecoin, 100 older blocks 257 ms 131 ms 0.51
Transfer event, 30 blocks 158 ms 107 ms 0.68

At 4 and 16 connections the two nodes gave the same throughput on these cases. That is not a tie between the nodes: the network forward between the client and the server carried about 120 to 140 MB/s of answers, and both nodes filled it. These rows measure the forward.

The answers are the same

A faster wrong answer is worth nothing to an indexer. Each change of this work was checked against the code before it, byte for byte:

Against reth 2.7 on the measurement server: all 1 195 compared answer pairs were equal, among them the sparse and dense log cases. The three large log answers were equal in bytes too.

What we did not do, and what this does not show

If you run eth_getLogs for others

Sparse filters over a long range are the requests that hold a worker for seconds. With the rows, they take tens of milliseconds, and the answers do not change. An existing database needs one run of cinder --build-log-filters for the blocks it has. New blocks get their row when the node writes them. The method pages, with the error codes and limits that match reth, are in the JSON-RPC reference. To run Cinder against your own traffic, ask for access at getcinder.dev/access.