Skip to content
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

Add try_build_with_options #1391

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Conversation

ctian1
Copy link
Contributor

@ctian1 ctian1 commented Nov 29, 2023

When using cyclic recursion, CircuitBuilder::build_with_options currently checks that the resulting common data matches the data that was passed into CircuitBuilder::conditionally_verify_cyclic_proof, and panics if it's different. This PR adds a try_build_with_options function that always returns the data along with a boolean of whether it succeeded or not. This way, it's possible to get the correct common_data and pass it into conditionally_verify_cyclic_proof. The behavior of build_with_options is the same.

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

pub fn try_build_with_options<C: GenericConfig<D, F = F>>(
mut self,
commit_to_sigma: bool,
) -> (CircuitData<F, C, D>, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Result<> rather than a bool would be more rusty.

@puma314 puma314 merged commit 2d0df39 into 0xPolygonZero:main Dec 1, 2023
5 checks passed
@puma314 puma314 deleted the chris/recursion branch December 1, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants