CKB Pulse

All lessons · Rust scripts and ckb-std · Start here · Glossary

Passing a pipe to a spawned child script via a zero-terminated inherited_fds listAdvancedFrom one fix

From one fix · Check: partly right · Checked 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.

Why it matters: 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.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Cell deps and script lookup, Other
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-22
Last changed
2026-10-22
Last checked
2026-11-19
Check against the commit
partly right: a true core, with a part that is loose or too wide

Sources (1)

More about Rust scripts and ckb-std

All 35 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.