Repository navigation
Cover lock-entry and loop ZK verifier rejection - #111
Open
CECILIA-MULANDI wants to merge 1 commit into
Open
CECILIA-MULANDI wants to merge 1 commit into
CECILIA-MULANDI wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/zk_transition.rsrejects eight invalid ZK programs. Two of the three thingssrc/zk_contract.rssays 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:11states 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 withoutfailing 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 anactionentry into alockentry, returningbool. Both are refused with "exact ZK profilerequires 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_transitionpasses 7 tests, and./scripts/cellscript_gate.sh commitpasses.