CKB Pulse
Lições

O que a CKB aprendeu

Começa aqui · Glossário · Testa-te · Feed

As lições estão escritas em inglês, por isso pesquise em inglês.

#Network and RPC reliability

37 lições encontradas. Todas as lições

Página 1 de 4

send_transaction error -1111 (PoolRejectedRBF) is a conflict, not "already in pool"PráticoVerificada pelo dono

CKB's send_transaction returns -1107 when the same tx is already in the pool, but -1111 (PoolRejectedRBF) when a different pool tx spends one of its inputs and this tx cannot replace it. Treating -1111 like -1107 makes a client resend a tx whose input is gone and only notice the failure much later. Fiber now reports it as a conflict (failing a funding tx at once) while closing txs keep the old handling.

#Network and RPC reliability #Transaction building and fees · Fontes (2) · 2026-11-18

CCC client cache can keep dropped transactions; check status without cachePráticoDe uma correção

A ccc client records the transactions it sends in its cache, so a claim or sweep the chain dropped or rejected stays there with its outputs usable and its inputs spent, which breaks later sends. Check such transactions with client.getTransactionNoCache and treat an undefined result or status "rejected" as dropped. Rebuild that client's cache from the chain before building new sends, and give automated sends their own ccc client so this rebuild does not touch the account's other pending transactions.

Related to the cache clearing and getTransactionNoCache lessons, but adds a distinct remedy: treat undefined or rejected as dropped, and use a separate client for automated sends to isolate its cache.

#Network and RPC reliability #Transaction building and fees · Fontes (1) · 2026-11-17

JoyID sub-key signing needs the COTA aggregator and CSP allowancesPráticoDe uma correção

If you strip external hosts from a CCC bundle or restrict CSP connect-src, keep CCC's COTA aggregator host (cota.nervina.dev) and allow it, because the JoyID signer calls it before signing for sub-key wallets. Also allow the RPC websocket hosts your CCC client uses, such as wss://testnet.ckb.dev.

Low confidence: inferred from the commit message only. The diff showed just a rebuilt bundle.

#Witnesses and signatures #Network and RPC reliability · Fontes (1) · 2026-11-16

Validate header and epoch lookups before using timestampsPráticoDe uma correção

After get_header_by_number or get_epoch_by_number, treat a null result as unavailable and check that the returned number equals the one you asked for. To get an epoch's start time, read the header at the EpochView's start_number. Then check that this header's epoch field has the epoch number in its low 24 bits and 0 in bits 24 to 39 (the block's index within the epoch), so the block really is the first block of that epoch.

#Network and RPC reliability #Since and time locks #Data encoding (molecule, hex, bigints) · Fontes (2) · 2026-11-12

Check indexer lag with get_indexer_tip before signingPráticoDe uma correção

The built-in CKB indexer can trail the chain tip, so cells it returns may be stale. Before signing, compare the block_number from get_indexer_tip with the height from get_tip_header, show a notice when the gap is large, and refuse to sign while it is. daowow flags the indexer as lagging when it is more than 8 blocks behind, and its entry, refund and claim guards refuse to proceed in that state.

#Indexer queries and cell collection #Network and RPC reliability #Transaction building and fees · Fontes (1) · 2026-11-10

One prefix get_cells scan per type code hash instead of one scan per roundPráticoDe uma correção

When many logical groups (here rounds) share one type script code hash, query the indexer's get_cells once with script_type "type", args "0x" and script_search_mode "prefix" to get every cell under that code hash, then bucket the cells client side by data length and args. Querying per group repeats the same scan and grows with the group count against a public node. The indexer returns cells in type args order, not age order, so sort the results yourself.

#Indexer queries and cell collection #Network and RPC reliability · Fontes (1) · 2026-11-10

Check original tx unknown and input live on independent nodes before same input cancellationPráticoDe uma correção

Before signing a same-input cancellation for a deployment whose broadcast outcome is unknown, check on two separate RPC endpoints that get_transaction for the original hash returns status 'unknown' and that get_live_cell for the shared input returns 'live', and fail closed if either endpoint errors or times out. Repeat the check before sending. 'unknown' only means the nodes have not seen the tx yet, so the cancellation is a race: if the original is relayed and committed first, the cancellation fails.

#Network and RPC reliability #Transaction building and fees · Fontes (1) · 2026-11-09

CKB log subscription notifications may carry params.result as a JSON stringPráticoDe uma correção

When subscribing to the CKB node's "log" topic over the TCP subscription RPC, the notification's params.result can be a JSON-encoded string of the log entry (message, level, target, date) rather than an object. Parse it with JSON.parse when it is a string, and skip malformed payloads instead of stopping the stream; otherwise script debug output (target ckb_script::verify) is silently dropped.

#Network and RPC reliability #Testing and devnet · Fontes (1) · 2026-11-09

Verify a deployed code cell is canonical and live before recording it as a cell depPráticoDe uma correção

Before writing a deployment manifest for a code cell, this commit checks get_transaction is committed, that get_block_hash at the header number equals the block hash (not reorganized), and that get_live_cell still reports status live with the expected data hash. It then repeats the canonical and live checks after all reads (on two independent RPCs), so a stale, spent or reorganized cell never yields a manifest.

#Cell deps and script lookup #Network and RPC reliability · Fontes (1) · 2026-11-09

Verifying an indexer funding cell against an advancing tip instead of a frozen snapshotPráticoDe uma correção

A frozen-tip check ("the indexer tip must not change during the scan") fails often on a live chain, so do not demand it. Select a single funding cell from get_cells, verify it directly against the node (get_live_cell, get_transaction, get_header, output and data equal to the indexed ones), then re-check at the end that get_block_hash at the starting indexer tip still equals the anchor hash, that the cell's block is canonical, and that the cell is still live. New blocks arriving in between are fine, but still fail closed if the indexer lags the node at the start or the anchor hash changed. This gives one verified input, not a snapshot of the whole wallet.

#Indexer queries and cell collection #Network and RPC reliability · Fontes (1) · 2026-11-09

Wait for get_indexer_tip to reach the commit block before re-reading cellsPráticoVista outra vez

After get_transaction reports tx_status committed, poll get_indexer_tip until its block_number is at least the transaction's block number before calling get_cells. If you query first, the indexer silently returns the pre-transaction cell set with no error.

#Indexer queries and cell collection #Network and RPC reliability · Fontes (4) · 2026-11-09

Classifying sendTransaction failures before dropping a pending CKB transactionPráticoDe uma correção

A failed or timed out ccc client.sendTransaction, or a getTransaction status of "rejected" or "unknown", does not prove the transaction can never commit: a node may have taken it, and "rejected" also covers pool removals such as expiry or a full pool. Store the signed bytes before sending. Drop the pending state only on final refusals (ErrorClientVerification, ErrorClientMaxFeeRateExceeded, TransactionFailedToVerify, PoolRejectedMalformedTransaction), or when an input is not live, the transaction that created that input is committed, and the node no longer holds your transaction as pending, proposed or committed. A not-live input alone is not proof, because CCC's getCellLive also returns not live for a cell the node has not seen. Otherwise resend the stored bytes, treating ErrorClientDuplicatedTransaction and PoolRejectedDuplicatedTransaction as success.

#Network and RPC reliability #Transaction building and fees · Fontes (1) · 2026-11-08

Página 1 de 4

Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. JSON · Queres que uma lição seja mudada ou retirada? Abre um issue.