feat(keeper): implement retry logic with exponential backoff for failed submissions#1
Open
ACodehunter wants to merge 1 commit intomainfrom
Open
feat(keeper): implement retry logic with exponential backoff for failed submissions#1ACodehunter wants to merge 1 commit intomainfrom
ACodehunter wants to merge 1 commit intomainfrom
Conversation
…ed submissions Implements a fault-tolerant retry mechanism for transaction submissions that handles transient network failures, RPC timeouts, and fee-related rejections without causing duplicate execution or infinite loops. Features: - Generic withRetry() higher-order async wrapper with configurable options - Exponential backoff with jitter: baseDelay * 2^attempt + random(0, baseDelay) - Error classification into retryable, non-retryable, and duplicate categories - DUPLICATE_TRANSACTION responses treated as success (no retry) - Comprehensive error code support for Soroban RPC responses - Retry count tracking and inclusion in execution logs - MAX_RETRIES_EXCEEDED warning event emission - Environment variable configuration (MAX_RETRIES, RETRY_BASE_DELAY_MS, MAX_RETRY_DELAY_MS) Error Classifications: - Retryable: TIMEOUT, NETWORK_ERROR, RATE_LIMITED, SERVER_ERROR, etc. - Non-retryable: INVALID_ARGS, INSUFFICIENT_GAS, CONTRACT_PANIC, TX_BAD_AUTH, etc. - Duplicate: DUPLICATE_TRANSACTION, TX_ALREADY_IN_LEDGER Testing: - Unit tests covering success on 2nd attempt - Non-retryable error bail scenarios - Max retries exceeded handling - Duplicate transaction detection - Exponential backoff with jitter verification - Network error detection Closes SoroLabs#37
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.
Implements a fault-tolerant retry mechanism for transaction submissions that handles transient network failures, RPC timeouts, and fee-related rejections without causing duplicate execution or infinite loops.
Features
Error Classifications
Testing
Closes SoroLabs#37