CKB Pulse

All lessons · Developer tooling · Start here · Glossary

Forcing a real CKB devnet reorg via P2P partition RPCsAdvancedFrom one fix

From one fix · Check: partly right · Checked 2026-11-19

To force a real reorg between two Dummy devnet nodes without truncate or submit_block, call set_network_active(false) and remove_node on both, let the main node commit its transactions, then on the peer spend one input that those transactions consume and mine a longer branch with generate_block. Reconnect with set_network_active(true) on both and add_node, and treat convergence as reached only when get_tip_header and tx_pool_info.tip_hash both equal the winning hash on both nodes. Because the peer branch spent that input, the orphan transactions stay out of the chain and the pool, and replaying one of them fails with TransactionFailedToResolve (code -301).

Why it matters: Without a conflicting spend on the winning branch, detached transactions can come back through the tx pool and be recommitted, so no rollback is observed. Without waiting for tx_pool_info.tip_hash, checks may run before the pool has processed the reorg.

Pattern

Prefer
rpc::call("tx_pool_info", json!([]))?["tip_hash"] == *expected

Taken from the commit, shortened.

Concepts
Testing and devnet
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-10
Last changed
2026-10-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)

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, "Forcing a real CKB devnet reorg via P2P partition RPCs", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/forcing-a-real-ckb-devnet-reorg-via-p2p-partition-rpcs, CC BY 4.0, last changed 2026-10-10.

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.