全部经验 · CKB node, RPC and indexer · 从这里开始 · 术语表
get_consensus dao_type_hash is the DAO code hash, not the DAO type script hash实践来自一次修复
来自一次修复 · 核对结果:正确 · 核对于 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.
为什么重要: 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.
代码模式
const nativeDao = ccc.Script.from({ codeHash: (await rpc("get_consensus", [])).dao_type_hash, hashType: "type", args: "0x" }); const daoTypeHash = nativeDao.hash();摘自提交,已缩短。
同一提交中改动了测试
它与修复在一起,我们没有运行它。
- 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
- 概念
- Cell deps and script lookup, Data encoding (molecule, hex, bigints)
- 证据
- 来自一次修复: 来自一个项目,已对照其提交核对
- 首次出现
- 2026-10-05
- 最近改动
- 2026-11-10
- 最近核对
- 2026-11-19
- 对照提交的核对结果
- 正确:这条经验出自该提交,并且在今天的代码中仍然成立
来源(2)
- 2026-10-05 · toastmanAu/daowow · 这个项目的更多经验
- 2026-11-10 · toastmanAu/daowow · 这个项目的更多经验
更多关于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)
引用这条经验
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.