-
Notifications
You must be signed in to change notification settings - Fork 25
Support Scheduled GKR #199
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
hczphn
wants to merge
11
commits into
master
Choose a base branch
from
hc/schedule
base: master
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
11 commits
Select commit
Hold shift + click to select a range
18818f3
fix bugs to reuse graph
hczphn 3d69ff8
add schedule prove version, pass test
hczphn c1fe2a7
remove debug-level print info
hczphn 9a12c27
remove duplicate schedule
hczphn c89adbb
reduce eprintln
hczphn d91d499
support no hint logup
hczphn 4fee136
lightweight prove, reduce memory cost after sending prove request
hczphn ca286e5
fix fmt, warning
hczphn 736a6e2
fix format
hczphn 1be709d
Merge branch 'hc/reuse_graph' into hc/schedule
hczphn 2a68eb1
remove unuse variable
hczphn 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,6 +326,41 @@ impl LogUpSingleKeyTable { | |
| &alpha, | ||
| ); | ||
|
|
||
| assert_eq_rational(builder, &v_table, &v_query); | ||
| } | ||
| pub fn final_check_with_query_count<C: Config, B: RootAPI<C>>( | ||
| &mut self, | ||
| builder: &mut B, | ||
| query_count: &[Variable], | ||
| ) { | ||
| if self.table.is_empty() || self.query_keys.is_empty() { | ||
| panic!("empty table or empty query"); | ||
| } | ||
|
|
||
| let value_len = self.table[0].len(); | ||
|
|
||
| let alpha = builder.get_random_value(); | ||
| let randomness = get_column_randomness(builder, value_len); | ||
|
|
||
| let table_combined = combine_columns(builder, &self.table, &randomness); | ||
| let mut inputs = vec![builder.constant(self.table.len() as u32)]; | ||
| //append table keys | ||
| for i in 0..self.table.len() { | ||
| inputs.push(self.table[i][0]); | ||
| } | ||
| //append query keys | ||
| inputs.extend(self.query_keys.clone()); | ||
| let v_table = logup_poly_val(builder, &table_combined, &query_count, &alpha); | ||
|
|
||
| let query_combined = combine_columns(builder, &self.query_results, &randomness); | ||
| let one = builder.constant(1); | ||
| let v_query = logup_poly_val( | ||
| builder, | ||
| &query_combined, | ||
| &vec![one; query_combined.len()], | ||
| &alpha, | ||
| ); | ||
|
|
||
| assert_eq_rational(builder, &v_table, &v_query); | ||
| } | ||
| } | ||
|
|
@@ -455,6 +490,26 @@ impl LogUpRangeProofTable { | |
| ); | ||
| assert_eq_rational(builder, &v_table, &v_query); | ||
| } | ||
|
|
||
| pub fn final_check_with_query_count<C: Config, B: RootAPI<C>>( | ||
| &mut self, | ||
| builder: &mut B, | ||
| query_count: &[Variable], | ||
| ) { | ||
| let alpha = builder.get_random_value(); | ||
| let inputs = self.query_keys.clone(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| let v_table = logup_poly_val(builder, &self.table_keys, &query_count, &alpha); | ||
|
|
||
| let one = builder.constant(1); | ||
| let v_query = logup_poly_val( | ||
| builder, | ||
| &self.query_keys, | ||
| &vec![one; self.query_keys.len()], | ||
| &alpha, | ||
| ); | ||
| assert_eq_rational(builder, &v_table, &v_query); | ||
| } | ||
| } | ||
|
|
||
| pub fn query_count_hint<F: Field>(inputs: &[F], outputs: &mut [F]) -> Result<(), Error> { | ||
|
|
||
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.
The
inputsvariable is initialized here but it's never used. This block of code appears to be a leftover from thefinal_checkfunction and can be safely removed.