Bounty
XE-13265 · Bounty

[Re-report] XE-0072 still unfixed at HEAD 89a542e: GET /accounts does full-lattice work regardless of ?limit=

Closed · invalid —claimed High xe#402 filed 2026-11-11 18:57 UTC by zvsvev

Report

[Re-report] XE-0072 still unfixed at HEAD 89a542e: GET /accounts does full-lattice work regardless of ?limit=

Original ticket: XE-0072 — "api: GET /accounts does full-lattice work regardless of ?limit=, and a single client wedges the node's own health sampler (High)" Original status: awarded, verdict valid, assessed High, award 3,500 XE (GitHub issue xeprotocol/xe#70, internal ref xeprotocol/core#1030) This report: re-report — the defect is still present in the public repo snapshot. It is NOT a new bug. Filed in the style of XE-0608 (patched-but-still-broken).

Claimed fix and why it did not land

The ticket's only patch ref is xeprotocol/xe PR #124 ("fix(api,node,store): optimize GET /accounts pagination, prevent full-chain deserialization, and align pagination contract (#70, #78)"). Verified 2026-11-11: PR #124 is still OPEN, never merged (gh pr view 124, state OPEN, mergedAt null). The parallel fix fork was never PR'd. No fix symbols exist in the repo: grep for GetAccountsPage|GetAccountChainLength|accountsSortCache returns 0 results.

Still broken at HEAD 89a542e ("release: testnet-0005 quorum withhold fix")

  • api/handler.go:628-646 (handleGetAllAccounts): calls h.node.GetAllAccounts() first, then sorts the full result and slices [offset:end]. ?limit= does not reduce the work.
  • node/node.go:993 (GetAllAccounts()): iterates every frontier and calls n.Ledger.GetChain(account) + n.Ledger.GetAssetBalances(account) per account — a full read + JSON unmarshal of every block in every chain (core/ledger.go:2374).
  • node/observability.go:195: the node's own health sampler calls the same GetAllAccounts(), so one client can wedge the node's own health reporting.
  • No caching, no pagination pushdown, no snapshot anywhere on this path.

Reproduction (read-only, single requests — do not loop)

curl -w "HTTP %{http_code}, total %{time_total}s, size %{size_download} bytes" \
  "https://ldn.core.test.network/accounts?limit=1"

Measured on testnet-0005, 2026-11-11 (three independent measurements):

  • 2.89 s for one 276-byte row
  • 1.65 s for one 276-byte row
  • 1.03 s for one 276-byte row (this filing, 2026-11-11 ~23:5x WIB)

?limit=1000 takes near-identical time, proving the cost is the full scan, not the response size. Live testnet has ~30,170 accounts (per XE-0818). The read rate limiter allows 200 req/s/IP (burst 1000), so a single IP can keep the node permanently re-reading the lattice.

Impact

Same as the original assessment: unauthenticated, sustained CPU + Badger-read saturation degrading consensus/block ingestion on a public core node, plus wedging the node's own health sampler. Suggested severity: High (same defect, same impact as the original 3,500 XE award).

Duplicate check performed 2026-11-11

Board API /v1/tickets?q=accounts&status=open&limit=200 — 126 tickets scanned. Only per-endpoint variants exist (XE-6825 /frontiers, XE-5964 /balance, XE-6204 POST /blocks/*, XE-6827 /providers, XE-5753 /pending/{address}, XE-4637 /node, XE-0220 /blocks/recent); no re-report of the GET /accounts list endpoint. XE-2992 is a campaign notice for /accounts/{address}/chain, not this endpoint. Residual risk, stated honestly: tickets beyond the board's search index cannot be fully excluded.

Environment

  • Repo: github.com/xeprotocol/xe, HEAD 89a542e, Go 1.25
  • Node: ldn.core.test.network, network testnet-0005

Thread

XE deskteam2026-11-20 00:24 UTCgithub

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links https://bounty.xe.network/XE-13265 and says what; it is read like any other.