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.

Prático

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

Página 15 de 15

Filter prefix get_cells results by data length before decodingPráticoDe uma correção

A get_cells query with script_search_mode "prefix" and args "0x" returns every live cell whose script has that code hash and hash_type, whatever its args, so it can include cells of the same script with a different data layout (for example a script that owns both a state cell and a ledger cell). Check output_data length, or catch the decode error, and skip the cell before calling a strict decoder. Otherwise one unexpected cell throws and the whole result list is lost.

#Indexer queries and cell collection #Data encoding (molecule, hex, bigints) · Fontes (1) · 2026-09-18

Indexer RPC module must be listed in ckb.toml rpc modules for get_cells on devnetPráticoDe uma correção

CKB serves get_cells, get_indexer_tip and the other indexer RPC methods only when "Indexer" is listed in the [rpc] modules array of ckb.toml. The ckb.toml generated in the nervos/ckb 0.209.0 devnet image used here leaves Indexer out, so add it before relying on cell collection against a devnet node. Then confirm with a real indexer call such as get_cells after the node starts.

#Indexer queries and cell collection #Testing and devnet · Fontes (1) · 2026-09-18

Never pass the terminal "0x" cursor back to indexer get_cellsPráticoDe uma correção

An exhausted indexer get_cells scan returns {objects: [], last_cursor: "0x"} (captured from a real node). The authors report that calling get_cells again with after = "0x" then returns nothing, even once matching cells exist, and a hand-written mock that never returned the real "0x" hid this for days. When paging, stop on an empty page before reading last_cursor, and never send or persist a "0x" cursor. Build paging tests from captured node responses, not hand-written mocks.

#Indexer queries and cell collection #Testing and devnet · Fontes (1) · 2026-09-18

Restrict script hashType to data, type, data1, data2 when loading configPráticoDe uma correção

CKB hash_type encodes as data=0, type=1, data1=2, data2=4 (no value 3), so a config loader should reject any hashType string outside data/type/data1/data2 rather than map it loosely. A wrong code hash or hash type makes cell discovery watch the wrong cells and silently return empty results.

hash_type validation, not covered

#Cell deps and script lookup #Data encoding (molecule, hex, bigints) · Fontes (1) · 2026-09-18

ckb-cli deploy gen-txs does not check the block size limitPráticoDe uma correção

`ckb-cli deploy gen-txs` checks capacity and reports success even when the deployment transaction exceeds the 597,000 byte block size limit; the node only rejects it at broadcast with ExceededMaximumBlockBytes. When deploying several large contract binaries, sum their sizes before signing and split them across separate deployment configs (sending each transaction only after the previous one confirms) if they approach the limit.

#Transaction building and fees #Capacity and cell size · Fontes (1) · 2026-09-18

Emit shannon u64 values as strings in cross-language test vectorsPráticoDe uma correção

When generating JSON test vectors in Rust for JavaScript decoders of CKB cell data, emit u64 fields (such as shannon amounts) as strings, because JSON numbers are IEEE-754 doubles and values above 2^53 would be silently rounded. Use distinct, non-zero field values so a decoder reading the wrong offset gives a visibly wrong result.

#Testing and devnet #Data encoding (molecule, hex, bigints) · Fontes (1) · 2026-09-18

Página 15 de 15

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.