CKB Pulse

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

Preferir
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.

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)

Mais sobre CKB node, RPC and indexer

Ver as 45 deste tema

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.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.