CKB Pulse

All lessons · CKB node, RPC and indexer · Start here · Glossary

Use indexer matched cell indexes to limit input parent fetchesWorkingFrom one fix

From one fix · Check: right · Checked 2026-11-19

With CCC client.findTransactionsPaged (scriptSearchMode 'prefix', groupByTransaction: true), each returned transaction has a cells list of {isInput, cellIndex} entries for the cells that matched the searched script. If your logic only needs the matched inputs, fetch parent transactions with getTransaction only for those indexes (plus siblings from a parent you already hold) and skip unrelated inputs such as wallet funding. OpenSwap's market scanner did this together with raising read concurrency to 16, and its first scan went from about 8 to 10 s to about 5.3 s; the gain from this change alone was not measured.

Why it matters: Without it, every input's parent transaction is fetched with getTransaction, including wallet funding cells the logic never uses, which multiplies RPC reads and slows the scan.

Pattern

Prefer
for(const c of t.cells)if(c.isInput)f.inputs.add(Number(c.cellIndex));

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Indexer queries and cell collection, Network and RPC reliability
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-29
Last changed
2026-10-29
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)

More about CKB node, RPC and indexer

All 45 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "Use indexer matched cell indexes to limit input parent fetches", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/use-indexer-matched-cell-indexes-to-limit-input-parent-fetch, CC BY 4.0, last changed 2026-10-29.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.