CKB Pulse

全部经验 · Developer tooling · 从这里开始 · 术语表

Forcing a real CKB devnet reorg via P2P partition RPCs进阶来自一次修复

来自一次修复 · 核对结果:部分正确 · 核对于 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).

为什么重要: 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.

代码模式

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

摘自提交,已缩短。

概念
Testing and devnet
证据
来自一次修复: 来自一个项目,已对照其提交核对
首次出现
2026-10-10
最近改动
2026-10-10
最近核对
2026-11-19
对照提交的核对结果
部分正确:核心属实,但有一部分表述松散或范围过宽

来源(1)

更多关于Developer tooling

查看此主题的全部 35 条

你维护这条经验的来源项目吗?请确认或纠正

引用这条经验
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.

取自公开提交,并对照每条经验的来源提交和项目当前代码做了核对。使用前请先读来源。 文本采用 CC BY 4.0:请署名 LusoCryptoLabs, CKB lessons,并附上经验的链接。 想修改或撤下某条经验?请提交 issue。