CKB Pulse

All lessons · Developer tooling · Start here · Glossary

Wait for the indexer to reach the block before truncating the devnet chain in reorg testsWorkingFrom one fix

From one fix · Check: right · Checked 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.

Why it matters: 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.

Pattern

Prefer
d.server_caught_up(n).await?;

Taken from the commit, shortened.

Concepts
Testing and devnet, Indexer queries and cell collection
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-08
Last changed
2026-10-08
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (1)

More about Developer tooling

All 35 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
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.

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.