-
Notifications
You must be signed in to change notification settings - Fork 44
Refactor and enhance support and AtomicQueryV3 #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Copilot <[email protected]>
…ecated packages and update package-lock.json accordingly.
…ircuit validation
* chore: update js-jwz dependency to version 1.13.0 refactor: enhance circuit validator type definition for better clarity and maintainability feat: add new error constant for unknown proving parameters refactor: update ZKPPacker to support dynamic proving and verification parameters refactor: modify types for dynamic proving and verification parameters in packer types test: update auth tests to use new proving method structure test: adjust credential proposal tests to align with new proving method implementation test: revise encrypted issuance response tests to utilize updated proving method test: modify fetch tests to incorporate new proving method structure test: update payment request handler tests to reflect changes in proving method test: adjust revocation status tests to use new proving method structure test: refactor helper functions to accommodate dynamic proving and verification parameters test: enhance proving method mock to support new circuit structure test: update zkp tests to reflect changes in protocol message type constants * trigger pipeline
…reparation - Cred V3 circuits without authV3 dynamic choose - Updated `mergeObjects` utility to handle undefined inputs gracefully.
… and improve circuit ID filtering logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces support for dynamic circuits and enhances circuit validation in the JavaScript SDK. The changes enable the system to dynamically select appropriate circuit versions based on Merkle tree proof depths and query counts, improving flexibility and maintainability.
Changes:
- Added new stable circuit IDs (
AtomicQueryV3Stable,AtomicQueryV3OnChainStable,LinkedMultiQuery10Stable) with support for dynamic sub-versions - Refactored circuit validation logic into a dedicated
validator.tsmodule with support for circuit sub-versions - Updated input generators and proof services to dynamically select optimal circuit versions based on proof characteristics
- Enhanced test coverage with new validation tests and parameterized linked multi-query tests
- Updated dependencies (vitest 3.2.4 → 4.0.15) and improved CI workflow
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated vitest dependency to version 4.0.15 |
| tests/storage/eth-state-storage.test.ts | Refactored mocks using vi.hoisted for proper mock hoisting |
| tests/iden3comm/zkp.test.ts | Reorganized imports and updated to use PROTOCOL_CONSTANTS |
| tests/iden3comm/mock/proving.ts | Added supportedCircuits getter method |
| tests/handlers/*.test.ts | Fixed variable declarations and added type annotations |
| tests/circuits/validator.test.ts | New comprehensive test suite for circuit validation |
| tests/circuits/linked-multi-query.test.ts | Parameterized tests for different query counts (3, 5, 10) |
| src/circuits/validator.ts | New module implementing circuit validation with sub-version support |
| src/circuits/models.ts | Added stable circuit ID enums |
| src/circuits/*.ts | Added constructors with options for dynamic MT level configuration |
| src/proof/provers/inputs-generator.ts | Implemented dynamic circuit selection based on proof depths |
| src/proof/verifiers/*.ts | Updated to handle circuit sub-versions |
| src/storage/blockchain/onchain-zkp-verifier.ts | Extended support for AuthV3 and stable circuit variants |
| src/iden3comm/handlers/*.ts | Added support for stable circuit IDs |
| src/utils/object.ts | Improved null safety with default parameters |
| .github/workflows/ci.yaml | Added credentialAtomicV3 circuit download step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Introduce support for dynamic circuits and improve circuit validation. Update dependencies and fix various tests. Refactor code for better maintainability and clarity.