Skip to content

RpcEventSource's default startLedger of 0 will likely fail against real Soroban RPC nodes #296

Description

@Idaonoli

Problem

RpcEventSource.getEvents() (horizon-listener/src/eventSource.ts) falls back to startLedger: this.options.startLedger ?? 0 for the very first cursor-less call. Real Soroban RPC nodes only retain events for a limited recent window (commonly ~24h/17,280 ledgers) and will reject or return an error for a startLedger far outside that window — 0 almost always will be.

Why it matters

A caller who omits startLedger (an easy oversight, since it's optional) gets a confusing RPC-level error instead of a clear message from this package explaining that startLedger should be a recent ledger within the node's retention window.

Suggested approach

Either require startLedger (remove the ?? 0 fallback and make it a compile-time-required option), or throw a clear, package-specific error at construction time when it's omitted, pointing to the retention-window documentation (already covered in README per closed issue #82).

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

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions