EIPs Explained

EIP-7668 · Stagnant · Core · 2024-03-31

EIP-7668: Remove bloom filters

Proposes requiring the logs bloom filters in block headers and receipts to be empty, dropping a slow, rarely used log-search feature from the protocol.

What problem does it solve?

Every Ethereum block header and every transaction receipt carries a 256-byte logs bloom: a probabilistic summary of which contract addresses and event topics appear in that block's logs. The idea was that a dapp (or a light client) could scan blooms across history, skip blocks that definitely do not contain the events it cares about, and only fetch the few that might.

In practice this works poorly. At today's gas limits blocks contain so many logs that blooms are mostly full, so the false-positive rate is high and a long history query still touches a huge number of blocks. Almost all applications that read history use indexers and other services outside the protocol instead of walking blooms through RPC. Meanwhile, every client still has to compute, store and validate these filters.

EIP-7668 proposes accepting that reality and removing the bloom filters from consensus.

How it works

The change is deliberately minimal:

  • The logsBloom field of an execution block header must be empty (0 bytes long).
  • The logsBloom field of every transaction receipt must be empty as well.

The fields themselves are not removed yet; the spec says a later EIP could delete them along with other deprecated fields. Keeping the field but forcing it empty is the least disruptive way to stop clients from having to build blooms.

What does not change:

  • Logs are still emitted, stored in receipts and returned by eth_getLogs. Only the bloom summary goes away.
  • LOG0–LOG4 gas costs stay the same. The author argues that although the cost of polluting the bloom disappears, hashing costs matter more now because of ZK-proving of the EVM.

The longer-term expectation is that applications needing history search will use decentralized, provable log indexes (for example built with ZK-SNARKs) rather than in-protocol blooms.

Sample code

Illustrative block-validation rule after the change (pseudocode):

def validate_blooms(header, receipts):
    # EIP-7668: the header bloom and every receipt bloom must be empty
    assert len(header.logs_bloom) == 0, "header bloom must be empty"
    for r in receipts:
        assert len(r.logs_bloom) == 0, "receipt bloom must be empty"

Querying logs from an application keeps working the same way, because nodes filter logs directly (ethers v6):

import { JsonRpcProvider, id } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const logs = await provider.getLogs({
  address: tokenAddress,
  topics: [id("Transfer(address,address,uint256)")],
  fromBlock: latest - 1000,
  toBlock: latest,
});
console.log(logs.length);

Things to know

  • Status: Stagnant. This EIP has not been scheduled for any network upgrade and blooms are still part of the protocol today.
  • Anything that reads logsBloom directly from headers or receipts (some light-client designs, custom indexers) would stop working if this were adopted. RPC log filtering itself would not break, but nodes could no longer use blooms to speed it up.
  • It fits a broader trend of moving historical data access out of the core protocol, alongside history-expiry work such as EIP-4444.
  • The discussion thread is titled under an earlier number (EIP-7653); the proposal is the same idea.

#logs #bloom #history #core #cleanup

Details

Authors
Vitalik Buterin (@vbuterin)
Status
Stagnant
Type
Standards Track / Core
Created
2024-03-31
Required by

Machine-readable: Markdown · JSON