fix: scope private RPC log scans#540
Merged
Merged
Conversation
bed8b22 to
63ee408
Compare
0xKitsune
approved these changes
Jun 25, 2026
Comment on lines
+160
to
+162
| if filter.topics[0].len() == 1 && filter.topics[0].contains(&B256::ZERO) { | ||
| return Ok(()); | ||
| } |
Collaborator
There was a problem hiding this comment.
nit: I think this can just be:
if filter.topics[0] == FilterSet::from(B256::ZERO) {
return Ok(());
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Requires private RPC log filters to include the authenticated caller in an eligible indexed topic before the query reaches the backend.
Root Cause
Private log APIs previously scoped token addresses and whitelisted event topic0 before backend retrieval, but caller-specific topic eligibility was only enforced after logs were fetched. That allowed broad backend scans even though unrelated logs were filtered out of the response.
Impact
eth_getLogs, installed log filters, and websocket log subscriptions now reject underscoped private log filters with invalid params. Callers can still query sender/owner-style visibility with the caller in topic1, or recipient/spender-style visibility for two-party events with the caller in topic2, while the existing final visibility filter remains in place.