全部经验 · CKB node, RPC and indexer · 从这里开始 · 术语表
Reading total occupied capacity (U) from the header DAO field实践来自一次修复
来自一次修复 · 核对结果:正确 · 核对于 2026-11-19
The block header `dao` field packs four little endian u64 values (C, AR, S, U), and U at byte offset 24 is the total occupied capacity of all live cells in shannons. This commit reads it from `get_tip_header` to show chain state size, and for a genesis that holds the 8.4 billion CKB cell (mainnet and offckb devnet) it subtracts 5.04 billion CKB counted as occupied because it is due to be burnt, as the CKB Explorer does.
为什么重要: Without decoding U from the DAO field you cannot cheaply show the chain's total occupied state. Without subtracting the genesis cell's 60% occupied share, a mainnet or offckb devnet figure is inflated by 5.04 billion CKB and will not match the CKB Explorer.
代码模式
Buffer.from(header.dao.slice(2), "hex").readBigUInt64LE(24) - this.burnt摘自提交,已缩短。
- 概念
- Capacity and cell size, Data encoding (molecule, hex, bigints)
- 证据
- 来自一次修复: 来自一个项目,已对照其提交核对
- 首次出现
- 2026-10-30
- 最近改动
- 2026-10-30
- 最近核对
- 2026-11-19
- 对照提交的核对结果
- 正确:这条经验出自该提交,并且在今天的代码中仍然成立
来源(1)
- 2026-10-30 · wildanrhmn/ckb-devnet-explorer · 这个项目的更多经验
更多关于CKB node, RPC and indexer
- Nervos DAO compensation from the header's accumulated rate (AR)
- Decoding the packed epoch field (number, index, length)
- Nervos DAO phase 1 withdrawing cells keep the DAO type; count deposits by 8 zero bytes of data
引用这条经验
LusoCryptoLabs, "Reading total occupied capacity (U) from the header DAO field", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/reading-total-occupied-capacity-u-from-the-header-dao-field, CC BY 4.0, last changed 2026-10-30.