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
rpc::call("tx_pool_info", json!([]))?["tip_hash"] == *expectedTirado 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)
- 2026-10-10 · Tactus-Labs/tactus-o1 · mais deste projeto
Mais sobre 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
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.