feat: CLI --backend override and prime-aware witness writing, add Justfile#126
Open
erhant wants to merge 1 commit into
Open
feat: CLI --backend override and prime-aware witness writing, add Justfile#126erhant wants to merge 1 commit into
--backend override and prime-aware witness writing, add Justfile#126erhant wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a CLI-level proving-backend override and makes witness serialization prime-aware (correct n8 for non-bn128 fields), with supporting tests and developer workflow recipes.
Changes:
- Add
--backendto the CLI and plumb an optional backend override throughCircomkit::prove. - Make
.wtnswriting depend on the circuit’s prime viaprime_field_n8(prime)and add unit tests for roundtrips. - Add a
Justfilewith common workspace tasks (fmt/lint/test variants).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Justfile | Adds just recipes for fmt/lint/test and feature-enabled variants. |
| crates/circomkit/tests/e2e/prove.rs | Updates prove calls for new signature and adds an e2e test validating backend override precedence. |
| crates/circomkit/src/lib.rs | Re-exports ProvingBackendKind for downstream/CLI convenience. |
| crates/circomkit/src/circomkit/prove.rs | Adds backend: Option<ProvingBackendKind> override to prove; passes circuit prime into witness writer. |
| crates/circomkit/src/circomkit/compile.rs | Refactors freshness checks to a let-chain style. |
| crates/circomkit-prove/src/lambdaworks/convert.rs | Adjusts proof field access to match expected reference types. |
| crates/circomkit-core/src/utils/witness.rs | Makes witness writing prime-aware (variable n8) and adds unit tests. |
| crates/circomkit-core/src/utils/primes.rs | Introduces prime_field_n8 helper + tests for expected n8 values. |
| crates/circomkit-core/src/utils/mod.rs | Re-exports prime_field_n8. |
| crates/circomkit-core/src/enums.rs | Adds Display/FromStr for ProvingBackendKind (CLI parsing + roundtrip tests). |
| crates/circomkit-cli/src/main.rs | Adds --backend option to prove subcommand and forwards it into Circomkit::prove. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+171
to
+172
| let dir = std::env::temp_dir().join("circomkit_wtns_n8"); | ||
| std::fs::create_dir_all(&dir).unwrap(); |
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.
No description provided.