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

Early exit in error callback from Wasm #9

Merged
merged 3 commits into from Nov 18, 2021
Merged

Early exit in error callback from Wasm #9

merged 3 commits into from Nov 18, 2021

Conversation

oskarth
Copy link
Contributor

@oskarth oskarth commented Nov 18, 2021

This avoids Wasm execution hanging due to problems such as wrong public input.

Mimics circom_runtime behaviour with less detailed debug information.

See https://github.com/iden3/circom_runtime/blob/master/js/witness_calculator.js#L52-L64

Adds test for wrong public input. Without early exit, the test stalls.
With it, the Circom build step fails as expected.

@oskarth
Copy link
Contributor Author

oskarth commented Nov 18, 2021

@gakonst Started with a Circom 1 circuit to familiarize myself a bit with how ark-circom and wasmer works. This is something I ran into that took a while to debug because of the lack of error handling.

This avoids Wasm execution hanging due to problems such as wrong public
input.

Mimics circom_runtime behaviour with less detailed debug information.

See https://github.com/iden3/circom_runtime/blob/master/js/witness_calculator.js#L52-L64

Adds test for wrong public input. Without early exit, the test stalls.
With it, the Circom build step fails as expected.
Copy link
Collaborator

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

LGTM, cleaned up the error handling a bit! thiserror is a wonderful crate if you didn't know about it

@gakonst gakonst merged commit b1daefc into arkworks-rs:master Nov 18, 2021
@oskarth
Copy link
Contributor Author

oskarth commented Nov 18, 2021

Thanks! Nice, didn't know about it

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.

None yet

2 participants