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
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.
- toastmanAu/daowow:
apps/web/test/app-shell.test.js,apps/web/test/dao-yield.test.js,apps/web/test/model-draw-script.test.js,apps/web/test/model-entry-guard.test.js,apps/web/test/model-refund-guard.test.js
- 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)
- 2026-11-10 · toastmanAu/daowow · more from this project
More about CKB node, RPC and indexer
- Reconcile a lost send_transaction response by pinned hash, not by rebuilding
- get_live_cell may return "unknown" rather than "dead" for a spent output
- send_transaction error -1111 (PoolRejectedRBF) is a conflict, not "already in pool"
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.