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
rpc::call("tx_pool_info", json!([]))?["tip_hash"] == *expectedTaken 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)
- 2026-10-10 · Tactus-Labs/tactus-o1 · more from this project
More about Developer tooling
- ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the field
- Derive devnet Spore and system script cell deps from a fresh OffCKB export
- Pass wasm bytes to ckb-vm-js createVerifier in Node
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.