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

perf, refactor: plonk prover #855

Merged
merged 70 commits into from Oct 12, 2023
Merged

perf, refactor: plonk prover #855

merged 70 commits into from Oct 12, 2023

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Oct 10, 2023

Description

Sister PR of Consensys/gnark-crypto#456 .

Goal is to make PlonK prover less memory greedy, more performant and more readable.

  • uses (more) FFT but on the small domain (by @ThomasPiellard )
  • stores the KZG SRS in canonical and Lagrange form which avoids some FFT and may result in a future PR in some additional perf gains (by @ThomasPiellard )

How has this been benchmarked?

4M constraints;

benchmark                    old ns/op      new ns/op      delta
BenchmarkProver/bn254-96     5232334900     4284055453     -18.12%

benchmark                    old allocs     new allocs     delta
BenchmarkProver/bn254-96     20763          18963          -8.67%

benchmark                    old bytes      new bytes      delta
BenchmarkProver/bn254-96     6348612832     4301645176     -32.24%

The memory gain is actually much larger than this, since the extended trace in the ProvingKey is gone, for large circuits that's dozen if not hundreds of GB.

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 10ms

TestIntegrationAPI/add 0s

TestIntegrationAPI/add/bls12_381 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bls12_381

TestIntegrationAPI/add/bn254 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:50
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	[assertIsEqual] 8 == 7
        	            	circuits.(*addCircuit).Define
        	            		add.go:19
        	            	
        	            	witness:{"A":6,"B":2,"C":123,"D":76,"Z":274033}
        	Test:       	TestIntegrationAPI/add/bn254

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 1m5.83s

TestIntegrationAPI/commit 920ms

TestIntegrationAPI/commit/bls12_377 0s

TestIntegrationAPI/commit/bls12_377/plonk 10ms

TestIntegrationAPI/commit/bls12_377/plonk/valid_witness 10ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bls12_377/plonk/valid_witness

TestIntegrationAPI/commit/bls12_381 0s

TestIntegrationAPI/commit/bls12_381/plonk 30ms

TestIntegrationAPI/commit/bls12_381/plonk/valid_witness 10ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bls12_381/plonk/valid_witness

TestIntegrationAPI/commit/bn254 0s

TestIntegrationAPI/commit/bn254/groth16 830ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness 830ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity 820ms

    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker generate --dir /tmp/gnark-solidity-check1487843102 --solidity gnark_verifier.sol
    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker verify --dir /tmp/gnark-solidity-check1487843102 --groth16 --nb-public-inputs 2 --proof 24cfe4898a00fe9939869ac0bebaf424a663f89b874baafc9064985b39c9f54019848405232f36408b02d3922d5e34800dcb30e8ffaa695bbe6b912223c150b32c90775afba127f9fbc7946e0f3593288553b2a529964d01e4c6d37602614d8b192a48e224dfbb625b5b6c0bf64cd7d00338dfbfaa10c38d4a39ae0d553ce0292984a43f7078a996eec2fda6b55023a34fe1df89a3a8bc5008fb22a97862d1cf0c6ea2c3d43389fe33e36d81f986bc3690d566f5214b37e250d22e3d995ff04d1071749e307b6f5b3eea89d0a778dcd4f8484d23a117291c362e1c9ee50819ed1f941a0a6ce8d8d296921c56af88aead0fb56752f0a85339775110537ec18397 --public-inputs 0000000000000000000000000000000000000000000000000000000000000010
    assert_checkcircuit.go:135: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert_solidity.go:99
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:135
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity
        	Messages:   	verify called
        	            	generating /tmp/gnark-solidity-check1487843102/main.go
        	            	generating /tmp/gnark-solidity-check1487843102/go.mod
        	            	running go mod tidy: /opt/hostedtoolcache/go/1.21.1/x64/bin/go mod tidy
        	            	running go run: /opt/hostedtoolcache/go/1.21.1/x64/bin/go run main.go gnark_solidity.go
        	            	error: exit status 1
        	            	output: panic: nbInputs != nbPublicInputs
        	            	
        	            	goroutine 1 [running]:
        	            	main.main()
        	            		/tmp/gnark-solidity-check1487843102/main.go:58 +0x7b9
        	            	exit status 2
        	            	

TestIntegrationAPI/commit/bn254/plonk 10ms

TestIntegrationAPI/commit/bn254/plonk/valid_witness 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bn254/plonk/valid_witness

TestIntegrationAPI/commit/bw6_761 0s

