Todas as lições · Developer tooling · Começa aqui · Glossário
ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the fieldPráticoVerificada pelo dono
Verificada pelo dono · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
const { hash: _, ...rest } = o as Record<string, unknown>;Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- LusoCryptoLabs/ckb-ward:
tests/ckbvmjs.test.ts
- Conceitos
- Testing and devnet, Data encoding (molecule, hex, bigints)
- Evidência
- Verificada pelo dono: verificada pelo dono do projeto de onde veio, que também publica estas lições
- Vista pela primeira vez
- 2026-11-17
- Última mudança
- 2026-11-17
- Ú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-17 · LusoCryptoLabs/ckb-ward · mais deste projeto
Mais sobre 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
Verificada por @LusoCryptoLabs (dono do projeto), 2026-11-19.
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.