-
Notifications
You must be signed in to change notification settings - Fork 149
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
Release version 0.6 #457
Merged
Merged
Release version 0.6 #457
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
It wasted a lot of time and also was useless to call the `gadget` fn again for the verify fn in the Circuit trait. Thanks to the refactor done to the PublicInputs and how they're handled now we no longer need to call it.
Previously we were storing the dense representation of the public inputs that were used with the `Composer` instance. This was constly, since most of the public inputs were zero and therefore storing them was useless but also we needed to collect the position information in the Circuit trait in such difficult ways. With this refactor we currently have: - Public Inputs are now passed to gate-functions as `Option<BlsScalar>`. - The `Composer` no longer stores the dense public input vector. Instead we store two sparse vectors which contain the values and the positions. - We include a function that allows the `Composer` to construct the dense PI vector from it's sparse ones. - We've added ways for the consumer to get access to the positions vector. This will allow to simplify the public input management on the `Circuit` trait.
After discussions with @ZER0 we realized there's not a need to have a really big trait to handle the public inputs and all we need is a simple structure that implements the conversions from the different PI types that we can have in PLONK circuits into the format that PLONK requires which is `&[BlsScalar]`. - Created `PublicInputValue` which is implemented for `BlsScalar`, `JubJubScalar` and `JubJubAffine`. - Forced the `Circuit` trait to use this struct as source of the public input values needed in the verification step.
Instead of storing the sparse representation of the non-zero PublicInputs as two different `Vec` which are logically connected but not tecnollogically(code-wise). With this change we can have them strictly correlated since they're stored linked in the `HashMap`.
We need to return the PI positons(and store them) in order since otherways when consumers ask for these data, it would be returned wrongly if we don't return it ordered.
This also allows to test wether the support for the PI handling of the Circuit trait is correct.
To allow (although it's not recommended to do) variable-size circuits, we need a way to express different circuit sizes (TRIM_SIZE) for the same circuit. By setting the `Circuit::TRIM_SIZE` inherit the value from the const generic parameter N, we enable this behaviour leaving an API that is not bad.
Since these two functions didn't need `Self` or `self` and also were independent, we've been able to remove them from the trait. This closes #396 and also allows us to have a generic method that can verify Proofs of any `Circuit` without needing to have access to the type of it.
Composer PI handling & Circuit trait refactor
The docs file had a faulty hyperlink. This is because within files it is not possible to connect to mod level markdowns. This is now removed.
Remove hyperlink from SNARK docs.
Resolves: #443
When we want to convert into bytes a `ProverKey` there are some of it's internal widget ProverKeys that contain empty polynomials because they haven't been used during the circuit building process. The serialization now is fixed and this structures are serialized correctly consuming no space when they're null.
Resolves: #354
Crate serialization major refactor & standarization
In order to impl the propper `BadLenght` trait & others we need to set the associated error for the `Serializable` trait impl for `Proof` as `dusk_bytes::Error` and take profit of the conversion with `?` to convert the error into a `plonk::Error` when needed. Resolves: #447
- Remove `Canon` impl for `Proof`. - Make the `std::Error` impl behind `std` flag. Resolves: #450
Fix Error type used for Serializable impl Proof
Fix canon feature related compilation errors
As discussed with the core team, this would enable features like circuit versioning with techniqes like: > You could generate the ID by hashing the `gadget()` fn code in a proc_macro with something like Blake3. Resolves: #417
Implement ID associated const for Circuit trait
ZER0
approved these changes
Mar 11, 2021
Resolves: #458
ZER0
approved these changes
Mar 11, 2021
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.
[0.6.0] - 11-03-21
Added
dusk_bytes::Serializable
for all possible structures that need serde. #352PublicInputValue
. #416padded_circuit_size
forVerifierKey
#351Circuit
. #396Removed
Canon
impl forProof
. #450PublicInputValues
. #416anyhow
andthiserror
. #343serialisation
module and use single serialization fn's. #347match
branch forvar_c
#414Changed
BTreeMap
#427collections::HashMap
byhashbrown::HashMap
. #424Circuit
trait now only requirespadded_circuit_size
for trimming. #351verify_proof
&build_pi
fromCircuit
. #396Resolves: #458