{"id":"XE-0019","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"40","source_url":"https://github.com/xeprotocol/xe/issues/40","reporter_id":12,"title":"Volume test pre-notice: bounded SSE concurrency test on /chat/events (2026-10-25 07:00 UTC)","area":"ops-testnet","claimed_tier":null,"assessed_tier":null,"verdict":"notice","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"answered","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T13:57:16.083050+00:00","updated_at":"2026-11-10T00:11:56.017735+00:00","source_created_at":"2026-10-25T06:55:44+00:00","told_at":"2026-11-08T20:37:36+00:00","status_changed_at":"2026-10-29T14:22:11.306176+00:00","url":"https://bounty.xe.network/XE-0019","body":"## What this is\n\nPre-notification of a **bounded, single-source volume test** against the public\ntestnet node, per the Rules on `/bounty`:\n\n> Volume testing against the public testnet nodes is authorized; open an issue\n> before a sustained campaign so we can watch it and attribute the results to you.\n\nFiled **before** sending any traffic so you can attribute it and tell me to hold\nif the window is inconvenient. Measurements and the finding write-up will be\nposted in this same issue afterwards. Testnet only — no mainnet, no\nhosting-layer/volumetric DDoS, no writes.\n\n## Hypothesis (from source review, not yet executed)\n\n`GET /api/v1/chat/events` appears to accept an unbounded number of concurrent SSE\nstreams per client, and every stream subscribes to the node-wide chat bus:\n\n- `api/chat.go` → `handleChatEvents`: calls `h.node.SubscribeChat()` on **every**\n  connection, then filters by `account` in-process (`msg.From != account &&\n  msg.To != account`). No concurrency cap, no per-IP/per-account stream quota,\n  no backpressure, no slow-reader eviction.\n- `api/handler.go` → `rateLimitMiddleware`: the read limiter (1000 per 5 s, burst\n  1000) only counts **stream establishment**, not stream lifetime — long-lived\n  streams are effectively unmetered.\n- `api/chat_auth.go` → `verifyProof`: each challenge is correctly burned (`s.seen`\n  nonce dedupe), so N streams need N challenges — but\n  `GET /chat/auth/challenge` is itself unmetered and signing is local, so that is\n  not a barrier.\n\nExpected (to be measured): per-connection cost grows linearly; at high concurrent\nstream counts, chat fan-out amplifies CPU/memory and can starve other SSE/API\nclients. Maps to **Track 2 → \"Chat, SSE and API starvation under many concurrent\nclients\"**.\n\nConfirmed without load:\n\n- `GET /api/v1/chat/events` with no ownership proof returns `403 operator\n  endpoint disabled: no admin token configured` — streams are not anonymously\n  reachable; a real keypair is required.\n\n## Planned test parameters\n\n| Item | Value |\n|---|---|\n| Target | `https://test.network/api/v1` (testnet-0005, London node) |\n| Source | **single host, no proxies/VPN** — exact IP not posted publicly; available privately to `security@xe.network` on request |\n| Window | **2026-10-25 07:00–07:15 UTC** (= 15:00–15:15 UTC+8), duration ≤ 10 min |\n| Ramp | 20 → 40 → 60 → 80 → 100 → 120 concurrent streams, `+20` per step |\n| Hold per step | 15 s |\n| **Hard cap** | **120 concurrent streams** (the client refuses to exceed 500 even if re-run with other flags) |\n| Probes | `GET /health` p50/p95, `GET /ready` status, `GET /node` (`finality_advances`, `peer_count`, `dropped_blocks`) |\n| **Abort conditions** | p95 > 2000 ms, or `/ready` != 200, or any 429 → stop immediately, release all sockets, report |\n| Auth | throwaway test keypair, account `18721dee6ea6d86a287ce15a158015dbf1eda282b683b857916c5f091c6f9e5b`, fresh challenge per stream |\n\n## How to attribute the traffic\n\nEvery request in this test carries one extra query parameter, `ref=lufreeking`.\nThe node ignores unknown query parameters, so this changes no behaviour; it only\nmakes my traffic greppable in your access logs:\n\n`GET /api/v1/chat/events?account=18721dee…&pub_key=…&challenge=…&sig=…&ref=lufreeking`\n\n`grep ref=lufreeking` should isolate 100% of it. If you would rather use a\ndifferent tag, say which and I'll switch.\n\n## What I will NOT do\n\n- No traffic against nginx/DNS/faucet/hosting layer.\n- No `POST` / no writes of any kind during this test.\n- No attempt to touch other users' keys, funds, messages or workloads.\n- No ramp beyond 120 concurrent without asking again in this issue.\n\n## What I'd like from you\n\n1. Confirm the window (2026-10-25 07:00 UTC) is fine, or tell me to hold.\n2. If you want a lower cap for the first pass, name the number.\n3. If you have a preferred attribution mechanism, tell me.\n\nThanks — happy to coordinate live if you'd like to watch the node.\n\n— @lufreeking","patch_refs":[],"thread":[{"id":11,"source":"github","source_ref":"6394705871","author":"lufreeking","team":false,"body":"## Observation before any load: node already not_ready\n\nStopped at the baseline step, before sending more than a single SSE stream.\n`/ready` was already failing **before** any load from me:\n\n- `finality_stall_seconds` ≈ 2890 s; `last_finality_ns` = 1792909096804739599\n  → last finality advance ≈ **2026-10-25 06:18:16 UTC**, i.e. ~42 min before my window\n- `active_representatives`: 0 of 1; `quorum_margin_ratio`: -0.67\n- `unfinalized_positions`: 140; `conflicts_open`: 2\n- `quorum_reachable` and `finality_advancing`: both false\n  (\"NO representative has voted in the last 10m0s\")\n\nConfirmed this is **not** my `ref=` tag: `/ready` returns an identical body with\nand without `?ref=lufreeking`.\n\nSince the node is degraded before I send anything, any latency or finality number\nI measure now cannot be attributed to SSE concurrency — so I aborted rather than\nadding load. No further traffic from me until you say otherwise.\n\nTwo questions:\n\n1. Is this stall expected (e.g. the single representative is offline / planned\n   maintenance), or an incident you are already tracking?\n2. Should I wait for `/ready` to return 200 and re-test, or run anyway with the\n   existing degradation recorded as the baseline?\n\nI'll announce a new window here before sending any volume.","created_at":"2026-10-25T07:07:27+00:00"},{"id":1216,"source":"github","source_ref":"6726805827","author":"Joseph Denne","team":true,"body":"Thanks for the notice and for stopping at the baseline when `/ready` was already failing; that was the right call. The stall you observed was a node-side finality incident already being handled, not anything you sent. The SSE concurrency hypothesis stands as its own question and was not tested. This issue closes as answered; if you want to run the bounded test now that the node is healthy, post a fresh notice and go ahead.","created_at":"2026-11-08T20:37:36+00:00"}]}