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

Recognise create_witin can't fail #488

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

matthiasgoergens
Copy link
Collaborator

Copy link
Collaborator

@bgillesp bgillesp left a comment

Choose a reason for hiding this comment

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

If everyone is happy with the scope of this simplification to the WitIn constructor (I think it's a reasonable change), the PR looks good to me overall.

One revision requested: make the id increment operation checked or panicking in CircuitBuilder::create_witin, and possibly extend the id type to 32 bits.

ceno_zkvm/src/circuit_builder.rs Show resolved Hide resolved
Copy link
Collaborator

@bgillesp bgillesp left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for taking a look at the WitIn id question!

let wit_in = WitIn {
id: {
let id = self.num_witin;
self.num_witin += 1;
self.num_witin = self.num_witin.strict_add(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't the strict_add a nightly-only experimental API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is. We already use a few other features like that.

This specific one would be easy to remove in the future, if we ever want to move to a stable version that doesn't have it.

@matthiasgoergens matthiasgoergens merged commit a74cbf3 into master Oct 29, 2024
6 checks passed
@matthiasgoergens matthiasgoergens deleted the matthias/remove-wrapper-1 branch October 29, 2024 10:03
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