Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário
Enable molecule bytes_vec so ckb-std scripts contain no atomic instructionsPráticoVerificada pelo dono
Verificada pelo dono · Verificação: certa · Verificada em 2026-11-19
With ckb-std 0.16, molecule's default Bytes uses the external bytes crate, which emits lr.d/sc.d atomic instructions that the CKB VM rejects, so the built lock script was not executable on chain. Adding molecule 0.8 with default-features = false and features = ["bytes_vec"] to the script crate makes feature unification swap in molecule's Vec-backed Bytes, and the commit reports the artifact then had zero atomic instructions.
Porque importa: Without the bytes_vec feature, the external bytes crate's atomic refcounting compiles into the RISC-V script, so the CKB VM cannot execute the deployed script and cells locked by it cannot be unlocked on chain.
Padrão
molecule = { version = "0.8", default-features = false, features = ["bytes_vec"] }Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- wraith-protocol/contracts:
ckb/integration-tests/tests/lock_integration.rs - LusoCryptoLabs/vortx-swap:
scripts/e2e/aggregator-otx.mjs,scripts/e2e/concurrency.mjs,scripts/e2e/otx-joyid-real.mjs,scripts/e2e/otx-testnet.mjs,scripts/e2e/run.mjs
- Conceitos
- Other
- 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-09-30
- Última mudança
- 2026-10-22
- Ú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 (2)
- 2026-09-30 · wraith-protocol/contracts · mais deste projeto
- 2026-10-22 · LusoCryptoLabs/vortx-swap · mais deste projeto
Mais sobre Rust scripts and ckb-std
- CKB VM2 READ and INHERITED_FDS syscalls take a length pointer and return status in a0
- Close spawn pipe descriptors when an IPC channel is freed
- Disable overflow checks for ckb-std when using its dummy-atomic polyfills
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, "Enable molecule bytes_vec so ckb-std scripts contain no atomic instructions", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/enable-molecule-bytes-vec-so-ckb-std-scripts-contain-no-atom, CC BY 4.0, last changed 2026-10-22.