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

wrap verifier calls in catch_unwind #17

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

larskuhtz
Copy link
Contributor

This prevents the Rust FFI calls from panicking and terminating the program with SIGABRT. Instead the verifier indicates an unsuccessful validation to the caller.

It is still the obligation of the caller to insure that the arguments are valid non-null null-terminated C-strings.

I would consider it a preliminary solution. Ideally, the verifier should return an error code (and/or possibly a message) on failure that that indicates what went wrong and allows the application to provide meaningful feedback to the user. (e.g. "invalid input encoding" vs. "proof validation failed").

@wwared
Copy link
Member

wwared commented Sep 23, 2024

I haven't tested this PR yet, but it's worth mentioning it might be worth looking at RFC 2945 and possibly using "C-unwind" abi instead of "C" if we are using catch_unwind.

@tchataigner tchataigner requested review from huitseeker and wwared and removed request for huitseeker September 24, 2024 08:56
Copy link
Member

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

This fixes the control flow issue for the node code.

We'll need to fix #2 for better error management, which should probably be addressed at the level of the Go FFI.

@huitseeker huitseeker merged commit 1f8c7d9 into argumentcomputer:main Sep 26, 2024
2 checks passed
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