Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário
Check indexer lag with get_indexer_tip before signingPráticoDe uma correção
De uma correção · Verificação: em parte certa · Verificada em 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.
Porque importa: 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.
Padrão
readIndexerTip: async (r) => BigInt((await r.call("get_indexer_tip", [])).block_number),Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- 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
- Conceitos
- Indexer queries and cell collection, Network and RPC reliability, Transaction building and fees
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-10
- Última mudança
- 2026-11-10
- Última verificação
- 2026-11-19
- Verificação contra o commit
- em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga
Fontes (1)
- 2026-11-10 · toastmanAu/daowow · mais deste projeto
Mais sobre 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"
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.