Skip to content
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 115 commits into from
Feb 4, 2025

Conversation

daveroga
Copy link
Contributor

@daveroga daveroga commented Dec 3, 2024

Implement multi-request support similar to existing requests now in Universal Verifier.

  • Manage multi-request (MultiRequest) independently and in the same way we are managing Requests in ZKPVerifierBase now (setMultiRequest, getMultiRequest, …). Avoid ZKP and generalize methods in Requests. setRequest, getRequest, submitResponse, …
  • Manage Auth in specific data structure and response.
  • Define challenge based on the ethereum address in this first version
  • Figure out linkID between the Requests and Auth of the same Query.
  • Consider that more than one type of auth may be available there for specific multiRequest. And each of the multiRequests should define it’s own set of valid auth along with requests.
  • RequestId change from uint64 to uint256.

Link to Tech Spec for changes: https://www.notion.so/privado-id/Multi-query-Tech-Spec-13d4f86a875180e68fc8e3fa5362805e

@coveralls
Copy link

coveralls commented Dec 3, 2024

Pull Request Test Coverage Report for Build 13133916940

Details

  • 562 of 642 (87.54%) changed or added relevant lines in 33 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.1%) to 85.014%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contracts/lib/ClaimBuilder.sol 13 14 92.86%
contracts/lib/PrimitiveTypeUtils.sol 3 4 75.0%
contracts/lib/groth16-verifiers/Groth16VerifierAuthV2Wrapper.sol 2 3 66.67%
contracts/lib/groth16-verifiers/Groth16VerifierLinkedMultiQuery10Wrapper.sol 5 6 83.33%
contracts/lib/groth16-verifiers/Groth16VerifierMTPWrapper.sol 2 3 66.67%
contracts/lib/groth16-verifiers/Groth16VerifierSigWrapper.sol 2 3 66.67%
contracts/lib/groth16-verifiers/Groth16VerifierV3Wrapper.sol 2 3 66.67%
contracts/lib/IdentityBase.sol 0 2 0.0%
contracts/validators/request/LinkedMultiQueryValidator.sol 58 60 96.67%
contracts/verifiers/ValidatorWhitelist.sol 6 8 75.0%
Files with Coverage Reduction New Missed Lines %
contracts/lib/IdentityBase.sol 1 61.11%
contracts/state/State.sol 4 75.13%
Totals Coverage Status
Change from base Build 13098294824: 1.1%
Covered Lines: 1325
Relevant Lines: 1464

💛 - Coveralls

@daveroga daveroga force-pushed the PID-2709-full-multi-query-support-on-chain branch from b70f050 to a02592c Compare December 5, 2024 11:33
@daveroga daveroga requested a review from vmidyllic January 31, 2025 18:25
keccak256(abi.encodePacked("challenge"))
) {
bytes32 expectedNonce = keccak256(abi.encode(sender, responses)) &
0x0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be 0x00FFFF... if we want to zero out the first byte.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only with the first position as 0 that is 4 bits we have 252 bits remaining for the calculation that fits in a field number. But I could do it with 1 byte if you think it's better an we we'll use 248 bits then.

@daveroga daveroga force-pushed the PID-2709-full-multi-query-support-on-chain branch from df615af to 707a770 Compare February 1, 2025 09:15
@daveroga daveroga requested a review from OBrezhniev February 1, 2025 18:16
AndriianChestnykh and others added 3 commits February 2, 2025 12:44
…09-full-multi-query-support-on-chain

# Conflicts:
#	scripts/deploy/deployState.ts
#	scripts/deploy/deployValidators.ts
#	scripts/maintenance/checkEmbeddedZKPVerifier.ts
#	scripts/upgrade/verifiers/embedded-verifier-upgrade.ts
@daveroga daveroga force-pushed the PID-2709-full-multi-query-support-on-chain branch 2 times, most recently from af11142 to af48dff Compare February 3, 2025 11:33
@daveroga daveroga force-pushed the PID-2709-full-multi-query-support-on-chain branch from af48dff to 0473eca Compare February 3, 2025 11:37
@daveroga daveroga requested a review from vmidyllic February 3, 2025 12:07
@daveroga daveroga force-pushed the PID-2709-full-multi-query-support-on-chain branch from 05b54b3 to 8650ac6 Compare February 3, 2025 12:14
@daveroga daveroga force-pushed the PID-2709-full-multi-query-support-on-chain branch from 8650ac6 to 598272a Compare February 3, 2025 12:15
OBrezhniev
OBrezhniev previously approved these changes Feb 3, 2025
vmidyllic
vmidyllic previously approved these changes Feb 3, 2025
@daveroga daveroga dismissed stale reviews from vmidyllic and OBrezhniev via a09e038 February 4, 2025 10:57
@daveroga daveroga changed the base branch from master to v3 February 4, 2025 12:59
@daveroga daveroga merged commit 92f00c0 into v3 Feb 4, 2025
8 checks passed
@daveroga daveroga deleted the PID-2709-full-multi-query-support-on-chain branch February 4, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants