-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial 05 CKB Target Profiles
A target profile answers a simple question: which chain runtime are you preparing this source for?
CellScript now supports CKB as its only target profile. The CKB profile controls syscalls, source constants, header/runtime rules, artifact packaging, metadata policy, and verification boundaries.
- how to use the
ckbprofile consistently; - why unsupported CKB runtime assumptions fail closed;
- how to check both assembly and ELF-compatible output paths;
- which CKB-specific details need review before deployment.
Use this for CKB artifacts. This is the right choice when the output must follow CKB syscall, ELF, witness, Molecule, capacity, and builder expectations:
cellc build --target riscv64-elf --target-profile ckbThe CKB profile enforces:
- CKB syscall numbers;
- CKB source constants;
- CKB header ABI restrictions;
- raw ELF packaging without ABI trailer;
- Molecule-facing schema and entry witness metadata;
- CKB Blake2b release/deployment hash helper support;
- manifest-level
hash_type, CellDep, and DepGroup reporting; - capacity, tx-size, and builder-evidence requirements in constraints;
- CKB policy checks for unsupported runtime/stateful shapes.
Verify the result:
cellc verify-artifact build/main.elf --expect-target-profile ckbcellc check --target-profile ckb --json
cellc check --all-targets --target-profile ckb --json
cellc build --target riscv64-elf --target-profile ckb --jsonIf the source cannot build for CKB, inspect the policy violation. A failure is correct when the source depends on unsupported CKB behavior.
CKB work is usually easiest when the schema and transaction entry points are explicit from the beginning:
- prefer fixed-size persistent schema fields;
- keep action entry parameters explicit;
- use
env::current_timepoint()for time-aware checks; - record CKB
hash_type, CellDeps, and DepGroups inCell.toml; - inspect
cellc constraints --target-profile ckb --jsonbefore deployment; - inspect witness layout with
cellc abiorcellc entry-witness; - avoid scheduler witness ABI;
- avoid unsupported signature/hash helper syscalls;
- use metadata and
verify-artifactto confirm target profile and packaging.
For release-facing CKB evidence, also run the CellScript repository's CKB acceptance/final-hardening gate. Compiler metadata is necessary, but it is not a substitute for builder-backed transaction evidence, dry-run cycles, serialized tx-size evidence, and occupied-capacity checks.
After choosing a profile, continue with Metadata, Verification, and Production Gates.