Bounty
XE-0058 · Bounty

api/openapi: GET /pending and GET /accounts silently return only 100 items while the spec promises all and declares no offset/limit (Medium)

Accepted claimed Medium xe#78 filed 2026-10-26 20:34 UTC by BoomGone

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 master 9787859, 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):

  • /pending GET: parameters: [], summary "All pending sends", description "Returns every unreceived send known to the node, across all accounts.", 200 description "All unreceived sends."
  • /accounts GET: 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 offset and limit are not declared, and there is no way to learn the total.
  • No fund risk.

Suggested fix

  1. Declare offset and limit on /pending and /accounts in openapi.json, and reword "every" / "all" to "paginated, 100 by default, 1000 max".
  2. Ideally return a total (or a next offset), as /statechain/blocks already does with block_count.

Payout

XE address: 6591eab453dbd93b27e2cd674712f94b42d9e7e4d52980b966fa6da4ccd832dc (same as #75).

Thread

XE deskteam2026-11-10 00:15 UTCgithub

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.