TestIntegrationAPI/commit/bw6_761/plonk 40ms

TestIntegrationAPI/commit/bw6_761/plonk/valid_witness 20ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bw6_761/plonk/valid_witness

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 1m5.71s

TestIntegrationAPI/commit 930ms

TestIntegrationAPI/commit/bls12_377 0s

TestIntegrationAPI/commit/bls12_377/plonk 10ms

TestIntegrationAPI/commit/bls12_377/plonk/valid_witness 10ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bls12_377/plonk/valid_witness

TestIntegrationAPI/commit/bls12_381 0s

TestIntegrationAPI/commit/bls12_381/plonk 30ms

TestIntegrationAPI/commit/bls12_381/plonk/valid_witness 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bls12_381/plonk/valid_witness

TestIntegrationAPI/commit/bn254 0s

TestIntegrationAPI/commit/bn254/groth16 840ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness 830ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity 830ms

    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker generate --dir /tmp/gnark-solidity-check1163302246 --solidity gnark_verifier.sol
    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker verify --dir /tmp/gnark-solidity-check1163302246 --groth16 --nb-public-inputs 2 --proof 0d3fb5b1ba4315659e4846366280e73521db54c4431f588bbdf39048e46835150cde84c28b51197191ef11e3a33289085b2e4b7e27bc6aa3d722d21b3b955aca10b6fafb8ce3e72faf0746c77292076715352e31acea231e96acbaf9851e2b9f0fd66a64410af3eb3e3a9129bc884b89be9710438a93fe4f5345d0cbde85a0ed27b0b6866e03a5c72694efb72a86e4ca0cdcd7472ff80176aaae4e156cb706d6137a7a85edf4e38b36635847a8216bdc853bb15c826a022efcf9d9bf5753641f22fa7c76ee2f71a80ad667472d148e68fd3af8f0187545f3db756f04c98e54b821262545d4ec92749b23b05b86e9c9f77b422fac0ddd9ba2e7e63e07a7b2f5e7 --public-inputs 0000000000000000000000000000000000000000000000000000000000000010
    assert_checkcircuit.go:135: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert_solidity.go:99
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:135
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity
        	Messages:   	verify called
        	            	generating /tmp/gnark-solidity-check1163302246/main.go
        	            	generating /tmp/gnark-solidity-check1163302246/go.mod
        	            	running go mod tidy: /opt/hostedtoolcache/go/1.21.1/x64/bin/go mod tidy
        	            	running go run: /opt/hostedtoolcache/go/1.21.1/x64/bin/go run main.go gnark_solidity.go
        	            	error: exit status 1
        	            	output: panic: nbInputs != nbPublicInputs
        	            	
        	            	goroutine 1 [running]:
        	            	main.main()
        	            		/tmp/gnark-solidity-check1163302246/main.go:58 +0x7b9
        	            	exit status 2
        	            	

TestIntegrationAPI/commit/bn254/plonk 10ms

TestIntegrationAPI/commit/bn254/plonk/valid_witness 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bn254/plonk/valid_witness

TestIntegrationAPI/commit/bw6_761 0s

TestIntegrationAPI/commit/bw6_761/plonk 40ms

TestIntegrationAPI/commit/bw6_761/plonk/valid_witness 20ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bw6_761/plonk/valid_witness

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 1m5.53s

TestIntegrationAPI/commit 950ms

TestIntegrationAPI/commit/bls12_377 0s

TestIntegrationAPI/commit/bls12_377/plonk 10ms

TestIntegrationAPI/commit/bls12_377/plonk/valid_witness 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bls12_377/plonk/valid_witness

TestIntegrationAPI/commit/bls12_381 0s

TestIntegrationAPI/commit/bls12_381/plonk 30ms

TestIntegrationAPI/commit/bls12_381/plonk/valid_witness 10ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bls12_381/plonk/valid_witness

TestIntegrationAPI/commit/bn254 0s

