fix: add a backoff for getBlock on -32004 from upstream#22
Open
fix: add a backoff for getBlock on -32004 from upstream#22
Conversation
linuskendall
approved these changes
Mar 20, 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.
This pull request refactors the error handling logic for block fetching in the
poller.rsfile, making it more robust and testable. The main improvement is the introduction of a new error classification system that allows for more granular handling of different block fetch failures, including retry strategies and skipping blocks. Additionally, unit tests have been added to ensure the correctness of the classification logic.Error handling improvements:
BlockFetchRetryActionenum and theclassify_block_fetch_errorfunction to encapsulate block fetch error handling, allowing for immediate retry, delayed retry with backoff, or skipping blocks based on error codes.fetch_block_with_infinite_retriesto use the new classification system, improving logging, metrics, and retry behavior for different error types.Testing enhancements:
classify_block_fetch_errorfunction to verify correct classification of errors and retry actions.Minor adjustments:
Durationto imports and removed an unnecessary blank line inpop_cached_blocks_to_index. [1] [2]