fix(get_logs): paginate through full block range on max results exceeded#21
Merged
fix(get_logs): paginate through full block range on max results exceeded#21
Conversation
Previously, get_logs_with_retry only retried once with the narrower range suggested by the RPC error. This had two problems: 1. The retry range could still exceed the max results limit (no recursive retry) 2. In the comparison context, only one provider would use the narrowed range while the other returned the full range, making comparison meaningless This caused every nightly rpc-tester run to fail on the unfiltered get_logs call in test_block_range, even when all per-block tests passed. The fix replaces the single retry with recursive pagination: - Parse the suggested range to determine chunk size - Split the original block range into chunks of that size - Recursively fetch each chunk (handles nested max-results errors) - Collect all results across the full range Also adds overflow protection, non-progress guards, and range validation. Amp-Thread-ID: https://ampcode.com/threads/T-019c4d30-13af-7466-a358-0c135dbebaf2 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c4d30-13af-7466-a358-0c135dbebaf2 Co-authored-by: Amp <amp@ampcode.com>
emmajam
approved these changes
Feb 11, 2026
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
Fixes the rpc-tester failing every nightly run due to
get_logsexceeding the 20K result limit.Motivation
The rpc-tester has been failing on every single nightly run — including when re-execute succeeds. The failure is always the same:
All per-block tests pass (32/32 ✅). The failure is only in
test_block_range's unfilteredget_logsacross 32 blocks, which produces >20K logs on mainnet.The previous
get_logs_with_retryhad two bugs:test_rpc_call), the retry only narrowed one provider's range while the other returned the full range, making comparison invalidChanges
get_logs_with_retry(crates/rpc-tester/src/get_logs.rs)Testing
Thread: https://tempoxyz.slack.com/archives/C0A87C21805/p1770821518221609