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

Async Halo2 verifier service #2645

Merged
merged 22 commits into from
Nov 17, 2021
Merged

Async Halo2 verifier service #2645

merged 22 commits into from
Nov 17, 2021

Conversation

dconnolly
Copy link
Contributor

@dconnolly dconnolly commented Aug 20, 2021

Motivation

To match our verification patterns, we need a Halo2 proof async verifier service.

Solution

Implements a Halo2 verifier service that reproduces the batch api, to maintain the same API as out other verifier services and to be future-proof for batch optimizations for Halo2.

We don't have V5 transactions with verifiable Action proofs yet to use as test vectors, when we can mint those via zcashd they should be used to test this.

In the meantime, we produce test-specific Halo2 proofs. We should augment with test vectors as soon as they are available.

Resolves #2104

Review

Anyone but especially @jvff @conradoplg @upbqdn @teor2345

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

  • When finalized, encode the hash of the VerifyingKey and assert that it matches the ::build()'d one

@dconnolly dconnolly changed the title First pass at async Halo2 verification service [Blocked?] First pass at async Halo2 verification service Aug 20, 2021
@dconnolly dconnolly changed the title [Blocked?] First pass at async Halo2 verification service [Blocked?] Async Halo2 verifier service Aug 20, 2021
@dconnolly dconnolly changed the title [Blocked?] Async Halo2 verifier service Async Halo2 verifier service Oct 14, 2021
@dconnolly
Copy link
Contributor Author

Now unblocked as the orchard crate/circuit has been released

@teor2345 teor2345 added the P-Low label Oct 18, 2021
@dconnolly dconnolly marked this pull request as ready for review November 6, 2021 04:20
@dconnolly dconnolly added P-High A-consensus Area: Consensus rule updates A-dependencies Area: Dependency file updates A-rust Area: Updates to Rust code NU-5 Network Upgrade: NU5 specific tasks and removed P-Low labels Nov 6, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

I've skimmed this PR and I can't see anything particularly risky or concerning here.

I'd like to leave the detailed review to other people.

Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Looks good! I just left some suggestions

zebra-consensus/src/primitives/halo2.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/halo2.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/halo2/tests.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@jvff jvff left a comment

Choose a reason for hiding this comment

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

Haven't fully finished reviewing, but I wanted to post a question so I don't block you 😅

zebra-consensus/src/primitives/halo2.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/halo2.rs Show resolved Hide resolved
zebra-consensus/src/primitives/halo2.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@jvff jvff left a comment

Choose a reason for hiding this comment

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

Looks great! I added some small suggestions, but they're optional. The only thing I'd like to be sure before approving is if the Display implementation is correct.

zebra-consensus/src/primitives/halo2/tests.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/halo2/tests.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
dconnolly and others added 22 commits November 16, 2021 18:49
Stubs out a batch verifier for the future.
The dependencies for orchard, halo2, librustzcash, zcash_primitives, have
not been resolved.
Co-authored-by: Conrado Gouvea <[email protected]>
Co-authored-by: Janito Vaqueiro Ferreira Filho <[email protected]>
Co-authored-by: Janito Vaqueiro Ferreira Filho <[email protected]>
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good!

@teor2345 teor2345 merged commit eda83eb into main Nov 17, 2021
@teor2345 teor2345 deleted the halo2-verifier branch November 17, 2021 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-dependencies Area: Dependency file updates A-rust Area: Updates to Rust code NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a Halo2Verifier async service
5 participants