Conversation
… results When the server's suggested retry range itself exceeds the max results limit (e.g., ~889 logs/block × 26 blocks > 20k limit), the pagination logic would give up instead of splitting further. Now it halves the chunk size and retries, allowing the pagination to converge. Amp-Thread-ID: https://ampcode.com/threads/T-019c6c52-d0c7-7508-8a37-b5cacce32bde Co-authored-by: Amp <[email protected]>
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.
Problem
The
get_logs_with_retrypagination logic fails when the server's suggested retry range itself exceeds the max results limit.For example, with ~889 logs/block, the server suggests retrying with a 26-block range (~23k logs), but the 20k limit means that range also fails. On the recursive retry, the code detects that
chunk_size >= original_lenand gives up entirely, surfacing the error to the test runner.This caused RPC test failures like:
Fix
Instead of giving up when the suggested chunk covers the entire (sub-)range, halve the chunk size and retry. This lets the pagination converge to a working chunk size regardless of how accurate the server's suggestion is.
Example