onurinanc / noir-bls-signature

BLS12_381 Signature Verification written in Noir
3 stars 0 forks source link

unable to run test_verify_bls_signature #2

Open stefan-nikolov96 opened 8 months ago

stefan-nikolov96 commented 8 months ago

I am unable to run test_verify_bls_signature() with over 256GiB in RAM and just as much in swap memory. I get a memory overflow and then the program recieves a SIGKILL signal from the OS.

I tried running nargo compile in debug and release mode and with 0.9.0 and 0.15.0 compiler versions.

GDB shows that the nargo overflows in the compiler frontend. On a machine with 64GiB RAM, it uses about 50GiB during inlining and the program fails during mem2reg https://github.com/noir-lang/noir/blob/master/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs

Since @onurinanc commented that this test runs on a 16GiB machine, can you rerun it and verify it still works and specify any additional compiler flags or steps you take before running nargo compile?

onurinanc commented 8 months ago

@stefan-nikolov96 Thank you for the issue that you created. I'm also having the same issue with the 16GiB machine. I'll create an issue about this in Noir-lang repository

stefan-nikolov96 commented 8 months ago

@onurinanc Thanks for the quick response. Do you remember which release you used, so I can test on that version of noir while this gets resolved?

onurinanc commented 8 months ago

@stefan-nikolov96 I compiled it with the version 0.9.0. However, I am having the same issue also in that version. I benchmarked it without totally compiled. (so, it won't work also for you, but you may try to approximate the proving time using the same method I used below)

I reduced the loop count in the miller loop an benchmark it, for example, for i in 0..2 -> 30 minutes, for i in 0..8, for i in 0..10, for i in 0..12, and have an approximate benchmark for this. Also, I use the similar technique while benchmarking the final_exponentiation circuit.