TestIntegrationAPI/commit/bn254/groth16 860ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness 850ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity 850ms

    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker generate --dir /tmp/gnark-solidity-check153446396 --solidity gnark_verifier.sol
    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker verify --dir /tmp/gnark-solidity-check153446396 --groth16 --nb-public-inputs 2 --proof 259b059b3f49be0577751fd97c91f9a1a2e560b108c950a6c161295c0244a12b2f0e633f4d858fb365d50eeafabecf186d747eabde3def1bbfe5887c487524d62ad1d71c778622f6266db5a9c45156f9c3ad15127ecf894e0c55c897b640fbb91113c32daff97b316219850ffbaac56e9ed8de20695eb28fb1695250a85d2f9a0528da9cba17f3c9b63e1b165a5702d52db9dab53d4eeb773234c8c10b17a93005727dd3f9f6b8610f67d0806c77ef4ca07dfb6cd85b0e804aafe5cda0216c7d29d6b2be51254210ac026a8447fb42a31b6bda5eb17103663b446016b260bf8f13c844130186653caed1ea8ee801e284a5ad8104f03a02b22b924f86f9968f67 --public-inputs 0000000000000000000000000000000000000000000000000000000000000010
    assert_checkcircuit.go:135: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert_solidity.go:99
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:135
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity
        	Messages:   	verify called
        	            	generating /tmp/gnark-solidity-check153446396/main.go
        	            	generating /tmp/gnark-solidity-check153446396/go.mod
        	            	running go mod tidy: /opt/hostedtoolcache/go/1.21.1/x64/bin/go mod tidy
        	            	running go run: /opt/hostedtoolcache/go/1.21.1/x64/bin/go run main.go gnark_solidity.go
        	            	error: exit status 1
        	            	output: panic: nbInputs != nbPublicInputs
        	            	
        	            	goroutine 1 [running]:
        	            	main.main()
        	            		/tmp/gnark-solidity-check153446396/main.go:58 +0x7b9
        	            	exit status 2
        	            	

TestIntegrationAPI/commit/bn254/plonk 10ms

TestIntegrationAPI/commit/bn254/plonk/valid_witness 0s

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bn254/plonk/valid_witness

TestIntegrationAPI/commit/bw6_761 0s

TestIntegrationAPI/commit/bw6_761/plonk 40ms

TestIntegrationAPI/commit/bw6_761/plonk/valid_witness 20ms

    assert.go:200: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert.go:200
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:129
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	claimed quotient is not as expected
        	            	witness:{"Public":16,"X":3}
        	Test:       	TestIntegrationAPI/commit/bw6_761/plonk/valid_witness

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 1m5.75s

TestIntegrationAPI/commit 970ms

TestIntegrationAPI/commit/bn254 0s

TestIntegrationAPI/commit/bn254/groth16 850ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness 850ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity 840ms

    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker generate --dir /tmp/gnark-solidity-check727272276 --solidity gnark_verifier.sol
    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker verify --dir /tmp/gnark-solidity-check727272276 --groth16 --nb-public-inputs 2 --proof 2dec83a854f69aa86c55f9aa337a723226973a89b6feccae19aeb2db1ee62a331664f7771767ddcc22ed227a1a5d9c51405c23cfdb2cfaa8a518226e0d67ceba04216effdd1db6fa704e9b68a0845edca2a49e9d59e46834ab74fc052e8b40c90bde4c0b01052812dfa2ed7a99b1cf3b07595fe1fbc6e7ffe6aedd05ef3219b42d1f78d38c91340d2cb9c975eb9d769b04890ad8881dfd7a8150909cd5dea89020917477157282bc138068a5ea8f5a3d79d1416992deaa9377f14d9276642f3b20738e1657bed1c3f98beadeca0dce2118d35a65ca96e7943888f07caf0481361c3d9c0290afadb411d0d99c37f42a9e91563d3d0e31e9ed7f2766f424c9a7ea --public-inputs 0000000000000000000000000000000000000000000000000000000000000010
    assert_checkcircuit.go:135: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert_solidity.go:99
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:135
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity
        	Messages:   	verify called
        	            	generating /tmp/gnark-solidity-check727272276/main.go
        	            	generating /tmp/gnark-solidity-check727272276/go.mod
        	            	running go mod tidy: /opt/hostedtoolcache/go/1.21.1/x64/bin/go mod tidy
        	            	running go run: /opt/hostedtoolcache/go/1.21.1/x64/bin/go run main.go gnark_solidity.go
        	            	error: exit status 1
        	            	output: panic: nbInputs != nbPublicInputs
        	            	
        	            	goroutine 1 [running]:
        	            	main.main()
        	            		/tmp/gnark-solidity-check727272276/main.go:58 +0x7b9
        	            	exit status 2
        	            	

TestIntegrationAPI/commit/bn254/plonk 20ms

TestIntegrationAPI/commit/bn254/plonk/valid_witness 20ms

TestIntegrationAPI/commit/bn254/plonk/valid_witness/solidity 10ms

    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker generate --dir /tmp/gnark-solidity-check442788554 --solidity gnark_verifier.sol
    assert_checkcircuit.go:135: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert_solidity.go:54
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:135
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationAPI/commit/bn254/plonk/valid_witness/solidity
        	Messages:   	generate called
        	            	running solc: /usr/bin/solc --evm-version paris --combined-json abi,bin /tmp/gnark-solidity-check442788554/gnark_verifier.sol -o /tmp/gnark-solidity-check442788554 --overwrite
        	            	error: exit status 1
        	            	output: Error: Identifier "proof_openings_selector_commit_api_at_zeta" not found.
        	            	   --> /tmp/gnark-solidity-check442788554/gnark_verifier.sol:845:35:
        	            	    |
        	            	845 |         let poscaz := add(aproof, proof_openings_selector_commit_api_at_zeta)
        	            	    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        	            	
        	            	Error: Identifier "vk_selector_commitments_commit_api_0_x" not found.
        	            	   --> /tmp/gnark-solidity-check442788554/gnark_verifier.sol:848:22:
        	            	    |
        	            	848 |         mstore(mPtr, vk_selector_commitments_commit_api_0_x)
        	            	    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        	            	
        	            	Error: Identifier "vk_selector_commitments_commit_api_0_y" not found.
        	            	   --> /tmp/gnark-solidity-check442788554/gnark_verifier.sol:849:24:
        	            	    |
        	            	849 |         mstore(mPtr20, vk_selector_commitments_commit_api_0_y)
        	            	    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        	            	
        	            	

@github-actions
Copy link

📦 github.com/consensys/gnark
TestIntegrationAPI 1m7.05s

TestIntegrationAPI/commit 1.02s

TestIntegrationAPI/commit/bn254 0s

TestIntegrationAPI/commit/bn254/groth16 910ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness 900ms

TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity 890ms

    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker generate --dir /tmp/gnark-solidity-check2260641457 --solidity gnark_verifier.sol
    assert_checkcircuit.go:135: running  /home/runner/go/bin/gnark-solidity-checker verify --dir /tmp/gnark-solidity-check2260641457 --groth16 --nb-public-inputs 2 --proof 03935f5e043bba6bc4b30b0433c1eb5faa5838735e37d473601a7892c9f4f7a4050742f1ae152985aa72cbbc02467584b306f068ad1fb88d7b047d30967df8980d300a2a94f919e49725765593bf7906a7eab7ca2ddfc1fb85d37fe617c0e6302fd33e93a0d208d3cc7d5c494e187562b68e6912cabc3586f4b293b4abbdd3e129e71cd7746841eb70ad0648714f9aa8aa183e2fdb26968c8c8f47eba88122b32c428b059e0beead351ec3d868e4c1d8da450a28b87910ad1b761c5586e884db2bbb3725bfce1148f8b47b5f4ac715b4258c3bfe642fc6e6a0f9e3ab1e2290642e3fc2d885a05c2dfb8e2893eb5c342d981b715d72fa309f2bacc06fecb6d4ee --public-inputs 0000000000000000000000000000000000000000000000000000000000000010
    assert_checkcircuit.go:135: 
        	Error Trace:	/home/runner/work/gnark/gnark/test/assert_solidity.go:99
        	            				/home/runner/work/gnark/gnark/test/assert_checkcircuit.go:135
        	            				/home/runner/work/gnark/gnark/test/assert.go:66
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationAPI/commit/bn254/groth16/valid_witness/solidity
        	Messages:   	verify called
        	            	generating /tmp/gnark-solidity-check2260641457/main.go
        	            	generating /tmp/gnark-solidity-check2260641457/go.mod
        	            	running go mod tidy: /opt/hostedtoolcache/go/1.21.1/x64/bin/go mod tidy
        	            	running go run: /opt/hostedtoolcache/go/1.21.1/x64/bin/go run main.go gnark_solidity.go
        	            	error: exit status 1
        	            	output: panic: nbInputs != nbPublicInputs
        	            	
        	            	goroutine 1 [running]:
        	            	main.main()
        	            		/tmp/gnark-solidity-check2260641457/main.go:58 +0x7b9
        	            	exit status 2
        	            	

@gbotrel gbotrel merged commit b6d704a into master Oct 12, 2023
3 checks passed
@gbotrel gbotrel deleted the refactor/cleanupplonkprover branch October 12, 2023 16:16
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

Successfully merging this pull request may close these issues.

None yet

2 participants