{"id":"XE-0227","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":68,"title":"Volume test pre-notice: bounded GET /blocks/recent rebuild-cost and health-sampler measurement on testnet-0005","area":"node-api","claimed_tier":null,"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-02T14:22:05.995296+00:00","updated_at":"2026-11-14T22:49:46.284265+00:00","source_created_at":null,"told_at":"2026-11-14T22:49:47.564907+00:00","status_changed_at":"2026-11-07T16:13:19.666010+00:00","url":"https://bounty.xe.network/XE-0227","body":"## Volume test pre-notice: bounded `GET /blocks/recent` rebuild-cost and health-sampler measurement on testnet-0005\r\n\r\nPre-notification of a **bounded, single-source, read-only measurement** against the public\r\ntestnet nodes, per the Rules on `/bounty`:\r\n\r\n> Volume testing against the public testnet nodes is authorized; open an issue before a\r\n> sustained campaign so we can watch it and attribute the results to you.\r\n\r\nThis is a campaign notice, not a bug report and not a claim of a vulnerability.\r\n\r\n### What will be measured\r\n\r\n`GET /blocks/recent` rebuilds its snapshot **inside the request** and applies `?limit` only to\r\nthe finished slice, so the server-side work is independent of the page size. The rebuild walks\r\nevery account in the lattice (`api/handler.go:655` → `core/ledger.go:2415`) and re-sorts the\r\nresult slice once per account.\r\n\r\nThe question this campaign answers is whether that rebuild interferes with the node's **own\r\nhealth sampler**. `node/observability.go:195` shows the sampler calls `o.node.GetAllAccounts()`\r\n— the same per-account chain walk — every `SampleInterval` (15 s), and `/health` and `/ready`\r\n**fail** when the newest sample is older than `3 × SampleInterval` = 45 s\r\n(`node/observability.go:483`), with the message *\"the node's internal loops are wedged or\r\nblocked on the ledger\"*.\r\n\r\n### Already known — not claimed here\r\n\r\n- **XE-0220** — the defect report for this endpoint (\"[Medium] api: GET /blocks/recent rebuilds\r\n  the snapshot synchronously (~12s per request) and ?limit= does not reduce the cost\"), filed by\r\n  us on 2026-11-02. This notice covers the *volume measurement* only; no new defect is claimed.\r\n- **XE-0072** / `xe#70` — `GET /accounts` does full-lattice work regardless of `?limit=`, and a\r\n  single client wedges the node's own health sampler (**assessed High**). Different endpoint,\r\n  different code path, no cache and no mutex.\r\n- **XE-0128** / `xe#215` — `GET /frontiers` does full-lattice work regardless of `?limit=`, with\r\n  no result cache. Different endpoint. Its pre-notices are XE-0110, XE-0111 (accounts) and\r\n  XE-0127 (frontiers).\r\n\r\n### Measurements already taken (read-only, single source IP, no writes)\r\n\r\nNode `xe/4f19518` on `ldn.core.test.network`, network `testnet-0005`, lattice ≈ 26,500 accounts\r\nand growing (26,493 on 2026-11-02).\r\n\r\nEvery GET route in the node's OpenAPI document (60 paths, 42 GET operations) was enumerated and\r\ntimed twice. Exactly three routes walk the lattice:\r\n\r\n```\r\nroute                          median latency (2026-11-02)\r\nGET /blocks/recent             11.6 - 13.1 s\r\nGET /accounts                  11.2 - 12.7 s\r\nGET /frontiers                 11.9 - 12.5 s\r\nGET /pending?limit=1            1.1 -  2.2 s\r\nevery other GET route (39/42)     185 ms   (TLS + RTT baseline)\r\n```\r\n\r\nPage size does not change the cost:\r\n\r\n```\r\nGET /blocks/recent?limit=1     -> 11650 ms\r\nGET /blocks/recent?limit=1000  -> 12221 ms\r\n```\r\n\r\n`?limit` is applied after the rebuild, so a client asking for one block still pays for the\r\n1,000-block working set.\r\n\r\nThe endpoint is **single-flight**: `recentMu` is held across the rebuild, so extra callers queue\r\nbehind one rebuild instead of adding one.\r\n\r\n```\r\n3 concurrent GET /blocks/recent -> 12214 / 12194 / 12175 ms, wall 12214 ms   (one rebuild served all three)\r\n3 concurrent GET /accounts      -> 15867 / 16023 / 16014 ms, wall 16023 ms   (no cache, no mutex: each request walks the lattice)\r\n```\r\n\r\nThat asymmetry is why this endpoint needs its own measurement: `/accounts` multiplies the\r\nlattice walks with concurrency, `/blocks/recent` serialises them. Whether the remaining load is\r\nenough to push the sampler toward its 45 s budget is exactly what is not yet known.\r\n\r\n**The sampler's own baseline, measured live.** `GET https://ldn.core.test.network/health` polled\r\nonce a second for 56 s, reported age:\r\n\r\n```\r\n14 -> 15 -> 17 -> 18 ->  4 ->  5 ->  7 ->  8 ->  9 -> 10 -> 12 -> 13 -> 14 -> 15 -> 17 ->  3 ->  4 ->  6 -> ...\r\n```\r\n\r\nThe age cycles between ~3 s and ~18 s on a ~15 s period. The age is stamped when the sample\r\n*starts* (`node/observability.go:176`), so this places the sampler's own full-lattice walk at\r\nroughly 3 s, against a 45 s budget. `/health` and `/ready` returned 200 throughout, with\r\n`sampler_alive`, `sample_present` and `sample_fresh` all passing.\r\n\r\n### What the sustained campaign will add\r\n\r\n1. **Sampler impact** — sustained `GET /blocks/recent?limit=1` at concurrency 1, 4 and 12 for up\r\n   to 5 minutes per arm on `ldn`, sampling `/health` and `/ready` every 2 s, to determine whether\r\n   the sampler's sample age is driven toward or past its 45 s budget and whether the node's own\r\n   health endpoints start returning 503.\r\n2. **Cross-endpoint interaction** — whether `/blocks/recent` load raises latency for a separate\r\n   client session on `/supply` and `/accounts/{address}/balance` (both ≈185 ms when idle).\r\n3. **Recovery** — how long the sample age stays elevated after traffic stops, and how long\r\n   `/health` stays non-OK.\r\n4. **Rebuild-rate amplification** — whether an additional client measurably increases the\r\n   snapshot rebuild cadence above the baseline the public explorer's own 5-second polling\r\n   already causes.\r\n\r\n### Bounds\r\n\r\n- ≤ 12 concurrent connections, ≤ 5 minutes per arm, ≤ 3 arms per node, single source IP.\r\n- Read-only `GET` only. No `POST`, no writes, no malformed input.\r\n- `/health` and `/ready` sampled every 2 s (the probe budget is 20 rps / 100 burst — respected).\r\n- No traffic to the hosting layer (nginx / DNS / website / faucet) — out of scope per the bounty\r\n  page.\r\n- Well under the documented read budget (200 rps / 1000 burst per IP).\r\n\r\n### Attribution\r\n\r\nWallet `64e3ca3f6e9378cd549032de9f087b5496fd4100516c7bdb46c17b00d4220cd4` (testnet-0005,\r\nself-funded from faucet.test.network).\r\nGitHub: targammm. Desk reporter account: `sumun24@gmail.com`.\r\nSame reporter as XE-0220, XE-0128 and XE-0127.\r\n\r\nResults will be posted as a comment on this notice whether or not anything is found, including\r\nthe raw measurements and the measurement script, so the team can reproduce them.","patch_refs":[],"thread":[{"id":106,"source":"web","source_ref":"reporter:68:37ced0746942531c","author":"xe:8e7bb03e","team":false,"body":"## Campaign results — bounded `GET /blocks/recent` volume measurement (notice XE-0227)\n\nAs promised in the notice, here are the results — **including the question that did not reproduce**.\n\n**Method.** Node `xe/4f19518` on `ldn.core.test.network`, network `testnet-0005`, 2026-11-02\n14:23–14:37 UTC. Read-only `GET` only, single source IP, no writes, no malformed input. Three arms\nplus one A/B control, inside the bounds declared in the notice (≤ 12 concurrent, ≤ 5 min per arm,\n≤ 3 arms per node). The monitor sampled `/health`, `/ready` and `/supply` every 2 s (probe budget\n20 rps / burst 100 — respected). Script attached to this notice: `campaign.mjs`; analysis in\n`analyze.mjs`; the A/B in `control-arm.mjs`.\n\n| arm | duration | requests | p50 | p95 | max | `/health` non-200 | `/ready` non-200 | max sample age |\n|---|---|---|---|---|---|---|---|---|\n| c1 | 60 s | 20 | 196 ms | 13,202 ms | 13,202 ms | 0 / 16 | 0 / 16 | 14 s |\n| c4 | 120 s | 158 | 195 ms | 12,533 ms | 12,945 ms | 0 / 25 | 0 / 25 | 15 s |\n| c12 | 180 s | 729 | 195 ms | 12,126 ms | 12,635 ms | 0 / 38 | 0 / 38 | 16 s |\n\n### 1. The health-sampler question — it did not reproduce\n\n`/health` and `/ready` returned **200 on all 79 samples** across the three arms. The reported sample\nage peaked at **14 / 15 / 16 s** against the 45 s budget — the same 3–18 s band we measured idle\nbefore the campaign. No 503, and never the *\"the node's internal loops are wedged or blocked on the\nledger\"* message.\n\nThe reason is in the code already quoted in the notice: `recentMu` is held across the rebuild, so the\nendpoint is **single-flight**. Concurrency scales client-visible latency, not server-side work —\nc1 / c4 / c12 issued 20 / 158 / 729 requests and the p95 stayed at 12.1–13.2 s in all three arms,\nbecause the extra clients queue behind the same rebuild instead of starting their own.\n\n**So the High-tier argument from #70 / XE-0072 does not transfer to this endpoint.** We are not\nclaiming \"a single client wedges the node's own health sampler\" for `/blocks/recent`: on this endpoint\nit does not wedge it.\n\n### 2. What did reproduce — the client-visible stall, and contention on the other lattice walk\n\n- **Client-visible stall (bimodal).** p50 ≈ 195 ms (cache hit) against p95 ≈ 12.5 s (rebuild). A client\n  that misses the 1-second TTL waits out the whole lattice walk, and because the rebuild happens inside\n  the request, every caller queues behind it. The documented contract — *\"served from a snapshot\n  rebuilt at most once per second\"* — does not describe what a client actually experiences.\n- **Contention on the other lattice walk.** `core/supply.go` `SupplyAuditor.walk()` re-walks every\n  account chain when its cache expires, so `/supply` is a **second** lattice-walking endpoint, not a\n  free control. A/B phase — no traffic from us, then traffic from us, then recovery:\n\n```\nidle      balance p50=186ms | health p50=184ms | supply p50=1690ms max=4568ms\nloaded    balance p50=188ms | health p50=185ms | supply p50=5030ms max=8345ms\nrecovery  balance p50=185ms | health p50=184ms | supply p50=1580ms max=5762ms\n```\n\n  `/accounts/{address}/balance` — a genuinely O(1) endpoint — was **unaffected** (185 → 188 → 185 ms),\n  and `/health` was unaffected (184 → 185 → 184 ms). `/supply` went 1,690 ms → 5,030 ms p50. That is\n  contention between two concurrent lattice walks, not a broad node slowdown.\n\n  Caveat, stated plainly: our \"idle\" phase means *no traffic from us*, not *no traffic at all* — the\n  public explorer polls this endpoint every 5 s on its own (as noted in XE-0220).\n\n### 3. Conclusion\n\nThis supports the **Medium** tier already claimed in XE-0220 (\"measurable slowdown under volume\") and\ndoes **not** support High: the node's own health signal stayed green, the cheap endpoints stayed at\n185 ms, and the observable damage is (a) the ~12 s client-visible stall and (b) a roughly 3× slowdown of\nthe other lattice-walking endpoint while a rebuild is in flight.\n\nWe are **not** filing a separate ticket for this. The defect is XE-0220; this notice is the\npre-notification and the measurement record for it.\n\nRaw arm logs (`arm-c1.txt`, `arm-c4.txt`, `arm-c12.txt`, `control-ab.txt`) and the analysis scripts\nare available on request.\n\n— reporter `sumun24`, wallet `64e3ca3f…0cd4`, GitHub `targammm`","created_at":"2026-11-02T14:41:07.694580+00:00"},{"id":3244,"source":"desk","source_ref":"reply:1986","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-0227; it is read like any other.","created_at":"2026-11-14T22:49:46.284265+00:00"}]}