noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
884 stars 195 forks source link

panic when running `nargo prove p` on the hello world in the doc #600

Closed lucadonnoh closed 1 year ago

lucadonnoh commented 1 year ago

Description

trying to prove the hello world from here https://noir-lang.github.io/book/getting_started/hello_world.html

Aim

run nargo prove p

Expected behavior

p.proof file

Bug

> nargo prove p
ACIR gates generated : 5
thread 'main' panicked at 'range end index 322560156 out of range for slice of length 110267286', /Users/runner/.cargo/git/checkouts/aztec_backend-a697fb631cbad807/e1f206f/common/src/crs.rs:32:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To reproduce

(Describe the steps to reproduce the behavior.)

  1. install nargo
  2. run the hello world tutorial
  3. prove

Environment

(Specify your setup and versions of dependencies.)

For nargo users

Additional context

nargo build runs fine

lucadonnoh commented 1 year ago

idk if related but i got this error while trying to build from source

image
kevaundray commented 1 year ago

Hey,

Thanks for spotting and taking the time to report this.

Your initial error is due to the backend not downloading all of the Common Reference String. This can usually happen if it was interrupted for some reason.

I'll get a fresh computer to test this out and get back to you :)

kevaundray commented 1 year ago

Your second issue is unrelated and will happen if you are building noir from source and using the master from the backend. I'll look more into this incase I am missing something as Noir should be pinned to a version of the backend which compiles on the CI from source

lucadonnoh commented 1 year ago

yeah i suspected the issue was with the downloading of the crs, probably my connection was not stable. do you know how can i fix it? i tried deleting the .nargo folder and reinstalling but the crs doesn’t seem to get redownloaded

kevaundray commented 1 year ago

The CRS is handled by the backend, so the backend states where it goes. For the aztec_backend, there is this line: https://github.com/noir-lang/aztec_backend/blob/master/common/src/crs.rs#L14

So its in your home_dir under noir_cache/ignition you should just be able to delete the noir_cache folder

kevaundray commented 1 year ago

You also make a good point, and we should probably standardise where the CRS goes and or have noir state where it goes. Since you intuitively thought it would be saved under .noir

lucadonnoh commented 1 year ago

i confirm that deleting the noir_cache folder and reinstalling fixes the issue

kevaundray commented 1 year ago

Great! I'll leave this issue open to track the points we discussed above

reinardl commented 1 year ago

Hi everyone,

I faced the same issue. I tried deleting noir_cache and reinstall everything from the scratch but it didn't work for me, the error is still there. Did I miss something ?

Thank you in advance

Savio-Sou commented 1 year ago

Hi everyone,

I faced the same issue. I tried deleting noir_cache and reinstall everything from the scratch but it didn't work for me, the error is still there. Did I miss something ?

Thank you in advance

Is your transcript00.dat file in the noir_cache folder of size ~300MB?

reinardl commented 1 year ago

Hi everyone, I faced the same issue. I tried deleting noir_cache and reinstall everything from the scratch but it didn't work for me, the error is still there. Did I miss something ? Thank you in advance

Is your transcript00.dat file in the noir_cache folder of size ~300MB?

Hi Globallager,

Thank you for replying.

No It is not, it's only ~80MB. When I ran nargo prove p and downloaded Ignite SRS, it always stopped at minute 5 and I got the same error as mentioned above.

[00:04:59] ######################################## 322560348/322560348 
Downloaded the SRS successfully!
Time Elapsed: 4 minutes

SRS is located at : "/Users/user/noir_cache/ignition/transcript00.dat"
thread 'main' panicked at 'range end index 322560156 out of range for slice of length 23077397', /Users/user/.cargo/git/checkouts/aztec_backend-a697fb631cbad807/484d1f3/common/src/crs.rs:32:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Savio-Sou commented 1 year ago

The SRS is hosted on AWS here: http://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat

See if downloading it using an alternative method (e.g. via browser, curl) gives you any luck?

reinardl commented 1 year ago

The SRS is hosted on AWS here: http://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat

See if downloading it using an alternative method (e.g. via browser, curl) gives you any luck?

Cool! It worked. Thank you @Globallager

TomAFrench commented 1 year ago

Closing this as this issue should be fixed (I remember Maxim discussing this)