eth-bloom is a Python library providing an implementation of the bloom filter used by Ethereum. It allows for efficient probabilistic checks of set membership, commonly used to quickly detect the likely presence of event logs within Ethereum blocks and transaction receipts. The library is actively maintained by the Ethereum Foundation and regularly updated to support modern Python versions.
pip install eth-bloomVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create, populate, query, and combine Ethereum-style Bloom filters, as well as initialize one from an integer representation. Items added to the filter must be byte strings.
Update your `pip install` command to `pip install eth-bloom` and change all import statements from `from ethereum_bloom import ...` to `from eth_bloom import ...`.
Always perform a definitive check on the underlying data (e.g., actual transaction logs or database) if a Bloom filter indicates a potential match. The filter is best used for quickly ruling out non-matches.
Understand that `eth-bloom` is primarily useful for filtering contract events (e.g., ERC20 `Transfer` events) and should not be relied upon for other types of on-chain activity.
Monitor Ethereum protocol developments for the status and implementation of EIP-7668. Be prepared to adapt usage patterns if block header Bloom filters are removed or emptied in a future hard fork.
Install the correct package and update your import statements: `pip install eth-bloom` and change `from ethereum_bloom import BloomFilter` to `from eth_bloom import BloomFilter`.
Ensure that all values passed to `BloomFilter` methods are encoded as byte strings. For example, use `b'your_string'` instead of `'your_string'`, or `value.encode('utf-8')` for dynamic strings. For hexadecimal strings like Ethereum addresses or topic hashes, use `bytes.fromhex(hex_string[2:])` after removing the '0x' prefix.Upgrade your `web3.py` library to the latest version (`pip install web3 --upgrade`) and update your code to use the modern snake_case method names, such as `w3.eth.get_block()` instead of `w3.eth.getBlock()`.
No dependency data recorded yet.