Skip to content

Fix versioned entry witness placement ABI - #3

Closed
a19q3 wants to merge 1 commit into
mainfrom
codex/witnessargs-entry-abi-v2
Closed

Fix versioned entry witness placement ABI#3
a19q3 wants to merge 1 commit into
mainfrom
codex/witnessargs-entry-abi-v2

Conversation

@a19q3

@a19q3 a19q3 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • introduce the versioned cellscript-witnessargs-input-type-v2 placement contract for generated CKB entry wrappers
  • load the entry witness from group input 0, with group output 0 as the output-only type-group fallback
  • preserve raw CSARGv1 compatibility while strictly decoding canonical three-field WitnessArgs and selecting only input_type
  • update the CKB adapter, compiler metadata, CLI output, ABI documentation, and backend shape baselines

Problem

Generated action entry wrappers previously loaded the raw witness at transaction-global input 0. That is incorrect for script groups whose first input is not input 0, and it collides with canonical CKB lock witnesses because a signing lock owns WitnessArgs.lock.

ABI and compatibility

For the CKB target profile, a versioned entry payload is placed in WitnessArgs.input_type. The generated wrapper uses group input 0 and falls back to group output 0 only for output-only type groups. It never aliases output_type. Raw CSARGv1 remains accepted for compatibility. Malformed or non-canonical WitnessArgs fails closed with entry decode error 25.

The adapter placement API preserves an existing lock field and refuses an already occupied input_type field.

Verification

  • six real CKB-VM regressions cover canonical multisig lock coexistence, a type group beginning at global input 1, raw-v1 compatibility, output-only fallback, output-type non-aliasing, and malformed field rejection
  • ./scripts/cellscript_gate.sh dev
  • ./scripts/cellscript_gate.sh ci
  • pinned backend gate against CKB revision f7fa443 with direct node acceptance
  • downstream Myelin production gate, including live parent CKB devnet submission with canonical multisig and negative tamper/conflict probes

The generated token-transfer ELF remains within the existing 7,168-byte backend budget.

Downstream integration: Myelin-Labs/Myelin@7deb8e9

@a19q3 a19q3 closed this Jul 30, 2026
@a19q3
a19q3 deleted the codex/witnessargs-entry-abi-v2 branch July 30, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant