Skip to content

error in building circuit parse circuit: div by 0 with plonk backend #734

@jtguibas

Description

@jtguibas

I am working on a plonky2 verifier inside of gnark: https://github.com/succinctlabs/gnark-plonky2-verifier.

On branch john/gl-optimizations, I run into the following error when I run go run benchmark_plonk.go. It seems to have a division by zero issue at compilation.

The circuit works with the groth16 backend, but seems to not work with the plonk backend.

Steps to reproduce:

git clone https://github.com/succinctlabs/gnark-plonky2-verifier.git
cd gnark-plonky2-verifier
git checkout 485648aab2bc33edcc612b0eb9a6ee2983c904d4
go run benchmark_plonk.go -plonky2-circuit step

Trace:

jtguibas@Johns-MBP:~/Documents/Succinct/gnark-plonky2-verifier [john/gl-optimizations] » go run benchmark_
plonk.go -plonky2-circuit step
10:08:15 INF compiling circuit
10:08:15 INF parsed circuit inputs nbPublic=1350 nbSecret=11361
10:10:44 ERR parsing circuit error="div by 0\nfrontend.parseCircuit.func2\n\tcompile.go:118\nscs.(*builder).addConstraintExist\n\tbuilder.go:527\nscs.(*builder).splitSum\n\tbuilder.go:445\nscs.(*builder).Add\n\tapi.go:50\ngoldilocks.(*Chip).AddNoReduce\n\tbase.go:90\ngoldilocks.(*Chip).MulExtensionNoReduce\n\tquadratic_extension.go:70\ngoldilocks.(*Chip).MulExtension\n\tquadratic_extension.go:60\ngoldilocks.(*Chip).ScalarMulExtensionAlgebra\n\tquadratic_extension_algebra.go:83\ngates.(*PoseidonMdsGate).mdsRowShfAlgebra\n\tposeidon_mds_gate.go:60\ngates.(*PoseidonMdsGate).mdsLayerAlgebra\n\tposeidon_mds_gate.go:71\ngates.(*PoseidonMdsGate).EvalUnfiltered\n\tposeidon_mds_gate.go:88\ngates.(*EvaluateGatesChip).evalFiltered\n\tevaluate_gates.go:70\ngates.(*EvaluateGatesChip).EvaluateGateConstraints\n\tevaluate_gates.go:87\nplonk.(*PlonkChip).evalVanishingPoly\n\tplonk.go:114\nplonk.(*PlonkChip).Verify\n\tplonk.go:213\nverifier.(*VerifierChip).Verify\n\tverifier.go:160\nmain.(*BenchmarkPlonky2VerifierCircuitPlonk).Define\n\tbenchmark_plonk.go:39\n"
error in building circuit parse circuit: div by 0
frontend.parseCircuit.func2
	compile.go:118
scs.(*builder).addConstraintExist
	builder.go:527
scs.(*builder).splitSum
	builder.go:445
scs.(*builder).Add
	api.go:50
goldilocks.(*Chip).AddNoReduce
	base.go:90
goldilocks.(*Chip).MulExtensionNoReduce
	quadratic_extension.go:70
goldilocks.(*Chip).MulExtension
	quadratic_extension.go:60
goldilocks.(*Chip).ScalarMulExtensionAlgebra
	quadratic_extension_algebra.go:83
gates.(*PoseidonMdsGate).mdsRowShfAlgebra
	poseidon_mds_gate.go:60
gates.(*PoseidonMdsGate).mdsLayerAlgebra
	poseidon_mds_gate.go:71
gates.(*PoseidonMdsGate).EvalUnfiltered
	poseidon_mds_gate.go:88
gates.(*EvaluateGatesChip).evalFiltered
	evaluate_gates.go:70
gates.(*EvaluateGatesChip).EvaluateGateConstraints
	evaluate_gates.go:87
plonk.(*PlonkChip).evalVanishingPoly
	plonk.go:114
plonk.(*PlonkChip).Verify
	plonk.go:213
verifier.(*VerifierChip).Verify
	verifier.go:160
main.(*BenchmarkPlonky2VerifierCircuitPlonk).Define
	benchmark_plonk.go:39

exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions