I have been download blocks from EVM-based blockchains via the JSON-RPC API via eth_getBlockByNumber
. In the block there is a logsBloom
element which, if I understand this correctly, is an aggregate of the logs of every transaction in that block.
There are certain topics I want to search for, such as 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
(token transfer). If I can search the block-level logsBloom
filter for my topics in my software, then I can decide whether to go back to the blockchain to get any of the transaction-level logs and/or receipts.
I have limited API calls to my blockchain data provider, so I don't want to call eth_getLogs
or eth_getTransactionReceipt
for every single transaction on a blockchain since 99.9% of them are irrelevant to me and I simply can't send a million requests per day. I need this data historically back to genesis, so subscribing to real-time, filtered events is insufficient.
Is this possible? Can I parse and search the 256 byte block-level logsBloom
data for "any transaction in the block which emitted a specific topic/event that I am asking for"?