Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Define a "Brillig stdlib" for common functions for which the ACVM handles foreign calls. #464

Closed
TomAFrench opened this issue Jul 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

Problem

Noir is currently replacing the usage of a number of directives with Brillig functions which involve external calls. This is good as it will allow us to remove the Directive opcode in future however we're now performing foreign calls for several standard ACVM operations, e.g. checking equality between two values.

Happy Case

We should define a set of standard brillig functions such as inversion, division, etc. here in ACVM and have the ACVM catch the relevant foreign calls internally rather than requiring the environment to implement this logic.

Alternatives Considered

No response

Additional Context

ACVM JS currently won't process most Noir programs for this reason unless the caller includes the "invert" foreign call handler.

Would you like to submit a PR for this Issue?

Yes

Support Needs

No response

@TomAFrench TomAFrench added the enhancement New feature or request label Jul 30, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jul 30, 2023
@TomAFrench
Copy link
Member Author

This is just straight up incorrect. I think I brainfarted myself into thinking "brillig = foreign call" as we were using a foreign call to do inversion in the acvm_js tests but this isn't necessary.

@TomAFrench TomAFrench closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

1 participant