Skip to content

Add retry logic with exponential backoff for Stellar RPC errors #214

Description

@AbelOsaretin

What

sendTransaction and getTransaction calls in src/lib/stellar.ts have no retry-on-network-error logic. Transient failures (timeout, 503, network blip) cause immediate transaction failure.

Why

Stellar RPC endpoints can experience transient failures. Without retries, a single network hiccup causes a transaction to fail even though it may have succeeded on-chain.

Scope

  • Add retry wrapper for Stellar RPC calls
  • Exponential backoff with jitter
  • Configurable max retries and base delay
  • Only retry on transient errors (timeout, 503, network error)
  • Do NOT retry on permanent errors (400, 422)

Acceptance Criteria

  • RPC calls retry on transient errors (up to RPC_MAX_RETRIES)
  • Exponential backoff with jitter between retries
  • Base delay configurable via RPC_RETRY_BASE_MS
  • Permanent errors are not retried
  • Logs each retry attempt

Technical Context

  • src/lib/stellar.ts:34sendTransaction
  • src/lib/stellar.ts:43getTransaction
  • src/lib/registry.ts:53simulateTransaction
  • New env vars: RPC_MAX_RETRIES (default: 3), RPC_RETRY_BASE_MS (default: 1000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    highSignificant functionality broken, no workaround, affects multiple users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions