CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

nervosnetwork/ckb-standalone-debugger

Lessons from nervosnetwork/ckb-standalone-debugger

github.com/nervosnetwork/ckb-standalone-debugger

Do you maintain this project? Confirm its lessons in one issue

2 lessons found. All lessons

Profile spawned scripts with the right ELF symbolsWorkingFrom one fix

In ckb-debugger full mode with spawn, coverage, flamegraph and overlap analysis now use the ELF of the VM chosen with --vm-id instead of the root program. Pass an unstripped binary with --vm-symbols to get symbols and debug info.

Older ckb-debugger versions profile spawned children with the root program's symbols, so their profiles are wrong.

#Testing and devnet · Sources (1) · 2026-11-16

Charging load_program bytes as cycles when building a custom ckb-vm machineAdvancedFrom one fix

When you build a ckb-vm machine yourself (DefaultMachineBuilder or AsmMachine) and call load_program, charge the returned byte count with machine.add_cycles_no_checking(ckb_script::cost_model::transferred_byte_cycles(bytes)). That count covers the loaded program and the stack and argument setup, and TransactionScriptsVerifier charges it on chain, so without it your cycle count comes out too low (in ckb-debugger the fib test went from 1361 to 3364 cycles). For AsmMachine call it on the inner machine, and pass the error up instead of unwrapping.

#Testing and devnet #Other · Sources (1) · 2026-11-03

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.