-
Notifications
You must be signed in to change notification settings - Fork 29
Implement SPARK Integration for Deferred R1CS Evaluations #224
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
Open
batmendbar
wants to merge
66
commits into
main
Choose a base branch
from
spark-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
9d00214
SPARK prover with 2 gpa combined
batmendbar 03e2726
Adds RS and WS
batmendbar dd1dd42
wip: batch whir
batmendbar f5ca88d
Adds test
batmendbar eb30b9f
Creates variable for number of variables
batmendbar a9bd8f9
Adds batched WHIR to sumcheck+rowwise
batmendbar 6a67ee0
Adds B and C matrices
batmendbar 8585d52
Merge branch 'main' into spark-batched-whir
batmendbar 204259e
Writes request to file
batmendbar 1f7a0eb
Pads matrices
batmendbar 37524f9
Added cli flag and removed debug log
batmendbar 3659823
Buggy: update
batmendbar 745faf4
Parse initial commitments
batmendbar dd4ebe9
Buggy: current progress
batmendbar d958f97
Buggy: Merkle parse fix
batmendbar 0a690a9
Fixes 3 poly
batmendbar cdd2c10
Buggy: current
batmendbar cf2ccb1
Adds partial RS WS
batmendbar 9be0398
Single matrix
batmendbar 10cf5ae
Cleanup
batmendbar a189da6
Adds B and C matrices
batmendbar 2f4717b
Complete
batmendbar c6218eb
Bugg: RLC optimization - val not properly committed
batmendbar 0462090
Rust rlc prover/verifier prototype
batmendbar dedc0dc
working rlc
batmendbar c8135bb
Cleanup rust prover
batmendbar a0b8b8d
cleanup circuit
batmendbar 96d53cb
Cleanup
batmendbar 2c0e940
Merge branch 'main' into spark-rlc
batmendbar 8660d5d
Rust format
batmendbar 962c6ca
feat: refactor
shreyas-londhe b0960cf
fix: spark proving
shreyas-londhe 12bd1e1
feat: e2e working
shreyas-londhe 775b2ef
chore: remove spark-prover
shreyas-londhe 1990e2e
Merge pull request #214 from worldfnd/sl/spark
batmendbar b1a130b
Adds gpa4
batmendbar 06f5b65
WIP: gpa4
batmendbar c48c44a
gpa4
batmendbar a46164b
WIP
batmendbar 753a2c5
Finishes 4GPA
batmendbar 8a013ad
Finish static dynamic separation
batmendbar fe0d3bf
Fix recursive verifier
batmendbar 57ed864
Merge branch 'main' into spark-recursive-verifier
batmendbar cb179d4
Merge branch 'main' into spark-refactor
batmendbar 72d058e
format
batmendbar c35e8a7
Fix server
batmendbar 44d93ef
Fix documentation
batmendbar 942e91b
Update CI
batmendbar 7a92850
Add tracing to spark prove
batmendbar 2ec2344
Update generate age check circuit keys
batmendbar 23e36f0
Fix circuit key generation
batmendbar 6e13c5a
Update Readme
batmendbar 2fbaa5f
Format
batmendbar ac05363
Fix profiling
batmendbar 186bc4b
Fix CI
batmendbar da45cc2
Fix CI
batmendbar 3f3cb3f
implemented rust prover and verifier
batmendbar 3fce992
Format
batmendbar 992a47c
Modularized prover
batmendbar db4e5bd
Debug recursive verifier
batmendbar 623e94f
Refactor
batmendbar c782444
Removed cloning
batmendbar 4c862be
Parralelize with rayon
batmendbar d1b2653
Fix tracing
batmendbar d853edd
Merge with main
batmendbar c758f0a
Merge remaining files
batmendbar 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,76 @@ | ||
| use { | ||
| crate::WhirConfig, | ||
| ark_poly::EvaluationDomain, | ||
| serde::{Deserialize, Serialize}, | ||
| }; | ||
|
|
||
| #[derive(Debug, Serialize, Deserialize)] | ||
|
|
||
| pub struct WHIRConfigGnark { | ||
| /// number of rounds | ||
| pub n_rounds: usize, | ||
| /// rate | ||
| pub rate: usize, | ||
| /// number of variables | ||
| pub n_vars: usize, | ||
| /// folding factor | ||
| pub folding_factor: Vec<usize>, | ||
| /// out of domain samples | ||
| pub ood_samples: Vec<usize>, | ||
| /// number of queries | ||
| pub num_queries: Vec<usize>, | ||
| /// proof of work bits | ||
| pub pow_bits: Vec<i32>, | ||
| /// final queries | ||
| pub final_queries: usize, | ||
| /// final proof of work bits | ||
| pub final_pow_bits: i32, | ||
| /// final folding proof of work bits | ||
| pub final_folding_pow_bits: i32, | ||
| /// domain generator string | ||
| pub domain_generator: String, | ||
| /// batch size | ||
| pub batch_size: usize, | ||
| } | ||
|
|
||
| impl WHIRConfigGnark { | ||
| pub fn new(whir_params: &WhirConfig) -> Self { | ||
| WHIRConfigGnark { | ||
| n_rounds: whir_params | ||
| .folding_factor | ||
| .compute_number_of_rounds(whir_params.mv_parameters.num_variables) | ||
| .0, | ||
| rate: whir_params.starting_log_inv_rate, | ||
| n_vars: whir_params.mv_parameters.num_variables, | ||
| folding_factor: (0..(whir_params | ||
| .folding_factor | ||
| .compute_number_of_rounds(whir_params.mv_parameters.num_variables) | ||
| .0)) | ||
| .map(|round| whir_params.folding_factor.at_round(round)) | ||
| .collect(), | ||
| ood_samples: whir_params | ||
| .round_parameters | ||
| .iter() | ||
| .map(|x| x.ood_samples) | ||
| .collect(), | ||
| num_queries: whir_params | ||
| .round_parameters | ||
| .iter() | ||
| .map(|x| x.num_queries) | ||
| .collect(), | ||
| pow_bits: whir_params | ||
| .round_parameters | ||
| .iter() | ||
| .map(|x| x.pow_bits as i32) | ||
| .collect(), | ||
| final_queries: whir_params.final_queries, | ||
| final_pow_bits: whir_params.final_pow_bits as i32, | ||
| final_folding_pow_bits: whir_params.final_folding_pow_bits as i32, | ||
| domain_generator: format!( | ||
| "{}", | ||
| whir_params.starting_domain.backing_domain.group_gen() | ||
| ), | ||
| batch_size: whir_params.batch_size, | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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,35 @@ | ||
| use { | ||
| crate::{utils::serde_ark, FieldElement}, | ||
| ark_serialize::{CanonicalDeserialize, CanonicalSerialize}, | ||
| serde::{Deserialize, Serialize}, | ||
| }; | ||
|
|
||
| #[derive( | ||
| Debug, Clone, PartialEq, Eq, CanonicalSerialize, Serialize, CanonicalDeserialize, Deserialize, | ||
| )] | ||
| pub struct Point { | ||
| #[serde(with = "serde_ark")] | ||
| pub row: Vec<FieldElement>, | ||
| #[serde(with = "serde_ark")] | ||
| pub col: Vec<FieldElement>, | ||
| } | ||
|
|
||
| #[derive( | ||
| Debug, Clone, PartialEq, Eq, CanonicalSerialize, Serialize, CanonicalDeserialize, Deserialize, | ||
| )] | ||
| pub struct ClaimedValues { | ||
| #[serde(with = "serde_ark")] | ||
| pub a: FieldElement, | ||
| #[serde(with = "serde_ark")] | ||
| pub b: FieldElement, | ||
| #[serde(with = "serde_ark")] | ||
| pub c: FieldElement, | ||
| } | ||
|
|
||
| #[derive( | ||
| Debug, Clone, PartialEq, Eq, CanonicalSerialize, Serialize, CanonicalDeserialize, Deserialize, | ||
| )] | ||
| pub struct SparkStatement { | ||
| pub point_to_evaluate: Point, | ||
| pub claimed_values: ClaimedValues, | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
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.