CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

nervosnetwork/fiber

Lessons from nervosnetwork/fiber

github.com/nervosnetwork/fiber

Do you maintain this project? Confirm its lessons in one issue

3 lessons found. All lessons

send_transaction error -1111 (PoolRejectedRBF) is a conflict, not "already in pool"WorkingChecked by the owner

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 · Sources (2) · 2026-11-18

Reuse one CkbRpcClient across a loop instead of building one per itemWorkingFrom one fix

Constructing a ckb_sdk CkbRpcClient (CkbRpcClient::with_builder) loads the TLS root store, about 6 ms of CPU each time. In Fiber's watchtower, building one per watched channel made a round over 11,496 channels take 93 to 115 s; building one client before the loop and passing &CkbRpcClient cut it to 5 to 7 s.

#Network and RPC reliability · Sources (1) · 2026-11-03

Use raw_data(), not as_slice(), when parsing a packed::Bytes witnessWorkingChecked by the owner

A transaction witness in ckb_types is a molecule packed::Bytes, so as_slice() returns the 4 byte length header followed by the content, while raw_data() returns only the content (here a serialized WitnessArgs). A check that compares a witness to the secp256k1 sighash placeholder WitnessArgs (lock of 65 zero bytes) must use witness.raw_data() (or unpack()), otherwise it is silently never true. Fiber's funding witness merge never recognized placeholders until it switched to raw_data(), so a peer's placeholder could be kept in place of a real signature.

#Data encoding (molecule, hex, bigints) #Witnesses and signatures · Sources (2) · 2026-10-29

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.