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:
- Key Files/Modules:
src/solvers/solvers.service.ts, src/intents/intents.gateway.ts, src/solvers/solvers.controller.ts.
- Design/Architecture: Redis keys with TTL per solver; keyspace notifications or periodic scan for expiry.
- Edge Cases/Constraints: Network partitions of a single replica must not flap all solvers offline.
- 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.
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/markOfflineexist but depend on explicit calls. Dead solvers remain eligible for quotes, causing timeouts and unfilled intents.Scope & Acceptance Criteria:
solver_status_changedand updatelastActiveAt.Implementation Guidelines:
src/solvers/solvers.service.ts,src/intents/intents.gateway.ts,src/solvers/solvers.controller.ts.Definition of "Done": Common DoD.
Resources:
src/solvers/solvers.service.tsCommon Definition of "Done" (applies in addition to the criteria above):
npm run lint,npm run typecheck,npm test,npm run test:e2epass in CI..github/PULL_REQUEST_TEMPLATE, uses a Conventional Commit title (enforced by commitlint), includes test output / metrics screenshots, and references the issue..env.examplevariants andsrc/config/env.validation.ts(thecheck:env-driftscript must pass).