Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário
Molecule table encoding of absent optional fieldsPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
A molecule table or dynvec (Script, CellOutput, WitnessArgs) is serialized as a u32 total size, then one u32 offset per field, then the fields. There is no separate count; readers derive it from the first offset. An absent Opt field takes zero bytes, so its offset equals the next offset, or the total size if it is last. A hand-rolled encoder that inserts a u32 count after the total size, as this commit's dyn_collection does, produces malformed molecule.
Porque importa: An encoder that writes an extra count word shifts every offset, so the node cannot decode the transactions, witnesses or scripts it builds and rejects them.
- Conceitos
- Data encoding (molecule, hex, bigints), Witnesses and signatures
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-09
- Última mudança
- 2026-10-09
- Ú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-09 · Tactus-Labs/tactus-o1 · mais deste projeto
Mais sobre CKB node, RPC and indexer
- Script group hash is the hash of the whole Script, not the code_hash
- 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, "Molecule table encoding of absent optional fields", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/molecule-table-encoding-of-absent-optional-fields, CC BY 4.0, last changed 2026-10-09.