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

Feat/gpu prover #19

Merged
merged 6 commits into from
Jan 6, 2025
Merged

Feat/gpu prover #19

merged 6 commits into from
Jan 6, 2025

Conversation

zkfriendly
Copy link
Contributor

Description

This PR introduces two main changes:

  1. Adds GPU-based proof generation functionality through a new generate_proof_gpu function and keeps the generate_proof as is for backwards compatibility.
  2. Adds a serde alias for pub_signals to support publicOutputs in JSON deserialization for gpu prover response.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Tested GPU proof generation with valid input parameters
  • Verified correct deserialization of proof responses with both pub_signals and publicOutputs fields

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@zkfriendly zkfriendly requested a review from Bisht13 January 4, 2025 12:43
@@ -13,6 +13,7 @@ pub struct ProverRes {
/// The proof in JSON format.
proof: ProofJson,
/// The public signals associated with the proof.
#[serde(alias = "publicOutputs")]
Copy link
Member

Choose a reason for hiding this comment

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

Can you use #[serde(rename_all = "camelCase")] and change the field name accordingly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the generate_proof function the modal API response is expected to include a snake case pub_signals, while the gpu prover API doesn't include a pub_signals or pubSignals, rather it has publicOutputs. Also rename_all doesn't seem to apply to alias names. So I'm not sure how I should use #[serde(rename_all = "camelCase")] and change the field name accordingly

src/proof.rs Outdated Show resolved Hide resolved
@Bisht13 Bisht13 merged commit d5564d3 into main Jan 6, 2025
2 checks passed
@Bisht13 Bisht13 deleted the feat/gpu_prover branch January 6, 2025 11:16
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.

2 participants