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
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.
- toastmanAu/daowow:
apps/web/test/aggregate-tx.test.js,apps/web/test/lifecycle-rules.test.js - toastmanAu/daowow:
apps/web/test/app-shell.test.js,apps/web/test/entropy-derive.test.js,apps/web/test/model-entry-guard.test.js,apps/web/test/model-refund-guard.test.js,apps/web/test/model-route.test.js
- 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)
- 2026-10-05 · toastmanAu/daowow · mais deste projeto
- 2026-11-10 · toastmanAu/daowow · mais deste projeto
Mais sobre CKB node, RPC and indexer
- Check chain-wide script users before consuming a deployed code cell
- Decoding the packed epoch field (number, index, length)
- Nervos DAO compensation from the header's accumulated rate (AR)
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.