Skip to content

backend: implement retry with exponential backoff for Soroban RPC (#959) - #1093

Merged
ONEONUORA merged 1 commit into
Fracverse:masterfrom
AnnieIj:feat/959-rpc-exponential-backoff-retry
Sep 27, 2026
Merged

ONEONUORA merged 1 commit into
Fracverse:masterfrom
AnnieIj:feat/959-rpc-exponential-backoff-retry

Conversation

@AnnieIj

@AnnieIj AnnieIj commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR improves the reliability of Soroban transaction submissions by introducing automatic retry handling for temporary RPC failures.

Changes Made

  • Added retry handling for temporary RPC failures, including HTTP 503 responses and request timeouts.
  • Implemented exponential backoff with delays of 1s, 2s, and 4s.
  • Limited retries to three after the initial submission attempt.
  • Ensured successful submissions stop the retry process immediately.
  • Preserved error handling for non-retryable failures.
  • Updated backend/src/services/stellar.rs.

Expected Outcome

Temporary network interruptions no longer cause immediate transaction submission failure. The backend retries eligible requests with increasing delays while preventing unlimited retry attempts.

Testing

  • Verified retry behaviour for temporary RPC failures.
  • Checked exponential backoff intervals and retry limits.
  • Confirmed successful requests stop further retries.
  • Checked handling of non-retryable errors.

Closes #959

…acverse#959)

Add RpcErrorKind enum and classify_rpc_error() to distinguish HTTP 503
(ServiceUnavailable) and timeout errors from permanent failures.

Add send_rpc_request_with_retry() with up to 3 total attempts and delays
of 1s, 2s, 4s between retries. Non-retryable errors (4xx, unknown) abort
immediately without sleeping.

Wire submit_transaction() through send_rpc_request_with_retry so all
Soroban transaction submissions benefit from the backoff policy.

Add retry_tests module (8 tests): 503 -> ServiceUnavailable, 500/429 ->
OtherRetryable, 400/404 -> Permanent, backoff schedule 1s/2s/4s,
MAX_RETRY_ATTEMPTS == 3, non-retryable abort, integration smoke-test.

Closes Fracverse#959
@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@AnnieIj Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @AnnieIj

@ONEONUORA
ONEONUORA merged commit 5590c43 into Fracverse:master Sep 27, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

backend: IMPLEMENT AUTOMATIC RETRY WITH EXPONENTIAL BACKOFF FOR FAILED RPC CALLS

2 participants