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

Index out of bounds, array has size 64, but index was 64 #7

Closed
porco-rosso-j opened this issue Sep 14, 2023 · 5 comments
Closed

Index out of bounds, array has size 64, but index was 64 #7

porco-rosso-j opened this issue Sep 14, 2023 · 5 comments

Comments

@porco-rosso-j
Copy link

I just cloned this repo, and the test throws the following error at this line

% nargo execute --package depth_8_state_proof
error: Index out of bounds, array has size 64, but index was 64
    ┌─ /Users/.../noir-trie-proofs/lib/src/lib.nr:447:30
    │
447 │             assert(nib[i] == key[key_ptr + i]);
    │                              ----------------
    │
    = Call stack:
      1. /Users/.../noir-trie-proofs/tests/depth_8_state_proof/src/main.nr:7:12
      2. /Users/.../noir-trie-proofs/lib/src/lib.nr:178:49
      3. /Users/.../noir-trie-proofs/lib/src/lib.nr:329:57
      4. /Users/.../noir-trie-proofs/lib/src/lib.nr:447:30

Error: Index out of bounds, array has size 64, but index was 64 at 29476

Location:
    crates/nargo_cli/src/cli/mod.rs:79:5

What's strange is that tests, such as cryptopunk1(), pass without errors.

A circuit in my project importing this repo also fails to run nargo prove throwing an error below. But again, tests run successfully.

Error: Trying to call acir_proofs_init_proving_key resulted in an error

Caused by:
    RuntimeError: out of bounds memory access

Location:
    crates/nargo_cli/src/cli/mod.rs:79:5

nargo version: v0.10.4 ( macOS (Apple Silicon) )

@porco-rosso-j porco-rosso-j changed the title ndex out of bounds, array has size 64, but index was 64 Index out of bounds, array has size 64, but index was 64 Sep 14, 2023
@ax0
Copy link
Contributor

ax0 commented Sep 14, 2023

Thanks for submitting an issue!

The bug you're experiencing has recently been fixed (see noir-lang/noir#2133). Could you try compiling Noir from source with the latest changes from master and report back?

@porco-rosso-j
Copy link
Author

unfortunately, it's still present. I reinstalled the latest package with nargo compile and made sure that the latest commit you made was reflected on the codebase.

For reference, here is my config and the commit hash of my nargo version.

[package]
authors = [""]
compiler_version = "0.10.4"
name = "sp"
type = "bin"

[dependencies]
proof = { git = "https://github.com/aragonzkresearch/noir-trie-proofs/", tag = "main", directory = "lib" }
ecrecover = { tag = "v0.10.0", git = "https://github.com/colinnielsen/ecrecover-noir" }

# noir_bigint = { tag = "v0.1.0", git = "https://github.com/shuklaayush/noir-bigint" }
nargo 0.10.4 (git version hash: b55f3998258e9c82a0312fc138e3c6b5cf1a7c74, is dirty: false)

does your nargo version correspond to the above?

@ax0
Copy link
Contributor

ax0 commented Sep 14, 2023

I'm on the following version and can confirm that proofs can be generated:

nargo 0.11.1 (git version hash: 2103b2ffb640fe457b24be09b6d63fe6ee1c6ac1, is dirty: false)

@porco-rosso-j
Copy link
Author

Now it works like a charm with the nargo version 2103b2. Thanks.

@ax0 ax0 closed this as completed Sep 14, 2023
@Cc-a23187
Copy link

Cc-a23187 commented Oct 11, 2023

I'm on the following version and can confirm that proofs can be generated:

nargo 0.11.1 (git version hash: 2103b2ffb640fe457b24be09b6d63fe6ee1c6ac1, is dirty: false)

When I used this version of nargo, there was such an error

nargo execute --package depth_8_storage_proof
Error: other error

Location:
    tooling/nargo_cli/src/cli/mod.rs:90:5

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

No branches or pull requests

3 participants