CKB Pulse

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

Forcing a real CKB devnet reorg via P2P partition RPCsAvançadoDe uma correção

De uma correção · Verificação: em parte certa · Verificada em 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).

Porque importa: 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.

Padrão

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

Tirado do commit, encurtado.

Conceitos
Testing and devnet
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-10
Última mudança
2026-10-10
Última verificação
2026-11-19
Verificação contra o commit
em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga

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, "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.

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.