api/openapi: GET /pending and GET /accounts silently return only 100 items while the spec promises all and declares no offset/limit (Medium)
Report
- Suggested tier: Medium ("inconsistent API responses", data silently missing), Minor if seen as docs only
- Area: HTTP API list endpoints, OpenAPI document
- Found: 2026-10-26, node
xe/92d83d1, repo master9787859, openapi.json 1.0.0
Summary
GET /pending is documented as "All pending sends: Returns every unreceived send known to the node, across all accounts" and GET /accounts as "List all accounts". In openapi.json neither operation declares any parameter, and the response is a bare array with no total, cursor or next link.
The handlers run parsePagination (api/handler.go:604), which defaults limit to 100 (defaultPageLimit, line 575) and caps it at 1000. Both endpoints therefore return exactly 100 items by default and drop the rest with no signal. The other list endpoints (/frontiers, /conflicts, /directory, /reputation, /leases) declare offset and limit and say "paginated"; these two do not.
Evidence
Live, 2026-10-26, through https://test.network/api/v1:
GET /pending -> 100 items
GET /pending?offset=100 -> 100 items, 0 overlap with the first page
GET /pending?limit=1000 -> 1000 items
GET /accounts -> 100 items
GET /accounts?offset=100 -> 100 items, 0 overlap with the first page
#65 reports 11,467 pending receives on the network, so the default response shows under 1% of what the docs say it returns.
openapi.json (1.0.0):
/pendingGET:parameters: [], summary "All pending sends", description "Returns every unreceived send known to the node, across all accounts.", 200 description "All unreceived sends."/accountsGET:parameters: [], summary "List all accounts".
Code (api/handler.go, master 9787859):
func (h *Handler) handleGetAllPending(w http.ResponseWriter, r *http.Request) {
offset, limit := parsePagination(r)
page := paginateSlice(h.node.GetAllPending(), offset, limit)
func (h *Handler) handleGetAllAccounts(w http.ResponseWriter, r *http.Request) {
offset, limit := parsePagination(r)
Steps to reproduce
curl -s https://test.network/api/v1/pending | jq length # 100
curl -s 'https://test.network/api/v1/pending?offset=100' | jq length # 100, different items
curl -s https://test.network/api/v1/accounts | jq length # 100
curl -s 'https://test.network/api/v1/accounts?offset=100' | jq length # 100, different items
Impact
- Any client, explorer or monitoring script that trusts the contract ("every unreceived send", "all accounts") silently works on a 100 item sample: totals, supply checks, "is my send still pending" scans across all accounts, and account counts are all wrong without any error.
- Clients generated from openapi.json cannot page at all, because
offsetandlimitare not declared, and there is no way to learn the total. - No fund risk.
Suggested fix
- Declare
offsetandlimiton/pendingand/accountsin openapi.json, and reword "every" / "all" to "paginated, 100 by default, 1000 max". - Ideally return a total (or a
nextoffset), as/statechain/blocksalready does withblock_count.
Payout
XE address: 6591eab453dbd93b27e2cd674712f94b42d9e7e4d52980b966fa6da4ccd832dc (same as #75).
Thread
Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0058.