Skip to content

Conversation

SkandaBhat
Copy link
Contributor

@SkandaBhat SkandaBhat commented Sep 5, 2025

(WIP; please expect a lot of changes before its ready for review!)

Implements a dedicated log indexing system based on EIP-7745 using FilterMaps to replace bloom filters for eth_getLogs queries, providing significant performance improvements.

Fixes #16999

Summary

This PR introduces a new log indexing system based on FilterMaps (sparse bit maps) that dramatically improves the performance of log queries. The implementation follows the EIP-7745 specification and includes:

  • reth-log-index crate with core algorithms for indexing and querying
  • A new IndexLogs stage for building the index during sync
  • RPC integration with hybrid query mode (indexed + bloom filter fallback)
  • Database tables for FilterMapMeta, FilterMapRows, and LogValueIndices

Testing

On Sepolia, for 100k blocks query for WETH transfers on my local machine, I got ~2x improvement:

Method Cold cache Warm cache
Bloom filter 7.148s 0.554s
Indexed 3.958s 0.285s

Query used

time curl -X POST -H "Content-Type: application/json" --data '{"method":"eth_getLogs","params":[{"fromBlock": "0x4AC4A0", "toBlock": "0x4C4B40", "address":"0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9", "topics": [["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], [], []]}],"id":1,"jsonrpc":"2.0"}' 127.0.0.1:8545 > ../eth_logs_output_indexed.json

@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Sep 5, 2025
@SkandaBhat SkandaBhat changed the title (WIP) Log indexing system to improve eth_getLogs performance (EIP-7745) feat: Log indexing system to improve eth_getLogs performance (EIP-7745) Sep 5, 2025
@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Oct 1, 2025
# Conflicts:
#	crates/storage/provider/src/providers/database/provider.rs
@github-actions github-actions bot removed the S-stale This issue/PR is stale and will close with no further activity label Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Implement dedicated log indexing system for eth_getLogs performance

1 participant