Repository navigation
Commit 7a66578
feat(backend): implement horizon failover, transaction index, auth rate limiting, and soroban event streamer (#1073)
- #947: StellarClient keeps a sticky primary plus backup RPC endpoints
(STELLAR_RPC_BACKUP_URLS). Timeouts, connect errors, 5xx and 429 put the
endpoint on a 30s cooldown and fail over immediately to the next healthy
one; backoff applies only after a full pass over the pool.
- #948: Concurrent (zero-downtime) compound indexes on
yield_transactions(user_id, created_at DESC) and
payments(sender_id|receiver_id, created_at DESC), one per no-transaction
migration, plus rollback scripts. The schema has no `transactions` table
or `user_address` column, and the already-applied 20260728000000
migration is left untouched to avoid a sqlx checksum mismatch.
- #949: Auth rate limiter is now a sliding window (10 req/min/IP) backed by
an atomic Redis sorted-set Lua script, falling back to an in-process
sliding window when Redis is unset or unreachable. 429 responses carry
Retry-After.
- #950: indexer::soroban polls getEvents (via the failover client),
decodes events with the indexer parser, and fans them out over a
tokio broadcast channel to WebSocket clients at /api/events/ws. Lagging
consumers skip ahead instead of blocking the producer. Enables axum "ws".
Co-authored-by: maryam <ipcymuhammad1@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 24a5558 commit 7a66578
14 files changed
Lines changed: 1196 additions & 102 deletions
File tree
- backend
- migrations
- rollback
- src
- api
- indexer
- services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments