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

groth16_bn254 prove failed, invalid witness size #1847

Open
2 tasks done
BC-A opened this issue Dec 7, 2024 · 2 comments
Open
2 tasks done

groth16_bn254 prove failed, invalid witness size #1847

BC-A opened this issue Dec 7, 2024 · 2 comments

Comments

@BC-A
Copy link

BC-A commented Dec 7, 2024

Component

sp1-sdk

Have you ensured that all of these are up to date?

  • SP1 SDK
  • cargo prove CLI/sp1up

What version of SP1 SDK are you on?

3.0.0

What version of the cargo prove CLI are you on?

cargo-prove sp1 (3917e90 2024-12-04T00:40:40.640074686Z)

Operating System

Linux (Ubuntu)

Describe the bug

When I go into the sp1/examples/fibonacci directory and execute the command cargo run --bin groth16_bn254, an error is reported:

warning: /mnt/nfs/sy/succinctlabs/sp1/examples/tendermint/script/Cargo.toml: default-features is ignored for serde_json, since default-features was not specified for workspace.dependencies.serde_json, this could become a hard error in the future
Updating crates.io index
Updating git repository https://github.com/sp1-patches/curve25519-dalek-ng.git
Updating git repository https://github.com/sp1-patches/signatures
warning: Patch sha2 v0.10.6 (https://github.com/sp1-patches/RustCrypto-hashes?tag=sha2-v0.10.6-patch-v1#e5f8b7ea) was not used in the crate graph.
Perhaps you misspelled the source URL being patched.
Possible URLs for [patch.<URL>]:
https://github.com/sp1-patches/RustCrypto-hashes
https://github.com/sp1-patches/RustCrypto-hashes.git
https://github.com/sp1-patches/RustCrypto-hashes
warning: Patch sha2 v0.9.8 (https://github.com/sp1-patches/RustCrypto-hashes?tag=sha2-v0.9.8-patch-v1#afdbfb09) was not used in the crate graph.
Perhaps you misspelled the source URL being patched.
Possible URLs for [patch.<URL>]:
https://github.com/sp1-patches/RustCrypto-hashes
https://github.com/sp1-patches/RustCrypto-hashes.git
https://github.com/sp1-patches/RustCrypto-hashes
warning: Patch ecdsa v0.16.8 (https://github.com/sp1-patches/signatures?branch=umadayal/secp256r1#49b62884) was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run cargo update to use the new
version. This may also occur with an optional dependency that is not enabled.
Locking 4 packages to latest compatible versions
Adding crossbeam-channel v0.5.13
Adding thiserror v2.0.4
Adding thiserror-impl v2.0.4
Adding tracing-appender v0.2.3
Compiling fibonacci-script v1.1.0 (/mnt/nfs/sy/succinctlabs/sp1/examples/fibonacci/script)
Compiling sp1-sdk v3.0.0 (/mnt/nfs/sy/succinctlabs/sp1/crates/sdk)
warning: [email protected]: fibonacci-program built at 2024-12-06 03:19:04
Finished dev profile [unoptimized + debuginfo] target(s) in 2m 01s
Running /mnt/nfs/sy/succinctlabs/sp1/examples/target/debug/groth16_bn254
Warning: Local prover in dev mode is not recommended. Proof generation may be slow.
vk: "0x0064991397873ac61e2b9924055418d3217c14d4a7774390abdd2b6be5fca409"
exp reverse bits len trace dims is width: 7, height: 131072
batch fri trace dims is width: 13, height: 262144
exp reverse bits len trace dims is width: 7, height: 65536
batch fri trace dims is width: 13, height: 262144
exp reverse bits len trace dims is width: 7, height: 65536
batch fri trace dims is width: 13, height: 262144
exp reverse bits len trace dims is width: 7, height: 65536
batch fri trace dims is width: 13, height: 262144
exp reverse bits len trace dims is width: 7, height: 262144
batch fri trace dims is width: 13, height: 524288
exp reverse bits len trace dims is width: 7, height: 262144
batch fri trace dims is width: 13, height: 524288
exp reverse bits len trace dims is width: 7, height: 262144
batch fri trace dims is width: 13, height: 524288
exp reverse bits len trace dims is width: 7, height: 131072
batch fri trace dims is width: 13, height: 262144
batch fri trace dims is width: 13, height: 65536
[sp1] groth16 circuit artifacts already seem to exist at /home/devadmin/.sp1/circuits/groth16/v3.0.0. if you want to re-download them, delete the directory
Setting environment variables took 13.004µs
Reading R1CS took 16.718763215s
Reading proving key took 1.60647557s
Reading witness file took 405.244µs
Deserializing JSON data took 9.798964ms
Generating witness took 226.527182ms
04:33:42 ERR error="invalid witness size, got 26119, expected 23846" nbConstraints=7493634
Error: invalid witness size, got 26119, expected 23846
panic: invalid witness size, got 26119, expected 23846

goroutine 17 [running, locked to thread]:
github.com/succinctlabs/sp1-recursion-gnark/sp1.ProveGroth16({0xc000256e38, 0x8}, {0xc000256e40, 0x8})
/sp1/crates/recursion/gnark-ffi/go/sp1/prove.go:171 +0xc9a
main.ProveGroth16Bn254(0x0?, 0x5c24d9bb14b0)
/sp1/crates/recursion/gnark-ffi/go/main.go:115 +0x5a
thread 'main' panicked at /mnt/nfs/sy/succinctlabs/sp1/crates/recursion/gnark-ffi/src/ffi/docker.rs:87:61:
failed to prove with docker: docker command failed
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@sourabhniyogi
Copy link

using main instead of dev cured this problem

04:33:42 ERR error="invalid witness size, got 26119, expected 23846" nbConstraints=7493634

Probably should make main the default branch of sp1 repo?

@BC-A
Copy link
Author

BC-A commented Dec 14, 2024

When I checkout to the v4.0.0-rc.1 tag, there is no such error.

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

2 participants