-
Notifications
You must be signed in to change notification settings - Fork 77
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
Refactor away from PairingEngine + misc type changes #61
Conversation
Thanks for the PR! For the type parameters, can you use a |
Also, if you think it's not ready for review you can mark it as draft so we know it's not ready from the PR list. |
Hey @joebebel this looks really promising! Willing to see it completed! Also, as @bhgomes suggested, if you mark it as Draft for now while the PR is not ready would be nice! :) |
@joebebel Also, going this way will probably imply gate-featured verification & prover for IPA and KZG verifications. As now the verification always uses pairings and you don't want to enforce the |
we should just bind to
As long as we're generic over the field and the |
OK, this is getting closer. There are some problems:
I think other than the regression in the efficiency of the polynomial commitment and the error handling, it's ready to review for merge. |
Whenever an error type is an associated type of a trait, you cannot write a let value = fn_returning_ark_poly_commit_error(x, y, z).map_err(ark_plonk::Error::CustomVariant)?; It would be nice if the error could be converted with an
I think that the inner curve abstractions in arkworks are lacking here, and in general, there should be a trait that defines the addition and scalar multiplication laws for the curves directly, and the |
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.
Just went over the surface and highlighted a few possible leftovers.
Will go in depth as soon as all is cleared! :)
// assert_eq!( | ||
// self.variables[&a].into_repr() | ||
// & (E::Fr::from(2u64).pow(&[(num_bits) as u64, 0, 0, 0]) | ||
// - E::Fr::one()) | ||
// & (F::from(2u64).pow(&[(num_bits) as u64, 0, 0, 0]) | ||
// - F::one()) | ||
// .into_repr(), | ||
// self.variables[&self.w_l[self.n - 1]] | ||
// ); | ||
// assert_eq!( | ||
// self.variables[&b] | ||
// & (E::Fr::from(2u64).pow(&[(num_bits) as u64, 0, 0, 0]) | ||
// - E::Fr::one()), | ||
// & (F::from(2u64).pow(&[(num_bits) as u64, 0, 0, 0]) | ||
// - F::one()), | ||
// self.variables[&self.w_r[self.n - 1]] | ||
// ); |
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.
We should file an issue for this.
(Not relevant to the PR)
/* | ||
impl<F, P> GateConstraint<F> for FixedBaseScalarMul<F, P> | ||
where | ||
F: Field, | ||
P: SWModelParameters<BaseField = F>, | ||
{ | ||
}*/ |
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.
Leftover?
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.
We need a better way of abstracting the embedded curve type
This should not be the case unless you're using hiding and/or strict degree bounds (which plonk doesn't need, AFAIK). I can hop on a call to help debug. btw you can turn on the |
I don't know what I changed to fix it, but now it functions correctly. It wasn't a problem with the aggregation, though; the error was |
When this ready for a review, even if still in draft, could you let us know and I'll give a first round? 😄 @joebebel |
I believe this branch is now non-inferior (passes all tests, etc) to the main branch, so it is "ready for review". There is one main deficiency, which is that it performs two Thanks @Pratyush, I figured out what you meant about the trait bounding and it seems to work well. Also thanks @bhgomes, the error handling is better now. |
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.
What an amazing PR!
Just highlighted a couple of nits but overall I love the improvements introduced. Great job! :)
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.
Some nits and questions.
Aside from that, this is a brilliant work @joebebel.
Congratulations and big thanks for this huge improvement! 🥇
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.
A couple unused things in proof.rs
Once fixed the CI should pass.
Once it passes, feel free to merge!
Awesome job with this PR @joebebel !!!!!
OK, ready to merge |
Summary of changes:
In summary this PR is not really ready to be merged, but open to input and feedback.