{"id":"XE-0058","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"78","source_url":"https://github.com/xeprotocol/xe/issues/78","reporter_id":25,"title":"api/openapi: GET /pending and GET /accounts silently return only 100 items while the spec promises all and declares no offset/limit (Medium)","area":"node-api","claimed_tier":"medium","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":true,"internal_ref":"","internal_url":null,"status":"accepted","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T13:57:19.890352+00:00","updated_at":"2026-11-10T11:38:20.166105+00:00","source_created_at":"2026-10-26T20:34:30+00:00","told_at":"2026-11-10T00:15:37+00:00","status_changed_at":"2026-10-29T14:04:12.814818+00:00","url":"https://bounty.xe.network/XE-0058","body":"- Suggested tier: Medium (\"inconsistent API responses\", data silently missing), Minor if seen as docs only\n- Area: HTTP API list endpoints, OpenAPI document\n- Found: 2026-10-26, node `xe/92d83d1`, repo master `9787859`, openapi.json 1.0.0\n\n## Summary\n\n`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.\n\nThe 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.\n\n## Evidence\n\nLive, 2026-10-26, through `https://test.network/api/v1`:\n\n```\nGET /pending            -> 100 items\nGET /pending?offset=100 -> 100 items, 0 overlap with the first page\nGET /pending?limit=1000 -> 1000 items\nGET /accounts            -> 100 items\nGET /accounts?offset=100 -> 100 items, 0 overlap with the first page\n```\n\n#65 reports 11,467 pending receives on the network, so the default response shows under 1% of what the docs say it returns.\n\nopenapi.json (1.0.0):\n\n- `/pending` GET: `parameters: []`, summary \"All pending sends\", description \"Returns every unreceived send known to the node, across all accounts.\", 200 description \"All unreceived sends.\"\n- `/accounts` GET: `parameters: []`, summary \"List all accounts\".\n\nCode (`api/handler.go`, master `9787859`):\n\n```go\nfunc (h *Handler) handleGetAllPending(w http.ResponseWriter, r *http.Request) {\n\toffset, limit := parsePagination(r)\n\tpage := paginateSlice(h.node.GetAllPending(), offset, limit)\n```\n\n```go\nfunc (h *Handler) handleGetAllAccounts(w http.ResponseWriter, r *http.Request) {\n\toffset, limit := parsePagination(r)\n```\n\n## Steps to reproduce\n\n```sh\ncurl -s https://test.network/api/v1/pending | jq length                 # 100\ncurl -s 'https://test.network/api/v1/pending?offset=100' | jq length    # 100, different items\ncurl -s https://test.network/api/v1/accounts | jq length                # 100\ncurl -s 'https://test.network/api/v1/accounts?offset=100' | jq length   # 100, different items\n```\n\n## Impact\n\n- 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.\n- Clients generated from openapi.json cannot page at all, because `offset` and `limit` are not declared, and there is no way to learn the total.\n- No fund risk.\n\n## Suggested fix\n\n1. Declare `offset` and `limit` on `/pending` and `/accounts` in openapi.json, and reword \"every\" / \"all\" to \"paginated, 100 by default, 1000 max\".\n2. Ideally return a total (or a `next` offset), as `/statechain/blocks` already does with `block_count`.\n\n## Payout\n\nXE address: `6591eab453dbd93b27e2cd674712f94b42d9e7e4d52980b966fa6da4ccd832dc` (same as #75).\n","patch_refs":[{"id":146,"repo":"xeprotocol/xe","kind":"pr","ref":"124","title":"fix(api,node,store): optimize GET /accounts pagination, prevent full-chain deserialization, and align pagination contract (#70, #78)","url":"https://github.com/xeprotocol/xe/pull/124","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-10-29T13:57:30.091343+00:00"}],"thread":[{"id":1566,"source":"github","source_ref":"6755091160","author":"XE desk","team":true,"body":"Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is\nupdated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0058.","created_at":"2026-11-10T00:15:37+00:00"}]}