-
Notifications
You must be signed in to change notification settings - Fork 494
feat(provider): eth_getLogs with batch and count options #2884
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
base: main
Are you sure you want to change the base?
Conversation
| } | ||
| } | ||
|
|
||
| batch_start = batch_end + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integer overflow vulnerability: batch_end + 1 can overflow when batch_end is u64::MAX. This will cause a panic in debug mode or wraparound to 0 in release mode, potentially creating an infinite loop. Fix: Add overflow check before incrementing: if batch_end == u64::MAX { break; } batch_start = batch_end + 1;
| batch_start = batch_end + 1; | |
| if batch_end == u64::MAX { break; } | |
| batch_start = batch_end + 1; |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not opposed to this, but let's try this as a dedicated future type instead
|
Updated, please take another look @mattsse , now the usage like below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty, all of this looks fine
need some time to properly review this
d3c2c60 to
7f9adb3
Compare
| /// The [`EthLogsFut`] future is the future type for batch log retrieval. | ||
| #[derive(Debug)] | ||
| #[doc(hidden)] // Not public API. | ||
| #[expect(unnameable_types)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attribute should be #[allow(clippy::unnameable_types)] or #[expect(clippy::unnameable_types)] with the full clippy namespace specified. The current form #[expect(unnameable_types)] is incorrect and won't properly suppress the lint warning.
| #[expect(unnameable_types)] | |
| #[expect(clippy::unnameable_types)] |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
|
can we get this going again? |
Ref foundry-rs/foundry#11638 (review)