Skip to content

Conversation

cody-wang-cb
Copy link
Collaborator

@cody-wang-cb cody-wang-cb commented Sep 25, 2025

Summary

  • Implements eth_getLogs RPC method for flashblocks with pure pending query support
  • Adds comprehensive test coverage with realistic Transfer event logs
  • Delegates historical queries to underlying eth API for backwards compatibility

Changes Made

  • RPC Method: Added get_logs to EthApiOverride trait with pure pending logic
  • Pending Logic: when toBlock:"pending", queries use flashblocks state
  • Log Filtering: Uses alloy's built-in filter.matches() for efficient address/topic filtering
  • API Extension: Added get_pending_logs method to FlashblocksAPI trait
  • Test Coverage: Enhanced tests with realistic Transfer event logs and comprehensive filtering scenarios

Test Plan

  • Pure pending queries return logs from flashblocks state
  • Historical queries delegate to underlying eth API
  • Address filtering works correctly
  • Topic filtering supports event signatures and indexed parameters
  • Mixed block range queries (e.g., block 0 to pending) delegate to eth API
  • All existing tests continue to pass

🤖 Generated with Claude Code

cody-wang-cb and others added 8 commits September 23, 2025 20:14
- Add get_logs counter metric
- Implement pending logs filtering with address/topic support
- Add get_logs RPC method with pending/historical logic
- Include comprehensive tests for log retrieval functionality
- Add get_logs method to EthApiOverride trait and implementation
- Support pure pending queries (fromBlock:"pending" and toBlock:"pending")
- Delegate all other queries to underlying eth API for historical data
- Add comprehensive test coverage with realistic log data including Transfer events
- Implement log filtering by address, topics, and block ranges
- Add get_pending_logs method to FlashblocksAPI trait
- Use alloy's built-in filter.matches() for efficient log filtering

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Collaborator

@danyalprout danyalprout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, curious if we should/can support more than just (pending, pending) and combine with other cases

@cody-wang-cb cody-wang-cb merged commit a6d4439 into main Oct 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants