Skip to content

Cover lock-entry and loop ZK verifier rejection - #111

Open
CECILIA-MULANDI wants to merge 1 commit into
CellScript-Labs:0.36from
CECILIA-MULANDI:test/zk-loop-and-lock-rejection
Open

CECILIA-MULANDI wants to merge 1 commit into
CellScript-Labs:0.36from
CECILIA-MULANDI:test/zk-loop-and-lock-rejection

Conversation

@CECILIA-MULANDI

@CECILIA-MULANDI CECILIA-MULANDI commented Nov 27, 2026 •

Copy link
Copy Markdown

tests/zk_transition.rs rejects eight invalid ZK programs. Two of the three things src/zk_contract.rs says it refuses were not among them: no case placed a verifier call in a non-action entry, and no case placed one inside a loop.
The comment at src/zk_contract.rs:11 states that "helpers, loops and alternative accepting paths need a separate effect/call-count contract before admission", so a refactor of that condition could have relaxed either without
failing a test.

This adds two cases to the existing array. The first wraps the call in for i in 0..1. The second moves the same program from an action entry into a lock entry, returning bool. Both are refused with "exact ZK profile
requires one unconditional call in the action entry block; helper, loop and conditional verification are unsupported".

Both messages were read directly rather than trusted to is_err(), which passes on a syntax mistake just as readily as on a policy rejection. One caveat on scope: the loop case is most likely refused because the call lands outside block 0, not specifically by the back-edge clause, so it covers the documented guarantee rather than that one disjunct.

Verified on 0.36: cargo test --locked --test zk_transition passes 7 tests, and ./scripts/cellscript_gate.sh commit passes.

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