Skip to content

feat: add ws backplane, health probes, and treasury reporting - #345

Open
darcszn wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
darcszn:feature/issue-245-248-backplane-health-fees
Open

feat: add ws backplane, health probes, and treasury reporting#345
darcszn wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
darcszn:feature/issue-245-248-backplane-health-fees

Conversation

@darcszn

@darcszn darcszn commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the multi-instance WebSocket fan-out backbone, separates health probes for liveness vs readiness, and exposes a protocol treasury API for realized fees.

What changed

WebSocket backplane and fan-out

  • Added an opt-in WS backplane configuration with a memory default and a Redis-based pub/sub path for multi-instance deployments.
  • Kept sequencing global and monotonic so replay-based reconnect behavior remains consistent across instances.
  • Avoids requiring sticky routing behind a load balancer while making multi-instance fan-out possible.

Health split

  • Added GET /health/live for process-level liveness checks.
  • Added GET /health/ready for database-aware readiness checks.
  • Preserved GET /health as the combined legacy view for backward compatibility.

Treasury reporting and fee persistence

  • Persisted realized protocol fees at fill time on the Intent record.
  • Added a treasury summary endpoint returning total and 24h realized fees, plus per-source-chain breakdowns.
  • Keep the reporting read-only and aligned to the existing stats surface.

Local developer workflow

  • Added a root docker-compose.yml that provisions Postgres and the app stack together.
  • Updated the developer docs to cover the one-command local setup and the compose-backed DB flow.

Why

The backend currently scales poorly once more than one instance is running behind a load balancer because each process only sees its own in-memory WebSocket subscribers. This change adds a backplane-based fan-out path to keep real-time intent delivery working across replicas.

The separate readiness probe also prevents unnecessary restart loops when the process is still healthy but the database is briefly unavailable.

Finally, the treasury endpoint gives the protocol a concrete reporting surface for realized fee revenue without introducing any on-chain treasury logic.

Notes

  • Default behavior remains in-memory and does not disturb single-instance deployments or the existing test suite assumptions.
  • No co-author added.
  • This PR is intentionally scoped to backend behavior and local development ergonomics.

closes #245
closes #246
closes #247
closes #248

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@darcszn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

1 participant