-
Notifications
You must be signed in to change notification settings - Fork 29
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
Full Multi-query support onchain #321
Merged
Merged
Changes from 103 commits
Commits
Show all changes
115 commits
Select commit
Hold shift + click to select a range
bf71699
new universal verifier multi-query
daveroga 74b24a1
Discussion results
AndriianChestnykh 16a8b27
Discussion results 2
AndriianChestnykh f05104d
update universal verifier multi query
daveroga 779513f
remove ZKP
daveroga 8da12c7
add auth validators
daveroga ba75a5d
Broader discussion results
AndriianChestnykh ae9cec1
Add agreed universal verifier solution
AndriianChestnykh 790a0e3
update universal verifier multi query with agreed design
daveroga 1858dce
query status and submit response
daveroga 4527834
get request type from 30 byte of the requestId
daveroga bb82ff3
add EthIdentityValidator
daveroga e66a160
updates from review
daveroga d416b9a
Discussion result
AndriianChestnykh a26861c
updates from discussion
daveroga 0c2e792
check response field values from linked response fields
daveroga 16f8b5a
fix some errors in compilation
daveroga 4afb814
test universal verifier multi-query
daveroga 8f55467
different validators for sig and authv2
daveroga 657fa6c
check specific storage values
daveroga 46d17ab
overrides solidity compiler optimizations for specific contract
daveroga 1e7b877
remove some methods
daveroga 2942cdf
fix solhint
daveroga a91c1e7
update from discussion
daveroga 849e790
set group of requests and check linkID
daveroga a02592c
fix solhint
daveroga 6b82ff0
updates from review
daveroga d35e4b4
fix cyclomatic-complexity
daveroga 3811b9c
some fixes from review
daveroga 4030067
updates from tech spec
daveroga 6135f84
add auth validator stub and fix test
daveroga b860ab0
add changes for user authentication structs
daveroga fc7bc91
fix solhint
daveroga c3bb7e3
reestructure link between userID and address and mapping for authenti…
daveroga 14d08fb
auth proofs different structure
daveroga 3734eb5
add custom errors to UniversalVerifierMultiQuery
daveroga 4c8e01d
add __gap in proofs storage for future updates and array of proofs fo…
daveroga 24888ad
param names in returned structs from solidity
daveroga 14ca44b
Initial verifier authentication (#323)
AndriianChestnykh 636f590
updates for iteration 2
daveroga 88ff859
fix test multi-query
daveroga fb2a5b4
update verifiers tests
daveroga faa2d0b
fix validators tests and solhint
daveroga a8c8653
updates merge from master
daveroga 6336ad5
partial changes review
daveroga 31aa30b
override _setRequest to avoid loops and fix solhint
daveroga a30dbfd
remove embedded zkp verifier
daveroga c6077eb
update Query to MultiRequest
daveroga d31f2ca
update submitResponse
daveroga 7ad4411
fix solhint
daveroga 7005a64
address centered model instead of userID and some fixes
daveroga 85804dd
fix solhint and custom errors
daveroga 1d49a4e
updates from review
daveroga 4a9e988
check grouped requests 2 requests at least
daveroga 81fdf83
fix error cyclomatic-complexity from solhint
daveroga 034de2c
move _state in storage
daveroga 10eb73d
check link responses with bool
daveroga ca1f04f
fix solhint
daveroga 188bb13
remove history in proofs from requests
daveroga ffe4e6e
check nullifierSessionID on request creation
daveroga f607131
fix cyclomatic-complexity in solhint
daveroga 848e609
check verifierID in requests for V3
daveroga 4bac7da
add test for authv2 validator
daveroga 1e9c474
Feature/pid 2720 implement linked multi query validator (#328)
AndriianChestnykh d510368
update tests with updated stub validator
daveroga 296bb68
check requestId correctness
daveroga 78610dd
add logic from skip tests in verifier test
daveroga 1641d15
add auth validator stub set verify results method
daveroga 9f33dec
idType for verifier and some updates to verifier test
daveroga faf0997
fix enumerable and check existence in proof response fields
daveroga d7c7281
fix requestId calculation
daveroga 822c81c
remove specific multi-request test that now is included in verifier test
daveroga 39d67f5
add test wrappers and tests for RequestDisableable, RequestOwnership …
daveroga e2109e6
increase coverage
daveroga 886193c
updates from review
daveroga adfac38
reorganize universal verifier tests
daveroga 70e5a5c
test all the events from universal verifier
daveroga 001f603
add embedded verifier test
daveroga a80a773
some fixes and increase coverage
daveroga d952287
increase coverage
daveroga 43e6e8f
Integration tests (#332)
AndriianChestnykh 16de597
Fix lmk tests
AndriianChestnykh 85ebc38
update multi-request integration test
daveroga c75baa6
check multi-request components exist
daveroga 0e90b88
small general updates
daveroga 45c5edc
fix solhint
daveroga b18c064
remove VerifierLib and move functionality to Verifier
daveroga 109f3f8
fix solhint
daveroga 1179c78
update missing unified addresses for validators
daveroga a64341a
add test to calculate create2 proxy addresses
daveroga bc22c56
update test script to check unified addresses for all the contracts
daveroga 6ea8563
fix create2Calldata statelib
daveroga af3b57b
update unified address for some contracts
daveroga 4458158
remove ICircuitValidator references
daveroga 256d571
move getters for storage data back to the beginning
daveroga 19da90c
resolve solhint warnings
daveroga f238b05
update from review comments
daveroga 127c40c
update AuthV2Validator
daveroga 374ea04
add function getResponseFields to verifier
daveroga f553fed
Remove unused tests and comments
AndriianChestnykh 67bc7fe
updates from review
daveroga a817f35
update requestId calculation
daveroga 569c6b6
fix solhint
daveroga 5025be6
update RequestStatus for RequestProofStatus
daveroga de9d7a5
more updates from review
daveroga 50960a8
more updates from review
daveroga 6334aa3
change AuthType to AuthMethod
daveroga 707a770
precalculate keccack256 of field names
daveroga 7a5f833
Merge remote-tracking branch 'refs/remotes/origin/master' into PID-27…
AndriianChestnykh d46b262
solve solhint warning explicit type
daveroga ccd69f9
fix solhint warnings
daveroga 0473eca
fix solhint warnings for custom errors
daveroga a52ebd1
fix circuitId for linkedMultiQuery10-beta.1
daveroga 598272a
comment requestId calculation
daveroga a09e038
v3.0.0
daveroga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.27; | ||
|
||
import {IState} from "./IState.sol"; | ||
|
||
/** | ||
* @dev IAuthValidator. Interface for verification of auth data. | ||
*/ | ||
interface IAuthValidator { | ||
/** | ||
* @dev Get version of the contract | ||
*/ | ||
function version() external view returns (string memory); | ||
|
||
/** | ||
* @dev Verify the proof with the supported method informed in the auth query data | ||
* packed as bytes and that the proof was generated by the sender. | ||
* @param proof Proof packed as bytes to verify. | ||
* @param params Request query data of the credential to verify. | ||
* @param sender Sender of the proof. | ||
* @param state State contract to get identities and gist states to check. | ||
* @param expectedNonce Expected nonce hash calculated to check | ||
* @return userID User Id for the auth proof verified. | ||
*/ | ||
function verify( | ||
bytes calldata proof, | ||
bytes calldata params, | ||
address sender, | ||
IState state, | ||
bytes32 expectedNonce | ||
) external returns (uint256 userID); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @dev IGroth16Verifier. Interface for verification of groth16 proofs. | ||
*/ | ||
interface IGroth16Verifier { | ||
/** | ||
* @dev Verify the circuit with the groth16 proof π=([πa]1,[πb]2,[πc]1). | ||
* @param a πa element of the groth16 proof. | ||
* @param b πb element of the groth16 proof. | ||
* @param c πc element of the groth16 proof. | ||
* @param signals Public inputs and outputs of the circuit. | ||
* @return r true if the proof is verified. | ||
*/ | ||
function verify( | ||
uint256[2] calldata a, | ||
uint256[2][2] calldata b, | ||
uint256[2] calldata c, | ||
uint256[] calldata signals | ||
) external view returns (bool r); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.27; | ||
|
||
import {IState} from "./IState.sol"; | ||
|
||
/** | ||
* @dev IRequestValidator. Interface for verification of request query data. | ||
*/ | ||
interface IRequestValidator { | ||
/** | ||
* @dev ResponseField. Information about response fields from verification. Used in verify function. | ||
* @param name Name of the response field | ||
* @param value Value of the response field | ||
*/ | ||
struct ResponseField { | ||
string name; | ||
uint256 value; | ||
} | ||
|
||
/** | ||
* @dev RequestParam. Information about request param from request query data. | ||
* @param name Name of the request query param | ||
* @param value Value of the request query param | ||
*/ | ||
struct RequestParam { | ||
string name; | ||
uint256 value; | ||
} | ||
|
||
/** | ||
* @dev Get version of the contract | ||
*/ | ||
function version() external view returns (string memory); | ||
|
||
/** | ||
* @dev Verify the proof with the supported method informed in the request query data | ||
* packed as bytes and that the proof was generated by the sender. | ||
* @param proof Proof packed as bytes to verify. | ||
* @param params Request query data of the credential to verify. | ||
* @param sender Sender of the proof. | ||
* @param state State contract to get identities and gist states to check. | ||
* @return Array of response fields as result. | ||
*/ | ||
function verify( | ||
bytes calldata proof, | ||
bytes calldata params, | ||
address sender, | ||
IState state | ||
) external returns (ResponseField[] memory); | ||
|
||
/** | ||
* @dev Get the request params of the request query data. | ||
* @param params Request query data of the credential to verify. | ||
* @return RequestParams of the request query data. | ||
*/ | ||
function getRequestParams(bytes calldata params) external view returns (RequestParam[] memory); | ||
|
||
/** | ||
* @dev Get the index of the request param by name | ||
* @param name Name of the request param | ||
* @return Index of the request param | ||
*/ | ||
function requestParamIndexOf(string memory name) external view returns (uint256); | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
are we sure that we need state contract as an explicit parameter and not as a part of 'params' or other 'generic' platform?
What if state contract is not neede for some specific key validation / etc .
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.
as well as expectedNonce
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.
Changed as we agreed