Skip to content

Add route scoring to select the optimal path in WaterfallRouter #777

Description

@Kingsman-99

Description

WaterfallRouter tries routes in declaration order and returns the first successful one. It does not score routes by latency, fee, or reliability, so the first-declared route is always tried even when a more efficient one is available.

Acceptance Criteria

  • Each route definition gains an optional score?: number field (higher = tried first; default 0)
  • Routes are sorted by score descending before waterfall execution
  • Ties in score fall back to declaration order
  • Unit tests pass

Context

  • Target file: src/routing/WaterfallRouter.ts
  • Sorting must be stable to preserve FIFO among equal-score routes

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions