Skip to content

feat: add ws filtering by addresses and topics with configurable match logic #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tobidae-cb
Copy link

@tobidae-cb tobidae-cb commented Jun 4, 2025

New Features

  • Address filtering: Filter messages by addresses
  • Topic filtering: Filter messages by event topics
  • Combined filtering: Use both addresses and topics with configurable logic
  • Match modes: match=any (OR logic, default) or match=all (AND logic)

API Endpoints

# Address filtering
/ws/filter?addresses=0x123,0x456

# Topic filtering  
/ws/filter?topics=0xabc,0xdef

# Combined with OR logic (default)
/ws/filter?addresses=0x123&topics=0xabc&match=any

# Combined with AND logic
/ws/filter?addresses=0x123&topics=0xabc&match=all

Usage Examples

# OR logic - matches transactions involving ANY specified address OR topic
websocat "ws://localhost:8545/ws/filter?addresses=0x4532e1cE563f4bA6d8ba0D5967f85F54063801ed,0x48659ab7f847887a819031a66daaca74ea85b3a9&topics=0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89&match=any"

# AND logic - matches only transactions involving BOTH specified addresses AND topics  
websocat "ws://localhost:8545/ws/filter?addresses=0x4532e1cE563f4bA6d8ba0D5967f85F54063801ed&topics=0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89&match=all"

# Address-only filtering
websocat "ws://localhost:8545/ws/filter?addresses=0x4532e1cE563f4bA6d8ba0D5967f85F54063801ed,0x48659ab7f847887a819031a66daaca74ea85b3a9"

Unit tests for all filter combinations and match modes

Integration tests with WebSocket connections
Manual testing with live blockchain data
Verified performance with multiple concurrent filters

Copy link

vercel bot commented Jun 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rollup-boost ⬜️ Ignored (Inspect) Visit Preview Jun 4, 2025 9:20pm

@tobidae-cb tobidae-cb force-pushed the filter-address-topic branch from 171f065 to acb69a9 Compare June 4, 2025 16:46
…ture gated request with the permanent location in node-reth
@tobidae-cb tobidae-cb force-pushed the filter-address-topic branch from 7afe99f to c54df3f Compare June 4, 2025 20:39
@ferranbt ferranbt self-requested a review June 5, 2025 16:35
@ferranbt
Copy link
Collaborator

ferranbt commented Jun 5, 2025

Hey, what would be the motivation behind this change? The reverse proxy is meant to be just a proxy that it is not aware of any communication protocol behind it.

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.

2 participants