Skip to content
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

fix: ensure logs returned by RPC match filter #507

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

Conversation

eshaan7
Copy link
Contributor

@eshaan7 eshaan7 commented Feb 6, 2025

No description provided.

@@ -31,6 +31,8 @@ pub enum ExecutionError {
BlockReceiptsRootMismatch(BlockTag),
#[error("filter not found: 0x{0:x}")]
FilterNotFound(U256),
#[error("log does not match filter")]
LogDoesNotMatchFilter(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: for consistency with the other errors can we name this LogFilterMismatch

return false;
}
for (i, topic) in filter.topics.iter().enumerate() {
if let Some(log_topic) = log.topics().get(i) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the log contains no topic at index i, but the filter does, then this should be viewed as not matching correct? I think we'd want to have an else arm to this that returns false.

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