Skip to content

No retry/backoff for transient Soroban RPC failures #8

Description

@DeFiVC

What

getLatestLedger has no try/catch; a network error propagates to the outer catch which logs and sleeps for a fixed pollIntervalMs (5s). If the RPC is down for hours, the indexer hammers it every 5 seconds with no exponential backoff. Similarly, fetchContractEvents catches RPC errors and returns an empty array — no retry within the same cycle.

Why

A single failed RPC call wastes the entire cycle for that contract. No circuit breaker exists to pause requests during prolonged outages.

Scope

  • Add exponential backoff for RPC failures
  • Implement a circuit breaker pattern
  • Retry failed RPC calls within the same cycle

Acceptance Criteria

  • RPC failures trigger exponential backoff
  • Prolonged outages don't cause rapid retry loops
  • Failed RPC calls are retried within the same cycle

Technical Context

  • File: src/indexer/event-listener.ts, lines 115-119, 128-131
  • Consider using the cockatiel library (already used in chainlearn-api)

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions