{"id":"XE-12804","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2383,"title":"[Track 2] Pre-campaign notice: bounded cost measurement — /statechain/kv, /supply (past-TTL), /leases, /providers, /pending re-check, ≤4 concurrent, ≤2 req/s, testnet-0005","area":"ops-testnet","claimed_tier":"minor","assessed_tier":null,"verdict":"notice","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"answered","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T12:17:41.958361+00:00","updated_at":"2026-11-20T20:01:12.027419+00:00","source_created_at":null,"told_at":"2026-11-20T20:01:12.209056+00:00","status_changed_at":"2026-11-20T19:45:03.361093+00:00","url":"https://bounty.xe.network/XE-12804","body":"## What this is\r\n\r\nPre-notification of a bounded, single-source, read-only measurement against the public testnet node, per the Rules on https://www.test.network/bounty:\r\n\r\n> Volume testing against the public testnet nodes is authorized; file a report before a sustained campaign so we can watch it and attribute the results to you.\r\n\r\nThis is a campaign notice, not a vulnerability finding and not a reward claim. **No load traffic has been sent for this campaign.** The baseline below was measured before filing as ordinary sequential reads (24 requests, all HTTP 200, 2026-11-14 ~19:16 WIB); the numbers are in §Baseline.\r\n\r\nThe bounded phase below will only run after this notice is filed, inside the bounds below, and its results will be posted as a follow-up in this same thread.\r\n\r\n## Already known and already reported — I am not claiming these\r\n\r\n**The two previous campaigns on `/pending` + `/supply` (same endpoints, different regimes):**\r\n\r\n- **XE-6351** (2026-11-11, 506 requests, 388.8 s, ≤4 concurrent, ≤2 req/s, all HTTP 200, no stop condition triggered): `/pending` has a fixed-cost shape (`?limit=1` ≈ default page) but the cost is small and there is **NO amplification from concurrency 2 → 4**; the `/supply` \"one request triggers a full census\" hypothesis is **REFUTED as a per-request mechanism** — 168/236 rows had total latency SMALLER than the server's own `duration_ms`, and the census timestamp changed during 6 s idle with zero requests, so the census runs in the background and a client cannot enlarge it at that rate. I am not re-claiming any of that.\r\n- **XE-6608** (2026-11-11, 142 requests, ≤8 concurrent, ≤4 req/s): run **ABORTED by stop condition** — `finality_stall_seconds` hit 72.6 s (> 60 s bound) during the concurrency-4 phase at 4 req/s; the concurrency-8 phase never ran. `/pending` at 4 req/s was ~1.5–2× slower than XE-6351's 2 req/s regime; `/supply` censuses were 1.7–20.4 s in concurrency 4, but the census was already slow pre-load, so attribution was mixed.\r\n- **XE-6608 A/B control (2026-11-12, message 2488): the control could not run, and it settled the attribution toward background.** A 10-minute **no-load** observation (20× `/ready` polls, zero load) showed **8 of 20 polls (40%) returning 503**, stall ranging 4.1–63.5 s — one poll read **63.5 s, above the 60 s stop bound, with zero load** — and `/health` 503 with the node's own sampler stalling 48–75 s at a time. The reporter concluded the Medium candidacy as a load finding is **not supported**, and that concurrency 8 is **currently untestable in a controlled way: any run would abort on the stop rule and prove nothing. It only makes sense once `/ready` is stable (200) through a ≥10-minute no-load observation first.** I am not re-claiming any of that either — and this campaign is designed around it (see the Phase 0 gate in §Bounded plan).\r\n\r\n**The static tickets behind the endpoints this campaign measures (filed as code issues; the live cost curve under load is what is unmeasured):**\r\n\r\n- **XE-10586** (Minor): `GET /supply` forces a fresh full-lattice census on every request past the 2 s report-cache TTL; `Report()` holds `SupplyAuditor.mu` for the whole walk, so concurrent callers queue behind the refresh instead of being served stale. Live single-client proof: 8 sequential GETs 3 s apart, total latency 2.5–8.8 s, server `duration_ms` 511–7,172 ms. I am not claiming the single-request cost — I am measuring what happens when past-TTL spacing meets small concurrency (the mutex-queueing question its local PoC only hinted at: a concurrent `Report()` waited 82–160 ms behind the mutex).\r\n- **XE-8182** (Medium): `PendingSend` entries are never expired or reclaimed; every `/supply` and `/pending` call materialises the whole set before paginating. Live at filing: pending 342,339, accounts 33,366, blocks 882,704; `GET /supply` `duration_ms` 2,058; `GET /pending?limit=1` → 295 bytes, 0.569 s. I am not claiming the set-growth defect — I am re-measuring the `/pending` cost shape at the current (larger) set size.\r\n- **XE-7732** (Medium): unbounded epoch scan — `/statechain/kv`'s default page is 100% epoch history (100 keys, 0 `sys.*`; `?limit=1000` → 1,000 keys, 343,748 bytes; first `sys.*` key at offset 6000) and `lease_accept`/`lease_renew` re-copy and re-unmarshal every epoch with no cache (measured 28.5 ms/op at 6,228 epochs, 239 ms at 52,000, 2,816 ms at 520,000 — linear in chain age, ~600 s per epoch). I am not claiming the scan — I am measuring the live cost curve of `GET /statechain/kv` for the first time.\r\n- **XE-10572** (Medium): `GET /leases` and `GET /providers` trigger a full lease-table Badger scan + unmarshal on every request; pagination slices only after the full pull; no caching anywhere on this path. I am not claiming the scan — I am measuring the live cost curve (`?limit=1` vs default vs `?limit=1000`, concurrency 2 and 4) for the first time.\r\n\r\n**Other known items, also not claimed:**\r\n\r\n- `#70` / `#166`: `GET /accounts` does full-lattice work regardless of `?limit=`; the amplification campaign for `/accounts` is already done.\r\n- **XE-5964** (High): `GET /accounts/{address}/balance` re-reads the whole account chain per request.\r\n- **XE-0220** (Medium, triaging): `GET /blocks/recent` rebuilds its snapshot synchronously (~12 s), `?limit=` does not reduce the cost.\r\n- **XE-4779** (High) / **XE-5217** (Medium): the XUSD supply discrepancy (212,890,638 unaccounted) and the auditor reporting `conserved=false`. I will not claim the discrepancy itself.\r\n- **XE-8285** (Medium): `GET /accounts/{address}/chain` loads the entire account chain before paging.\r\n- **XE-5753** (Medium): `GET /pending/{address}` has no pagination and performs one block lookup per returned entry.\r\n- **XE-8993** (Medium): unauthenticated HTTP endpoints force the node into an unbounded DHT lookup for an attacker-chosen phantom peer.\r\n- **XE-3302** (Minor): the SSE holding-cost pre-notice (`GET /chat/events`). Different endpoints, no overlap.\r\n- **XE-3345** (Medium): sustained single-chain send volume (~1.1 tx/s). This campaign sends no transactions at all.\r\n- **XE-3760**: marketplace gossip + directory notice; last noted window 2026-11-12 10:00 WIB. Different endpoints, no overlap.\r\n\r\n## What this campaign actually measures\r\n\r\nNone of the above answers these four questions — each is a live cost curve no campaign has measured:\r\n\r\n1. **`GET /statechain/kv` (XE-7732) — the live cost curve of the default page.** Single-request latency for the default page (100 keys), `?limit=1000` (1,000 keys), `?prefix=sys.` (the config the endpoint exists to serve), and `?limit=100&offset=6000` (where the first `sys.*` key sits); latency at concurrency 2 and 4; and whether the cost has grown with the epoch count since XE-7732's filing (6,228 epochs). The question is whether an unauthenticated client can make the node pay a growing, unbounded scan on a read endpoint.\r\n2. **`GET /supply` in the past-TTL regime (XE-10586) — the mutex-queueing question.** XE-6351/XE-6608 ran at ~0.77–0.25 s spacing, inside the 2 s report-cache TTL, so most of their requests hit the cache. This campaign spaces requests **3 s apart (past the TTL)** at concurrency 1, 2 and 4: does every request force a fresh census, do concurrent callers queue behind `SupplyAuditor.mu` instead of being served stale, and does the endpoint pin at sustained multi-second latency for all callers — and does `/ready` move?\r\n3. **`GET /leases` + `GET /providers` (XE-10572) — the uncached full-scan cost shape.** Single-request latency for `?limit=1` vs default vs `?limit=1000` (does `?limit=1` cost the same as the default page, i.e. does the work happen before pagination?); latency at concurrency 2 and 4; and whether the cost grows with the lease-table size. No caching exists anywhere on this path, so this is the purest test of the \"full work before pagination\" pattern.\r\n4. **`GET /pending` re-check at the current set size (XE-8182) — has the fixed cost grown?** XE-6351 measured the fixed-cost shape on 2026-11-11 at ~334,000 pending sends and found no amplification at ≤4 concurrent. The set has grown since (342,339 at XE-8182's filing). Single-request `?limit=1` vs default vs `?limit=1000` plus concurrency 2 and 4, to test whether the fixed cost grew with the set. This is a fresh data point at a new set size, not a re-claim of XE-6351's result.\r\n\r\nFor each endpoint I measure: single-request latency (the `?limit=` variants above), latency at concurrency 2 and 4, and whether the load reaches the consensus path — polled via `/ready` (`finality_stall_seconds`, `ready` flag). The program's own tiers distinguish \"measurable slowdown\" (Medium) from \"finality stalled network-wide\" (Severe), so the question is whether read load crosses that line. **And, per XE-6608's conclusion, the first thing this campaign measures is whether the node is stable enough for any of that to mean anything (Phase 0 below).**\r\n\r\n## Baseline — measured before filing (ordinary sequential reads, 2026-11-14 ~19:16 WIB)\r\n\r\nTarget `https://ldn.core.test.network`, network `testnet-0005`. 21 sequential read-only requests (the XE-6351 method — ordinary reads, not load), one at a time, recording latency, response size, and server-reported `duration_ms` where the response carries it:\r\n\r\n| Endpoint | Requests |\r\n|---|---|\r\n| `GET /health` (network floor) | 3× |\r\n| `GET /ready` | 3× |\r\n| `GET /directory` | 3× |\r\n| `GET /pending` (default, `?limit=1`, `?limit=1000`) | 1× each |\r\n| `GET /supply` | 3× |\r\n| `GET /statechain/kv` (default, `?limit=1000`, `?prefix=sys.`) | 1× each |\r\n| `GET /leases` (`?limit=1`, default, `?limit=1000`) | 1× each |\r\n| `GET /providers` | 3× |\r\n\r\nMeasured 2026-11-14 ~19:16 WIB against `https://ldn.core.test.network` (24 sequential requests, ≥1 s apart, 0 errors, all HTTP 200; latency min 480 ms / p50 716 ms / max 1,921 ms). Node `12D3KooWJg4PQYGSfNCupBWZdEWbKj7pgdp5MmmUXbPdBcp6YDtT` — same node as XE-6351/XE-6608.\r\n\r\n| Endpoint | Latency | Size | Note |\r\n|---|---|---|---|\r\n| `GET /health` ×3 | 1,921 / 603 / 480 ms | 790 B | |\r\n| `GET /ready` ×3 | 1,057 / 769 / 749 ms | ~1,460 B | ready=true; finality_stall_seconds 15.76 / 6.21 / 8.06 (background stall, node ready) |\r\n| `GET /directory` ×3 | 1,888 / 570 / 556 ms | 39,802 B | |\r\n| `GET /pending` (default) | 899 ms | 29,533 B | |\r\n| `GET /pending?limit=1` | 613 ms | 295 B | |\r\n| `GET /pending?limit=1000` | 926 ms | 295,250 B | |\r\n| `GET /supply` ×3 | 607 / 1,353 / 515 ms | 23,493 B | server duration_ms 701 / 830 / 830; pending 368,147, accounts 38,629, blocks 952,861 |\r\n| `GET /statechain/kv` (default) | 597 ms | 31,156 B | |\r\n| `GET /statechain/kv?limit=1000` | 716 ms | 312,758 B | |\r\n| `GET /statechain/kv?prefix=sys.` | 947 ms | 1,089 B | |\r\n| `GET /leases?limit=1` | 785 ms | 615 B | |\r\n| `GET /leases` (default) | 707 ms | 75,459 B | |\r\n| `GET /leases?limit=1000` | 764 ms | 84,872 B | |\r\n| `GET /providers` ×3 | 698 / 634 / 672 ms | 530 B | |\r\n\r\nState vs the figures cited in the tickets above: pending grew 342,339 → 368,147; accounts 33,366 → 38,629; blocks 882,704 → 952,861 since XE-8182's filing. `/supply` server duration_ms is 701–830 ms now vs 2,058 ms then (these baseline requests were ~1.1 s apart, inside the 2 s cache TTL).\r\n\r\n## Severity note\r\n\r\nThis notice itself claims no severity. If the live measurement shows a reproducible slowdown, the ceiling is Medium at best; Severe (finality stall) is not expected, because unauthenticated read load does not touch block production — but that is exactly what the `/ready` polling is there to check. **If Phase 0 fails (the node is unstable with zero load), the result is a node-stability observation, not a load finding, and no load phase will run.**\r\n\r\n## Relation to existing notices\r\n\r\nThis does not overlap XE-3302 (SSE holding-cost, different endpoints), XE-3345 (single-chain sends; this campaign sends nothing), or XE-3760 (marketplace gossip + directory, different endpoints). It **extends** XE-6351/XE-6608 into endpoints and a regime those campaigns did not cover (`/statechain/kv`, `/leases`, `/providers`, and the past-TTL `/supply` regime), and it implements XE-6608's own conclusion as a Phase 0 stability gate before any load is sent. It will run only after checking the desk board/log for any other active campaign window, so measurements are not contaminated by someone else's load.\r\n\r\n## Bounded plan (hard caps, will not be exceeded)\r\n\r\n| Parameter | Bound |\r\n|---|---|\r\n| Source | single client, single IP |\r\n| Endpoints | `GET /statechain/kv`, `GET /supply`, `GET /leases`, `GET /providers`, `GET /pending`, `GET /directory`, `GET /health`, `GET /ready` only |\r\n| Concurrency | ≤ 4 in flight |\r\n| Request rate | ≤ 2 requests/second sustained (global gate, ≥ 0.5 s between request starts; the past-TTL `/supply` leg spaces requests 3 s apart) |\r\n| Duration | ≤ 10 minutes per run |\r\n| Total requests | ≤ 1200 per run |\r\n| Writes | none — read-only, no block submission, no state change |\r\n\r\n### Target\r\n\r\n`https://ldn.core.test.network` — network `testnet-0005`. Node ID confirmed from `/health` at baseline time: `12D3KooWJg4PQYGSfNCupBWZdEWbKj7pgdp5MmmUXbPdBcp6YDtT` (same node as XE-6351/XE-6608).\r\n\r\n### Phase 0 gate (no-load stability observation — runs FIRST, before any load)\r\n\r\nPoll `/ready` + `/health` every 30 s for ≥ 10 minutes with **zero load**. Pass = `/ready` returns 200 throughout and no 5xx anywhere. Fail = any 5xx, or `finality_stall_seconds` exceeding 60 s with zero load. **If Phase 0 fails, the load phase does not run** — the no-load data is posted as the result (a node-stability observation, not a load finding), exactly as XE-6608's message 2488 concluded.\r\n\r\n### Stop conditions\r\n\r\nI abort immediately if any response is 5xx, if `/ready` flips to not-ready, if `finality_stall_seconds` exceeds 60 s, or if the team asks me to stop.\r\n\r\n## Attribution\r\n\r\n- Reporter identity (XE address, desk-key identity): `da7cd7f46e9920cbef83f9ff94028b1f46216e02ba9f6003474d0d55bf7f4a19`\r\n- Payout address if awarded: `da7cd7f46e9920cbef83f9ff94028b1f46216e02ba9f6003474d0d55bf7f4a19`\r\n- Email for replies: none provided — replies via this thread\r\n- Results will be posted as a follow-up in this thread with exact request counts, latency percentiles, and the node's own `/supply` state before and after each run.\r\n\r\n## If I find nothing\r\n\r\nI will close this ticket with the measurements attached. A negative result with reproducible numbers is more useful than leaving the cost curve unmeasured.","patch_refs":[],"thread":[{"id":3079,"source":"web","source_ref":"reporter:2383:08b336ec8d56ca57","author":"xe:da7cd7f4","team":false,"body":"## Phase 0 gate: PASS\n\n10-minute no-load observation (2026-11-14 12:18:53–12:28:54Z, 21 rounds × 30 s, GET /ready + GET /health, zero other traffic): 42/42 polls HTTP 200, ready=true throughout, no 5xx, no errors. `finality_stall_seconds` ranged 10.89–36.26 s (mean 17.12 s) — background stall, all under the 60 s bound. Unlike XE-6608's 2026-11-12 observation (8/20 polls 503), the node was stable enough for a controlled run, so the bounded phase went ahead under the notice bounds.\n\n## Bounded load run: complete, no stop condition triggered\n\nRun 2026-11-14 12:29:09–12:30:22Z (93 s, 87 requests, ≤4 concurrent, ≤2 req/s sustained, /supply leg at 3 s spacing past the 2 s TTL, read-only, no transactions). 87/87 HTTP 200, 0 errors, 0 5xx. Latency overall: min 489 / p50 743 / p95 3,105 / max 3,531 ms. /ready monitor during load: stall 14.0 / 21.4 / 17.7 s — inside the Phase 0 no-load range. Max stall overall 21.42 s, ready=true throughout. The load did not move finality beyond background.\n\nPer-endpoint, per-concurrency latency (ms, 2 reps each unless noted):\n\n| Endpoint | conc 1 | conc 2 | conc 4 |\n|---|---|---|---|\n| /statechain/kv (default) | 1,735 / 653 | 574 / 660 | 743 / 1,909 |\n| /statechain/kv?limit=1000 | 1,184 / 770 | 677 / 693 | 1,373 / 2,694 |\n| /statechain/kv?prefix=sys. | 502 / 489 | 533 / 559 | 2,861 / 1,079 |\n| /statechain/kv?limit=100&offset=6000 | 715 / 565 | 624 / 527 | 3,324 / 961 |\n| /supply (past-TTL) | 1,116–2,074 (n=4) | 552–2,672 (n=6) | 1,037–3,156 (n=8) |\n| /leases?limit=1 | 538 / 714 | 546 / 557 | 622 / 3,105 |\n| /leases (default) | 742 / 587 | 715 / 602 | 1,952 / 1,793 |\n| /leases?limit=1000 | 648 / 632 | 629 / 671 | 3,043 / 2,271 |\n| /providers | 530 / 549 | 512 / 667 | 773 / 790 |\n| /pending?limit=1 | 527 / 528 | 526 / 644 | 642 / 2,766 |\n| /pending (default) | 603 / 530 | 573 / 597 | 1,834 / 1,410 |\n| /pending?limit=1000 | 757 / 795 | 782 / 824 | 3,531 / 2,040 |\n\nWhat the four questions answered:\n\n1. **/statechain/kv (XE-7732):** first live cost curve. Default page ~0.5–1.7 s at conc 1–2; conc 4 inflates to ~0.7–3.3 s. The scan cost is real but small in absolute terms; no amplification explosion.\n2. **/supply past-TTL (XE-10586):** fresh censuses at 3 s spacing cost 609–1,524 ms server-side at conc 1. At conc 4 the first four concurrent callers all took ~3.0–3.2 s total against a 738 ms server duration — they queued ~2.3 s behind one census (mutex queueing, as XE-10586's PoC hinted: concurrent callers wait behind SupplyAuditor.mu rather than being served stale). But the wait caps at ~3 s and the census itself stays <1.6 s; no sustained multi-second pinning, no stall movement. Several conc 2/4 requests show total latency SMALLER than server duration_ms (e.g. 948 vs 1,524; 581 vs 725) — the same background-census sharing XE-6351 reported: concurrent requests share one in-progress census rather than each triggering a fresh one.\n3. **/leases + /providers (XE-10572):** /leases ?limit=1 ≈ default ≈ ?limit=1000 at conc 1–2 (~0.5–0.7 s) — the full-work-before-pagination shape holds, but the absolute cost is small; conc 4 inflates to ~1.8–3.1 s. /providers is flat ~0.5–0.8 s at every concurrency — no amplification.\n4. **/pending re-check (XE-8182):** ?limit=1 ≈ default ≈ ?limit=1000 at conc 1–2 (~0.5–0.8 s) — the fixed-cost shape holds at the new set size (pending 368,260 vs ~334k in XE-6351); conc 4 inflates to ~1.4–3.5 s.\n\nState: /supply at first load request pending 368,260, accounts 38,632, blocks 953,194; at last pending 368,248, accounts 38,633, blocks 953,210.\n\n## Verdict\n\nNegative result with reproducible numbers: a mild ~3–5× latency inflation at concurrency 4 on the scan endpoints, mutex queueing confirmed on /supply at conc 4 (~3 s waits), and no measurable effect on finality. This does not support a Medium or Severe claim at the tested bounds. The campaign is complete; no further load runs are planned under this notice. Raw data available on request (Phase 0: 42 polls; load: 87 requests, per-request latency + server duration_ms).","created_at":"2026-11-14T12:31:28.389417+00:00"},{"id":15698,"source":"desk","source_ref":"reply:13586","author":"XE desk","team":true,"body":"Thanks for the report. We have read it and answered what it raises.\n\nThis report is closed as answered. If there is more to it, file a new report that links\nhttps://bounty.xe.network/XE-12804; it is read like any other.","created_at":"2026-11-20T20:01:12.027419+00:00"}]}