-
Notifications
You must be signed in to change notification settings - Fork 339
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
Change ProverServer::compress
to work with Receipt
#1726
Merged
Merged
Conversation
This file contains 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 change re-implements the compress function. We want the ability for a user to generate any kind of receipt using the Prover and ProverServer. In other words, we want to be able to translate composite receipts to succinct receipts, and succinct receipts into compact receipts to move up through the various receipt stages like so: ``` Composite -> Succinct -> Compact ``` In a previous PR, I've added a `ReceiptKind` field with in `ProverOpts` so that `ProverImpl::prove_session` can generate any kind of receipt specified by `ProverOpts`. In this PR, I changed the semantics of the Compress function to mean "for a given ProverOpts and Receipt, compress the receipt to the desired receipt kind". The following table illustrates the semantics of the new compress functionality: | InnerReceipt | ReceiptFormat | Result | |--------------|---------------|----------------------------------| | Fake | any | no-op | | Composite | Composite | no-op | | Composite | Succinct | Composite -> Succinct | | Composite | Compact | Composite -> Succinct -> Compact | | Succinct | Composite | Error | | Succinct | Succinct | no-op | | Succinct | Compact | Succinct -> Compact | | Compact | Composite | Error | | Compact | Succinct | Error | | Compact | Compact | no-op | In order to implement this, I realized that the existing compress function took a composite receipt and compressed it to a succinct receipt. I've renamed this to `composite_to_succinct` and created a similar `succinct_to_compact` function so that I can use the compress function to move up the various receipt types like so: ``` composite_to_succinct | succinct_to_compact | | V V Composite -> Succinct -> Compact ^ ^ |______________________| compress ```
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@flaub this is the final change involving moving the stark2snark to the prover/provers server/proverImpl |
I feel like this is missing a bunch of tests that basically covers the table above. |
@flaub tests have been written |
flaub
approved these changes
Apr 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change re-implements the compress function. We want the ability for a user to generate any kind of receipt using the Prover and ProverServer. In other words, we want to be able to translate composite receipts to succinct receipts, and succinct receipts into compact receipts to move up through the various receipt stages like so:
In a previous PR, I've added a
ReceiptKind
field with inProverOpts
so thatProverImpl::prove_session
can generate any kind of receipt specified byProverOpts
. In this PR, I changed the semantics of the Compress function to mean "for a given ProverOpts and Receipt, compress the receipt to the desired receipt kind". The following table illustrates the semantics of the new compress functionality:In order to implement this, I realized that the existing compress function took a composite receipt and compressed it to a succinct receipt. I've renamed this to
composite_to_succinct
and created a similarsuccinct_to_compact
function so that I can use the compress function to move up the various receipt types like so: