-
Notifications
You must be signed in to change notification settings - Fork 145
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
Stark: Stone prover compatibility end to end for Fibonacci AIR #596
Conversation
provers/stark/src/prover.rs
Outdated
pub struct Prover; | ||
|
||
impl IsStarkProver for Prover { | ||
type Field = Stark252PrimeField; |
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.
It would be better for this type definition to be on top of the file, before the function, so it doesn't get lost
let commitment = tree.root; | ||
(tree, commitment) |
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.
maybe I'm missing some detail, but couldn't we just return the tree directly and use tree.root
outside the function when needed?
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.
Ah, we can do that. But we lose the semantics of that function, because we wouldn't be commiting anymore, just building a merkle tree. We would have to rename it.
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.
ok maybe not too important for now, lets leave it like this
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.
Name is tricky, it's doing a commitment and returning the tree for further use
.zip(evaluation_point_inverse) | ||
.enumerate() | ||
.fold(true, |mut result, (i, ((proof_s, iota_s), eval))| { | ||
// this is done in constant time |
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.
This constant time comment, I'm not sure if it's useful
…aclass#596) * add test * make trace commitment SHARP compatible * wip * use powers of a single challenge for the boundary and transition coefficients * add permutation to match sharp compatible commitments on the trace * change trait bound from ByteConversion to Serializable * minor refactor * fmt, clippy * move std feature to inner trait function in Serializable * add IsStarkProver and IsStarkVerifier traits * proof of concept * composition poly breaker * WIP: commitment composition poly works. Opens are broken. * WIP Refactor open_trace_polys and open_composition_poly * Refactor sample iotas * Refactor sample iotas * make fri a trait * change trace ood evaluations in transcript * wip * sample gammas as power of a single challenge * fix z fri sampling * wip * wip * wip, broken * Compiles but fibonacci_5 does not work * Opens of query phase and OOD broken. Commit phase of FRI works. * Dont append to the transcript when grinding factor is zero * skip grinding factor when security bits is zero * remove permutation function * fmt * fix standard verifier * removes deep consistency check and openings of the first layer of fri for each query * SHARP computes the trace and composition polynomial openings and their symmetric elements consistently * Test symmetric elements in trace openings to compute deep composition polynomial * Composition polynomial opening evaluations are splitted between symmetric and not. The authentication paths remain equal * check openings in symmetric elements * make verifier sharp compatible * compute number of parts * fix verify fri for original prover * fix verify sym in stone prover * rename * rename file * wip * remove unnecessary variable * wip * move verifier * move fri * fix open * move stone to prover * remove file * fmt * clippy * clippy * remove redundant trait bounds * remove custom serialization/deserialization and replace it with serde_cbor * fmt * clippy * remove old files after merge from main * fmt * make field a type of IsStarkVerifier * remove frame serialization * separate compatibility test into individual tests * remove redundant test * add test case 2 * minor refactor. add docs * minor refactor * remove unnecessary method * revert unintended changes to exercises * clippy * remove isFri trait * move Prover definition to the top of the file * update docs and add unit test * minor refactors. clippy * remove unused trait method * Move function only used for tests, to tests --------- Co-authored-by: Agustin <[email protected]> Co-authored-by: MauroFab <[email protected]>
…aclass#596) * add test * make trace commitment SHARP compatible * wip * use powers of a single challenge for the boundary and transition coefficients * add permutation to match sharp compatible commitments on the trace * change trait bound from ByteConversion to Serializable * minor refactor * fmt, clippy * move std feature to inner trait function in Serializable * add IsStarkProver and IsStarkVerifier traits * proof of concept * composition poly breaker * WIP: commitment composition poly works. Opens are broken. * WIP Refactor open_trace_polys and open_composition_poly * Refactor sample iotas * Refactor sample iotas * make fri a trait * change trace ood evaluations in transcript * wip * sample gammas as power of a single challenge * fix z fri sampling * wip * wip * wip, broken * Compiles but fibonacci_5 does not work * Opens of query phase and OOD broken. Commit phase of FRI works. * Dont append to the transcript when grinding factor is zero * skip grinding factor when security bits is zero * remove permutation function * fmt * fix standard verifier * removes deep consistency check and openings of the first layer of fri for each query * SHARP computes the trace and composition polynomial openings and their symmetric elements consistently * Test symmetric elements in trace openings to compute deep composition polynomial * Composition polynomial opening evaluations are splitted between symmetric and not. The authentication paths remain equal * check openings in symmetric elements * make verifier sharp compatible * compute number of parts * fix verify fri for original prover * fix verify sym in stone prover * rename * rename file * wip * remove unnecessary variable * wip * move verifier * move fri * fix open * move stone to prover * remove file * fmt * clippy * clippy * remove redundant trait bounds * remove custom serialization/deserialization and replace it with serde_cbor * fmt * clippy * remove old files after merge from main * fmt * make field a type of IsStarkVerifier * remove frame serialization * separate compatibility test into individual tests * remove redundant test * add test case 2 * minor refactor. add docs * minor refactor * remove unnecessary method * revert unintended changes to exercises * clippy * remove isFri trait * move Prover definition to the top of the file * update docs and add unit test * minor refactors. clippy * remove unused trait method * Move function only used for tests, to tests --------- Co-authored-by: Agustin <[email protected]> Co-authored-by: MauroFab <[email protected]>
Stark: Stone prover compatibility end to end for Fibonacci AIR
Description
This PR implements the same Merkle tree and FRI logic to obtain the same exact results as the Stone prover for the Fibonacci AIR for a single FRI query and no grinding factor. The source of the test cases can be found here.
Support for multiple queries, grinding factor and docs will be added in subsequent PRs.