Todas as lições · Developer tooling · Começa aqui · Glossário
Mock syscalls must write back output lengthAvançadoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
When a ckb-vm mock or fuzzing syscall layer implements inherited_fds, it must store the fd count back into length_addr with store64 after writing the fd buffer. Otherwise the script reads back the capacity it passed in and treats unwritten slots as fds. ckb-vm-contrib's fuzzing utils lacked this until v1.1.2.
Porque importa: Without the write back, a script running under the mock sees the capacity it passed in as the fd count and diverges from real CKB behaviour.
Padrão
syscall handler writes data to the buffer but never calls machine.memory_mut().store64(&length_addr, wrote_length)- Conceitos
- Testing and devnet
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-16
- Última mudança
- 2026-11-16
- Ú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-11-16 · nervosnetwork/ckb-vm-contrib · mais deste projeto
Mais sobre Developer tooling
- ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the field
- Derive devnet Spore and system script cell deps from a fresh OffCKB export
- Pass wasm bytes to ckb-vm-js createVerifier in Node
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Mock syscalls must write back output length", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/mock-syscalls-must-write-back-output-length, CC BY 4.0, last changed 2026-11-16.