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

Define a default ForeignCallHandler for NoirJS #3388

Closed
TomAFrench opened this issue Nov 1, 2023 · 3 comments
Closed

Define a default ForeignCallHandler for NoirJS #3388

TomAFrench opened this issue Nov 1, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

Problem

NoirJS will currently throw an error whenever it encounters a foreign call opcode within a brillig block. This is because the default foreign call handler doesn't know how to process any of these.

This is problematic as std::println is a common function which may exist in a circuit if a user is debugging using JS. It would be nicer if we had a handler for this foreign call type so that JS users can print values from their circuits without needing to write it themselves.

Happy Case

We should write a function in JS to properly format std::println calls and console.log them.

Alternatives Considered

No response

Additional Context

#3294 (comment)

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@TomAFrench TomAFrench added the enhancement New feature or request label Nov 1, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Nov 1, 2023
@signorecello
Copy link
Contributor

Hey @Savio-Sou can we prioritise this a bit? People are hitting this problem a lot with stuff like RSA verification...

@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Jan 2, 2024

NoirJS now skips all println as per #3764, so the function at the very least no longer blocks using programs with it with NoirJS.

A proper implementation / custom foreign call handler that parses println into console.log and fully addresses this Issue is not available yet.

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jan 3, 2024
@signorecello
Copy link
Contributor

I believe one can pass that as an oracle function @Savio-Sou so I'm closing this as completed for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

3 participants