feat(keeper): add retry logic with exponential backoff for failed charges - #8
Open
VedantMadane wants to merge 1 commit into
Open
feat(keeper): add retry logic with exponential backoff for failed charges#8VedantMadane wants to merge 1 commit into
VedantMadane wants to merge 1 commit into
Conversation
…rges Distinguish transient RPC/network failures from permanent contract errors, retry with exponential backoff (max 3), and confirm via transaction status lookup that a charge did not already succeed before retrying. Fixes Demilade10#7 Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
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
Add retry logic to the keeper so transient failures do not silently drop a scheduled charge.
Changes
keeper/retry.js(new) — exponential backoff helper with permanent vs retryable classificationkeeper/keeper.js— charge path useswithRetry(max 3 attempts); before retrying, confirms viagetTransactionthat a prior submission did not already succeed (no double-charge)keeper/simulate_retry.js— local simulation of transient recovery, permanent skip, and already-SUCCESS guardBehaviour
Simulated run log
Run:
node keeper/simulate_retry.jsFixes #7