Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário
Reading total occupied capacity (U) from the header DAO fieldPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
Buffer.from(header.dao.slice(2), "hex").readBigUInt64LE(24) - this.burntTirado do commit, encurtado.
- Conceitos
- Capacity and cell size, Data encoding (molecule, hex, bigints)
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-30
- Última mudança
- 2026-10-30
- Ú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 (1)
- 2026-10-30 · wildanrhmn/ckb-devnet-explorer · mais deste projeto
Mais sobre 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
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.