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: return an error if block does nit exist #7374

Merged
merged 2 commits into from Mar 28, 2024

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Mar 28, 2024

closes #7371

previously we returned an empty list for a ethGetLogs request with a hash if we were unable to find that block.
This is incorrect behaviour because this indicates that there are no matches for the filter.

this returns an error instead

@mattsse mattsse requested a review from Rjected as a code owner March 28, 2024 12:51
@mattsse mattsse added C-bug An unexpected or incorrect behavior A-rpc Related to the RPC implementation labels Mar 28, 2024
@mattsse mattsse requested a review from shekhirin March 28, 2024 13:26
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +549 to +551
let resp = client.request::<Vec<Log>, _>("eth_getLogs", params).await;
// block does not exist
assert!(resp.is_err());
Copy link
Member

Choose a reason for hiding this comment

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

nice

@mattsse mattsse added this pull request to the merge queue Mar 28, 2024
Merged via the queue into main with commit bd2945a Mar 28, 2024
27 checks passed
@mattsse mattsse deleted the matt/return-error-if-block-does-not-exist branch March 28, 2024 13:41
Ruteri pushed a commit to Ruteri/reth that referenced this pull request Apr 17, 2024
Ruteri pushed a commit to Ruteri/reth that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eth_getLogs querying by block hash returns empty list for a non-existent block hash
2 participants