Bounty
XE-4502 · Bounty

openapi: /blocks/recent omits `source` (the receive->send link), `amount`, `destination`, `signature`, and declares `finalized` which is never returned

Triaging claimed Medium web filed 2026-11-11 02:26 UTC by flavyn

Report

Summary

GET /blocks/recent is specified as returning objects with {account, asset, balance, finalized, hash, pow_nonce, previous, pub_key, representative, timestamp, type}. The node returns the raw block instead: a send carries amount and destination, a receive carries source, and every block carries signature - none of which is documented - while finalized is documented and never returned.

Steps to reproduce (read-only, no auth)

curl -s 'https://ldn.core.test.network/blocks/recent?limit=1000'

Presence over 1000 returned blocks:

field present documented
signature 1000/1000 no
amount 824/1000 no
destination 824/1000 no
source 176/1000 no
finalized 0/1000 yes
pub_key 3/1000 yes
representative 61/1000 yes

Full key set per type as returned:

send   : account, amount, asset, balance, destination, hash, pow_nonce, previous, signature, timestamp, type
receive: account, asset, balance, hash, pow_nonce, previous, signature, source, timestamp, type

Expected vs actual

  1. source is missing from the schema. It is the only field that says which send a receive settles. A client built from the spec cannot walk the lattice or reconcile balances from this feed: the link is simply not in the contract.
  2. amount, destination, signature are returned and undocumented.
  3. finalized is documented and never returned (0 of 1000). A consumer that gates on it treats every block as unfinalized forever.

Impact

The block feed is the endpoint an indexer or explorer is built on. Following the published contract, such a client silently loses the receive->send link and finality, and gets no error: HTTP 200, well-formed JSON, absent fields. This is a correctness gap in the public API contract with a concrete wrong-data outcome for generated clients, not a remote code path.

Not a duplicate (checked)

Scanned all 891 public tickets for blocks/recent, finalized, pub_key, representative. XE-0220 covers the endpoint's rebuild cost (~12 s per request), XE-0227 is a closed volume pre-notice. Neither covers the response schema.

Suggested fix

Publish the same block schema the POST block endpoints use, so source/amount/ destination/signature appear, and remove finalized from this response schema unless the endpoint actually emits it (it belongs to the block-detail route, api/handler.go:483).

Thread

flavyn2026-11-13 00:30 UTCweb

Refinement of this ticket: finalized is dropped by one serializer, not "never returned"

The title of this report says finalized is "declares finalized which is never returned". That framing is too broad, and it is worth correcting here before triage does it for you. finalized is returned by two other read paths for the very same blocks; only /blocks/recent omits it.

Re-measured 2026-11-13 on ldn.core.test.network.

Same block, three paths

Two send blocks taken from the recent feed and then fetched by hash: 65ce5e22b489ad29…, 1308f1942bf98b11…

Path A — GET /blocks/{hash} → HTTP 200, both samples, keys:

type, account, previous, balance, timestamp, asset, representative,
destination, amount, signature, hash, pow_nonce, finalized

finalized: true on both.

Path B — GET /blocks/recent → the same blocks, keys:

type, account, previous, balance, timestamp, asset, representative,
destination, amount, signature, hash, pow_nonce

finalized: key absent.

Path C — GET /accounts/{address}/chain?limit=2 for the account of recent item 0 (2f5ee5a9…a14f) → block 0 carries finalized: true.

Presence across the whole 1000-item feed

source          107
destination     893
amount          893
representative  242
pub_key           8
memo              8
finalized         0

Every field that any block kind carries does reach the feed. finalized is the only one at zero.

Why this matters for the report

The A-vs-B difference for one hash is exactly this single key, which rules out the reading "the feed returns a deliberately narrower projection". The feed's serializer omits a field its sibling paths include. Two consequences:

  1. The defect is narrower than "never returned" — it is endpoint-specific, and stating it that way makes it harder to refute with curl /blocks/{hash}.
  2. The impact is sharper: a client using the bulk feed (the only high-volume path) can never observe finality, while a client using the per-account chain always can. Identical blocks are represented differently depending on which read path is used.

Block.required is only ["type","account","hash"], so omitting finalized is schema-legal and response validation cannot catch it.

Joseph Denneteam2026-11-15 17:42 UTCdesk

Thanks for the report. We have read it and are checking the published API description against what the node returns. This ticket will be updated as it moves.