CKB Pulse

Todas as lições · Developer tooling · Começa aqui · Glossário

Wait for the indexer to reach the block before truncating the devnet chain in reorg testsPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 2026-11-19

In a devnet reorg test, the inclusion status a client reads from the node does not mean your own indexing service has processed that block. Before truncating the chain below block n, poll that service's indexed block number until it reaches n. Otherwise it never sees the block, never records a rollback, and the test times out on slow CI runners.

Porque importa: If the devnet chain is truncated before the off-chain indexer has processed the inclusion block, the indexer never observes the rollback, so a reorg test waiting for one hangs until it times out on slow runners.

Padrão

Preferir
d.server_caught_up(n).await?;

Tirado do commit, encurtado.

Conceitos
Testing and devnet, Indexer queries and cell collection
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-08
Última mudança
2026-10-08
Última verificação
2026-11-19
Verificação contra o commit
certa: a lição sai do commit e continua a valer no código de hoje

Fontes (1)

Mais sobre Developer tooling

Ver as 35 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
LusoCryptoLabs, "Wait for the indexer to reach the block before truncating the devnet chain in reorg tests", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/wait-for-the-indexer-to-reach-the-block-before-truncating-th, CC BY 4.0, last changed 2026-10-08.

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.