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

Compiler panics on unsupported types to main rather than issuing a compiler error #3062

Closed
jordan-public opened this issue Oct 10, 2023 · 1 comment · Fixed by #3220
Closed
Assignees
Labels
bug Something isn't working compiler frontend `noirc_frontend` crate

Comments

@jordan-public
Copy link

Aim

nargo --version
nargo 0.10.5 (git version hash: 91efe44, is dirty: false)

git clone [email protected]:Savio-Sou/recursion-demo.git

nargo compile

Expected Behavior

Success

Bug

after fixing to:
fn main(
verification_key : [Field],
proof : [Field],
public_inputs : [Field],
key_hash : Field,
input_aggregation_object : [Field; 16],
proof_b : [Field],

nargo compile
The application panicked (crashed).
Message: internal error: entered unreachable code: ICE: Params to the program should only contains numbers and arrays
Location: crates/noirc_evaluator/src/ssa/acir_gen/mod.rs:283

This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.
If there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml

To Reproduce

  1. See above

Installation Method

Binary

Nargo Version

nargo 0.10.5 (git version hash: 91efe44, is dirty: false)

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@jordan-public jordan-public added the bug Something isn't working label Oct 10, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 10, 2023
@jfecher
Copy link
Contributor

jfecher commented Oct 10, 2023

Apologies for the bad error message! The error is trying to say that only numbers (field & integer types) and arrays (not slices!) are supported as parameters to main. So in your example:

fn main(
    verification_key : [Field],
    proof : [Field],
    public_inputs : [Field],
    key_hash : Field,
    input_aggregation_object : [Field; 16],
    proof_b : [Field],
)

Several parameters are slices instead of arrays which causes this panic. We'll work on making this panic a proper error message but when that is done the code will still be invalid. As a workaround to not supporting slices, you can choose an arbitrary maximum size for each slice, change them to arrays, and fill the rest of the new elements with some padding in the Prover.toml.

@jfecher jfecher changed the title nargo compile crashes Compiler panics on unsupported types to main rather than issuing a compiler error Oct 10, 2023
@jfecher jfecher added P-MEDIUM compiler frontend `noirc_frontend` crate labels Oct 10, 2023
@jfecher jfecher self-assigned this Oct 10, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler frontend `noirc_frontend` crate
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants