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

Auto return doesn't work with arrays #455

Closed
1 of 2 tasks
Savio-Sou opened this issue Nov 9, 2022 · 1 comment · Fixed by #731
Closed
1 of 2 tasks

Auto return doesn't work with arrays #455

Savio-Sou opened this issue Nov 9, 2022 · 1 comment · Fixed by #731
Assignees
Labels
enhancement New feature or request

Comments

@Savio-Sou
Copy link
Collaborator

Description

Aim

Auto returning the value of an array without the need to specify it in Prover.toml before proving.

The feature was introduced in #360.

Expected behavior

main.nr

fn main(x : Field, y : pub Field) -> pub [Field; 2] {
    [x + y, y]
}

Prover.toml

x = "1"
y = "2"
return = []

Expect Verifier.toml to be auto-filled as:

Verifier.toml

y = "0x0000000000000000000000000000000000000000000000000000000000000002"
return = [
    "0x0000000000000000000000000000000000000000000000000000000000000003",
    "0x0000000000000000000000000000000000000000000000000000000000000002",
]

Bug

Instead, was prompted with the error below when proving:

The parameters in the main do not match the parameters in the Prover.toml file. 
Please check `return` parameter

To reproduce

  1. Fill main.nr as above
  2. Run nargo build
  3. Fill Prover.toml as above
  4. Run nargo prove p

Environment

  • OS: Linux (x86_64-pc-linux-gnu)

For nargo users

  • noir-lang/noir commit cloned: e885d42
  • Proving backend
    • default
      • Clang: 10.0.0-4ubuntu1
    • wasm-base
@Savio-Sou Savio-Sou added the bug Something isn't working label Nov 9, 2022
@vezenovm vezenovm added enhancement New feature or request and removed bug Something isn't working labels Nov 9, 2022
@vezenovm
Copy link
Contributor

vezenovm commented Nov 9, 2022

I changed this to enhancement as this is not supported yet with the auto-return feature:

//We do not support undefined arrays for now - TODO

The error makes sense as you did specify an empty return array.

To add some more context if you had specified return = "", you would see the error:

Values of array returned from main must be specified in prover toml file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment