Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário
Passing a pipe to a spawned child script via a zero-terminated inherited_fds listAvançadoDe uma correção
De uma correção · Verificação: em parte certa · Verificada em 2026-11-19
When a lock spawns a verifier script from a cell dep with ckb-std 1.1.0 syscalls::spawn, it creates a pipe and passes the read fd in SpawnArgs.inherited_fds as an array ending in 0. After writing the full request, the parent closes write_fd so the child's read returns 0 or OtherEndClosed (end of input), then uses syscalls::wait(pid) == 0 as the verification result.
Porque importa: If the parent never closes the write end, the child's final end-of-input read cannot return 0 or OtherEndClosed, so the verifier rejects the request as malformed or blocks waiting for data.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- toastmanAu/ckb-crypto-agile-account-reference-v0.1:
crates/host/tests/abi_v1_conformance.rs,crates/host/tests/config.rs,crates/host/tests/encoding.rs,crates/host/tests/identity.rs,demo/test/browser/demo.spec.ts
- Conceitos
- Cell deps and script lookup, Other
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-22
- Última mudança
- 2026-10-22
- Última verificação
- 2026-11-19
- Verificação contra o commit
- em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga
Fontes (1)
Mais sobre Rust scripts and ckb-std
- Enable molecule bytes_vec so ckb-std scripts contain no atomic instructions
- Check that a derived successor type args match the spent cell's type args
- CKB VM2 READ and INHERITED_FDS syscalls take a length pointer and return status in a0
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Passing a pipe to a spawned child script via a zero-terminated inherited_fds list", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/passing-a-pipe-to-a-spawned-child-script-via-a-zero-terminat, CC BY 4.0, last changed 2026-10-22.