CKB Pulse

Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário

get_consensus dao_type_hash is the DAO code hash, not the DAO type script hashPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 2026-11-19

The dao_type_hash field returned by the get_consensus RPC is the native Nervos DAO code hash (used with hash_type type, args 0x). A contract that checks deposits with load_cell_type_hash needs the hash of the whole script, ccc Script{codeHash: dao_type_hash, hashType: "type", args: "0x"}.hash() (0xcc77c4de... on testnet); committing the raw dao_type_hash makes every deposit fail the check.

Porque importa: If a config pins the raw code hash, no deposit's type script hashes to it, so the node rejects every aggregate with -28 on Inputs[0].Type and the round can never aggregate; its entries have to be refunded after the deadline.

Padrão

Preferir
const nativeDao = ccc.Script.from({ codeHash: (await rpc("get_consensus", [])).dao_type_hash, hashType: "type", args: "0x" }); const daoTypeHash = nativeDao.hash();

Tirado do commit, encurtado.

Um teste mudou no mesmo commit

Está ao lado da correcção. Nós não o corremos.

Conceitos
Cell deps and script lookup, Data encoding (molecule, hex, bigints)
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-05
Última mudança
2026-11-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)

Mais sobre CKB node, RPC and indexer

Ver as 45 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
LusoCryptoLabs, "get_consensus dao_type_hash is the DAO code hash, not the DAO type script hash", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/get-consensus-dao-type-hash-is-the-dao-code-hash-not-the-dao, CC BY 4.0, last changed 2026-11-10.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.