Skip to content

[BUG] Horizon/Soroban RPC failover only triggers on network errors, not on 5xx responses from a degraded node #899

Open

Description

@meshackyaro

Bug Description

A Soroban RPC node that's up but returning 503/502 (e.g. during its own maintenance) isn't treated as a failover trigger — only connection-level failures (ECONNREFUSED, timeout) are.

Component

  • Backend
  • Frontend
  • Smart Contract
  • SDK
  • Documentation
  • Other:

Steps to Reproduce

  1. Point the primary RPC config at an endpoint that returns 503 for all requests (but accepts the TCP connection).
  2. Make a request that depends on the Soroban RPC.
  3. Observe whether failover to the secondary node occurs.
  4. Check the error ultimately surfaced to the caller.

Expected Behavior

A sustained 5xx from the current RPC node should trigger the same failover path as a connection error.

Actual Behavior

The client retries against the same degraded node (or gives up) without ever trying the configured secondary node.

Environment

  • Node Version: 20.x
  • OS: Linux / macOS
  • Browser (if applicable): N/A
  • Network (Testnet/Mainnet): Mainnet

Error Messages/Logs

N/A — no error output; behavior is incorrect but silent.

Screenshots

N/A — backend/API issue, not applicable.

Additional Context

Failover logic branches on exception type (network-level) rather than on response status more broadly.

Possible Solution

Treat 5xx HTTP responses the same as network errors for failover purposes, with a small retry budget before switching nodes.

Activity

  1. added
    bug
    priority: high
    difficulty: medium
    on Oct 29, 2026
  2. maxx-GENIUS commented on Nov 1, 2026

    @maxx-GENIUS

    Hi team,

    I'm interested in tackling this issue. Here is how I plan to resolve it:

    1. I can implement the contract logic with strict authorization checks, optimized storage footprint, and full simulation test coverage before opening the PR.
    2. Add full test coverage and ensure clean CI verification.

    Feel free to assign this to me and I will have the PR up today.

  3. ranjan1969x commented on Nov 2, 2026

    @ranjan1969x

    Hello maintainers,

    I reviewed the requirements for Horizon/Soroban RPC failover only triggers on network errors, not on 5xx responses from a degraded node. Looking into the issue, governance authorization checks, boundary caps, or state validation need to be enforced across contract invocations. My plan is to implement strict administrative authorization checks (require_auth) and state transition validations, enforce boundary rules and prevent state corruption or reentrancy hazards, and ensure emit comprehensive audit events upon successful state modifications.

    For testing, I'll write contract integration tests verifying both authorized state updates and unauthorized invocation rejections.

    Please assign this to me and I'll submit the PR with passing CI.

  4. GangDev6707 commented on Nov 2, 2026

    @GangDev6707

    Hello @trustflow-protocol team,

    I reviewed the issue for Horizon/Soroban RPC failover only triggers on network errors, not on 5xx responses from a degraded node. Governance authorization checks, boundary caps, or state validation need to be enforced across contract invocations.

    Proposed Implementation:

    1. Implement strict administrative authorization checks (require_auth) and state transition validations.
    2. Enforce boundary rules and prevent state corruption or reentrancy hazards.
    3. Emit comprehensive audit events upon successful state modifications.

    Testing & Verification:
    I will write contract integration tests verifying both authorized state updates and unauthorized invocation rejections.

    Happy to take this on if you can assign it over. Will get a clean PR ready promptly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdifficulty: mediumpriority: highweb3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions