-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support challenges #6
Comments
I guess you mean you "uncommented" the code and it seemed to work. I haven't tested this; I would like to do that but I'm a bit busy this week and next week, but you can test it yourself from this branch: https://github.com/Dhole/polyexen/tree/feature/halo2-backend-challenge (which is just the uncommented code and the assert). I don't think there's anything else needed to finish this, but I can't really confirm that yet as I'd like to test in in two weeks. |
I tested it and it seems like everything is working as I'd expect! See powdr-labs/powdr#1050. In this prototype, I'm assuming that I know the challenge in advance, so I can pass the entire witness to Have you thought about how that could be done properly? We would need some way to do the second-phase witness generation after the first challenges are available. For example, |
Ah, that must have been the reason why I left the code commented, because there's no way to properly calculate the witness without knowing the challenge, so I hardcoded a mock challenge! In a real circuit you will not know the challenge in advance, you'll only know it after committing to the witnesses of all phases up to each challenge.
You're totally right, to do this properly we require a back and forth between the frontend (powdr) and the backend (halo2 proving system). The callback is an option, although I'm more inclined on doing multiple calls like this:
This approach can't easily be done with the legacy halo2 API, but it's easy to do with the new frontend-backend split API privacy-scaling-explorations/halo2#254 although this new API hasn't been tested enough yet. Also it requires an API change to Plaf as well.
I can work on updating Plaf to work with the new frontend-backend split API and also adding support for multi-phase proving in two weeks. |
We use @Dhole do you think it makes more sense for us to do this directly via PSE's Halo2 new frontend-backend split, or via polyexen? |
This is a good point. Perhaps you can skip Plaf (and thus polyexen) and directly connect to the halo2 backend. You'll end up with a lighter implementation and reduce the number of dependencies. The Plaf struct and the struct that the halo2 backend receives are not too different. You can take a look at an example of how the frontend-backend split API is used here: In particular, this is the struct that contains the circuit definition that the backend expects, and the rest is just passing witnesses as vectors during proving time. https://github.com/privacy-scaling-explorations/halo2/blob/0b75a92a1c9c59b19304632e0bac6c788190a3aa/halo2_middleware/src/circuit.rs#L159 The only downside to going that route now is that the frontend-backend split is very recent and not very tested, and may suffer updates in the short term requiring changes in your integration (hopefully not many changes). But for the mid term I think transitioning to using directly the halo2 backend makes a lot of sense. |
It seems challenges are implemented for the most part, but some code is commented out (and instead of querying a challenge from Halo2, it returns a constant).
I tried just commenting it in and it compiles and looks like it could work! I'm wondering what's needed to finish it?
The text was updated successfully, but these errors were encountered: