All lessons · Developer tooling · Start here · Glossary
ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the fieldWorkingChecked by the owner
Checked by the owner · Check: right · Checked 2026-11-19
With ckb-vm-js 0.2.0 from npm, verifyScriptGroup accepts an RPC header in context.tip_header that carries its own hash only when that hash matches the recomputed one, and fails with "header hash does not match" otherwise (the earlier vendored build rejected any `hash` field as unknown). Dropping `hash` before passing RPC headers or transactions remains safe because the verifier recomputes it.
Why it matters: If a header's hash field disagrees with the recomputed hash, verifyScriptGroup fails with a request error ("header hash does not match") rather than running the script, and builds from before npm 0.2.0 failed on any hash field at all.
No existing lesson covers how ckb-vm-js treats a hash field on RPC headers.
Pattern
const { hash: _, ...rest } = o as Record<string, unknown>;Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- LusoCryptoLabs/ckb-ward:
tests/ckbvmjs.test.ts
- Concepts
- Testing and devnet, Data encoding (molecule, hex, bigints)
- Evidence
- Checked by the owner: checked by the owner of the project it came from, who is also the publisher of these lessons
- First seen
- 2026-11-17
- Last changed
- 2026-11-17
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-11-17 · LusoCryptoLabs/ckb-ward · more from this project
More about Developer tooling
- Emit shannon u64 values as strings in cross-language test vectors
- Mirror on-chain rules off-chain with mutation tests
- Mock transactions must expand dep_group members
Checked by @LusoCryptoLabs (owner of the project), 2026-11-19.
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the field", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/ckb-vm-js-0-2-0-npm-checks-header-hash-instead-of-rejecting, CC BY 4.0, last changed 2026-11-17.