-
Notifications
You must be signed in to change notification settings - Fork 40
Add embeddedAuth method to Universal Verifier #388
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
base: master
Are you sure you want to change the base?
Add embeddedAuth method to Universal Verifier #388
Conversation
Pull Request Test Coverage Report for Build 16730527758Details
💛 - Coveralls |
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 PR introduces an embeddedAuth
authentication method to the Universal Verifier system, which skips verification of the auth proof since embedded authentication is already verified within request validator circuits. This optimization reduces gas consumption and enables deployment on networks with strict gas limits like Aurora.
Key changes:
- Added
embeddedAuth
authentication method that uses zero address as validator - Modified validators to include
isEmbeddedAuthVerified
response field - Updated verifier logic to handle embedded authentication validation
- Added Aurora network configuration and testing infrastructure
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
contracts/verifiers/Verifier.sol | Core logic for handling embeddedAuth method and validating embedded auth in responses |
contracts/validators/request/*.sol | Added isEmbeddedAuthVerified response field to all request validators |
contracts/lib/VerifierLib.sol | Added utility functions for checking embedded auth verification |
test/validators/*/index.ts | Updated test expectations to account for additional response field |
scripts/deploy/*.ts | Added embeddedAuth method setup in deployment scripts |
hardhat.config.ts | Added Aurora network configuration |
Comments suppressed due to low confidence (1)
package.json:15
- The version constraint
^1.32.4
uses a caret which may include versions that don't exist yet. Consider using a more specific version range or verify this version exists.
"@0xpolygonid/js-sdk": "^1.32.4",
contracts/verifiers/Verifier.sol
Outdated
@@ -267,35 +271,21 @@ abstract contract Verifier is IVerifier, ContextUpgradeable { | |||
// 1. Process crossChainProofs | |||
$._state.processCrossChainProofs(crossChainProofs); | |||
|
|||
// 2. Authenticate user and get userID | |||
uint256 userIDFromAuthResponse; |
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.
Variable userIDFromAuthResponse
is declared but when embeddedAuth
method is used, it remains uninitialized (0) until the first response is processed. This could cause issues if no responses are provided or if the first response doesn't contain a userID.
Copilot uses AI. Check for mistakes.
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.
@daveroga please initialize it with 0 explicitly
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.
Done
Currently we check Auth in both authResponse with authV2 method (authV2 circuit) and all the responses for request validators (on-chain credential query validator circuits).
We will add a
embeddedAuth
auth method for the authResponse that won’t verify the auth proof because we already are verifying embedded auth in responses for on-chain circuits now.This will allow: