All lessons · Rust scripts and ckb-std · Start here · Glossary
Check that a derived successor type args match the spent cell's type argsWorkingFrom one fix
From one fix · Check: partly right · Checked 2026-11-19
When a successor cell's type args are derived from other data (such as a config commitment) instead of copied from the spent input, compare them with the input cell's own type args before building. A mismatch (for example a config cell paired with a shard from another round) puts the input's type script group in the transaction with no output, so the type script runs as a burn and typically fails with an opaque error code. Read output.type.args during cell discovery and throw a clear client error on mismatch.
Why it matters: A shard paired with a config from another round builds a transaction the contract rejects as BadState with no explanation of the cause.
A test changed in the same commit
It sits next to the fix. We did not run it.
- toastmanAu/daowow:
apps/web/test/codec.test.js,apps/web/test/discovery.test.js,apps/web/test/entry-tx.test.js
- Concepts
- Transaction building and fees, Cell deps and script lookup
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-09-23
- Last changed
- 2026-09-23
- 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)
- 2026-09-23 · toastmanAu/daowow · more from this project
More about Rust scripts and ckb-std
- Delegating script validation via exec to a hash bound cell dep
- Iterating group inputs and outputs with ckb-std until IndexOutOfBound
- Partial load of a cell's type Script header to match code_hash and hash_type
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Check that a derived successor type args match the spent cell's type args", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/check-that-a-derived-successor-type-args-match-the-spent-cel, CC BY 4.0, last changed 2026-09-23.