Overview
Soroban RPC calls can fail transiently. Add a resilience layer to StellarSplitClient with configurable retry logic (exponential backoff with jitter) and a circuit breaker that opens after N consecutive failures and auto-resets after a cooldown period.
Requirements
- All RPC calls in
StellarSplitClient wrapped with retry logic
RetryConfig { maxRetries: number, baseDelayMs: number, maxDelayMs: number, jitter: boolean }
CircuitBreakerConfig { failureThreshold: number, resetTimeoutMs: number }
- Circuit breaker states: CLOSED (normal) → OPEN (failing fast) → HALF-OPEN (testing recovery)
- Emit circuit state change events via
client.on('circuit:open' | 'circuit:close' | 'circuit:half-open', cb)
- Non-retryable errors (e.g.
InvalidInput, Unauthorized) must bypass retry immediately
- Write tests: retry exhaustion, circuit opens after threshold, circuit resets after timeout, non-retryable errors skip retry
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Soroban RPC calls can fail transiently. Add a resilience layer to
StellarSplitClientwith configurable retry logic (exponential backoff with jitter) and a circuit breaker that opens after N consecutive failures and auto-resets after a cooldown period.Requirements
StellarSplitClientwrapped with retry logicRetryConfig { maxRetries: number, baseDelayMs: number, maxDelayMs: number, jitter: boolean }CircuitBreakerConfig { failureThreshold: number, resetTimeoutMs: number }client.on('circuit:open' | 'circuit:close' | 'circuit:half-open', cb)InvalidInput,Unauthorized) must bypass retry immediatelyAcceptance Criteria
npm testpasses with zero failuresDefinition of Done
All CI checks must pass before the PR is reviewed.