Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário
Simulating a real CKB reorg with two devnet nodes over P2PAvançadoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
To exercise genuine fork choice on a Dummy devnet, partition two nodes with set_network_active(false) plus remove_node, wait until get_peers is empty on both, then mine a longer competing branch on one node with generate_block. Reconnect with set_network_active(true) and add_node(node_id, /ip4/.../tcp/port), and wait until both nodes report the same get_tip_header hash and the same tx_pool_info tip_hash before checking reorg recovery.
Porque importa: Without a confirmed partition the peer simply syncs the main branch and no competing fork forms. Without waiting for both the tip hash and tx_pool_info tip_hash to converge, reorg checks such as liveness, recovery and dependency rejection run against a node that has not yet switched branches or refreshed its pool.
Padrão
rpc::call_at(peer, "add_node", json!([info["node_id"], address]))?;Tirado do commit, encurtado.
- Conceitos
- Testing and devnet, Network and RPC reliability
- 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
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (2)
- 2026-10-10 · Tactus-Labs/tactus-o1 · mais deste projeto
- 2026-10-10 · Tactus-Labs/tactus-o1 · mais deste projeto
Mais sobre CKB node, RPC and indexer
- get_transaction returns an object with a null transaction for rejected and unknown txs
- CKB log subscription notifications may carry params.result as a JSON string
- Wait for tx_pool_info tip to match chain tip before submitting on devnet
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Simulating a real CKB reorg with two devnet nodes over P2P", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/simulating-a-real-ckb-reorg-with-two-devnet-nodes-over-p2p, CC BY 4.0, last changed 2026-10-10.