Skip to content

[High] Solver Liveness Heartbeats with Automatic Offline Detection #445

Description

@james2177

Description:
Require authenticated solvers to heartbeat over WS (or REST), track liveness server-side, and automatically mark solvers offline — excluding them from RFQ and routing — after missed heartbeats.

Problem Statement & Context:
markLive/markOffline exist but depend on explicit calls. Dead solvers remain eligible for quotes, causing timeouts and unfilled intents.

Scope & Acceptance Criteria:

  • Heartbeat interval negotiated (default 10 s); offline after 3 misses; liveness shared across replicas (Redis).
  • Solver status transitions emit WS solver_status_changed and update lastActiveAt.
  • RFQ and capability filtering exclude offline solvers.
  • Metrics: live solver count per chain.
  • Out of scope: penalising downtime.

Implementation Guidelines:

  1. Key Files/Modules: src/solvers/solvers.service.ts, src/intents/intents.gateway.ts, src/solvers/solvers.controller.ts.
  2. Design/Architecture: Redis keys with TTL per solver; keyspace notifications or periodic scan for expiry.
  3. Edge Cases/Constraints: Network partitions of a single replica must not flap all solvers offline.
  4. Testing: Fake-timer tests; two-replica integration test.

Definition of "Done": Common DoD.

Resources:

  • Design reference: N/A (backend-only)
  • src/solvers/solvers.service.ts

Common Definition of "Done" (applies in addition to the criteria above):

  • Code written, tested, and documented (TSDoc on public APIs, README/runbook/ADR updates where behaviour changes).
  • All acceptance criteria met; npm run lint, npm run typecheck, npm test, npm run test:e2e pass in CI.
  • PR follows .github/PULL_REQUEST_TEMPLATE, uses a Conventional Commit title (enforced by commitlint), includes test output / metrics screenshots, and references the issue.
  • New env vars are added to .env.example variants and src/config/env.validation.ts (the check:env-drift script must pass).
  • Reviewed and approved by at least one CODEOWNER.

Activity

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

Metadata

Metadata

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