CKB Pulse

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

Check indexer lag with get_indexer_tip before signingWorkingFrom one fix

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

The built-in CKB indexer can trail the chain tip, so cells it returns may be stale. Before signing, compare the block_number from get_indexer_tip with the height from get_tip_header, show a notice when the gap is large, and refuse to sign while it is. daowow flags the indexer as lagging when it is more than 8 blocks behind, and its entry, refund and claim guards refuse to proceed in that state.

Why it matters: Without this check, a transaction can be built and signed on stale indexer cells that may already be spent or changed, so the user signs against a picture of the chain that is no longer true.

Pattern

Prefer
readIndexerTip: async (r) => BigInt((await r.call("get_indexer_tip", [])).block_number),

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, Transaction building and fees
Evidence
From one fix: from one project, checked against its commit
First seen
2026-11-10
Last changed
2026-11-10
Last checked
2026-11-19
Check against the commit
partly right: a true core, with a part that is loose or too wide

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, "Check indexer lag with get_indexer_tip before signing", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/check-indexer-lag-with-get-indexer-tip-before-signing, CC BY 4.0, last changed 2026-11-10.

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.