Skip to content

feat: Soroban RPC dual-endpoint failover - #168

Open
Fang0067 wants to merge 1 commit into
wraith-protocol:developfrom
Fang0067:feat/soroban-rpc-dual-endpoint-failover-136
Open

feat: Soroban RPC dual-endpoint failover#168
Fang0067 wants to merge 1 commit into
wraith-protocol:developfrom
Fang0067:feat/soroban-rpc-dual-endpoint-failover-136

Conversation

@Fang0067

Copy link
Copy Markdown

Summary

A single Soroban RPC URL is a single point of failure. This PR adds a createRpcClient that accepts an array of endpoints with automatic health-check, circuit breaker, and silent failover.

Linked issue

Closes #136

Changes

  • src/chains/stellar/rpc.ts — new createRpcClient factory with:
    • Array of endpoints, sticky to healthy one until failure
    • Circuit breaker: after N consecutive failures, marks endpoint bad for M seconds
    • Emits endpointFailover event on switch
    • Configurable retry policy per endpoint
  • src/chains/stellar/index.ts — exports createRpcClient + types
  • test/chains/stellar/rpc.test.ts — unit tests covering failover, circuit breaker, cooldown recovery, event emission, non-retryable statuses

Testing notes

New tests (test/chains/stellar/rpc.test.ts):

  • pnpm test -- test/chains/stellar/rpc.test.ts

Checklist

  • Conventional Commits title
  • One logical change
  • Tests written for new behaviour
  • No breaking changes

Client accepts an array of endpoints with health-check, circuit breaker,
and automatic failover. Emits endpointFailover event for observability.

Closes wraith-protocol#136
@truthixify

Copy link
Copy Markdown
Contributor

Retarget from main to develop. Your diff shows +49k lines because your branch is far behind main; retargeting to develop will drop it to a normal size.

@truthixify
truthixify changed the base branch from main to develop July 29, 2026 03:17
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Fang0067 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

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.

Soroban RPC dual-endpoint failover

2 participants