All lessons · CKB node, RPC and indexer · Start here · Glossary
Indexer get_cells order is by script args, not by cell ageWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
Cells returned by a prefix search on type script args (as findRounds does here) come back in indexer key order, sorted by type args, not by creation time, so taking the first result does not give the newest cell. To get the latest, sort by a field stored in the cell (here the round config's entryStart).
Why it matters: Taking the first cell of a prefix search picks whichever cell has the smallest script args, not the newest one. Here that was a dead round, so the entry and refund pages could not reach the live round or the round with pending refunds.
Pattern
const round = rounds[0];Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- toastmanAu/daowow:
apps/web/test/discovery.test.js
- Concepts
- Indexer queries and cell collection
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-09
- Last changed
- 2026-11-09
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-11-09 · toastmanAu/daowow · more from this project
More about CKB node, RPC and indexer
- Check chain-wide script users before consuming a deployed code cell
- Filtering get_cells for plain, typeless, empty funding cells
- get_live_cell may return "unknown" rather than "dead" for a spent output
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Indexer get_cells order is by script args, not by cell age", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/indexer-get-cells-order-is-by-script-args-not-by-cell-age, CC BY 4.0, last changed 2026-11-09.