@@ -32,7 +32,7 @@ import (
3232 "github.com/consensys/gnark/frontend"
3333 // "github.com/consensys/gnark/frontend/cs/r1cs"
3434 gadget "github.com/consensys/gnark/std/algebra/emulated/sw_bn254"
35- "github.com/consensys/gnark/std/math/emulated"
35+ // "github.com/consensys/gnark/std/math/emulated"
3636 "github.com/consensys/gnark/std/recursion/groth16"
3737 "github.com/holiman/uint256"
3838 "github.com/rs/zerolog/log"
@@ -142,7 +142,6 @@ func (p *proverServerBls12381) Poll(ctx context.Context, pollReq *grpc.PollReque
142142 commitmentHash := cometbn254 .HashToField (innerProof .ProofCommitment .Marshal ())
143143 bls12381Witness := & bls12381gadget.Circuit {
144144 // verifying key is baked in, so we don't set here since it has no effect on the witness generation
145- // VerifyingKey: circuitVk,
146145 InnerWitness : circuitWitness ,
147146 Proof : circuitProof ,
148147 CommitmentHash : commitmentHash .BigInt (new (big.Int )),
@@ -377,6 +376,7 @@ func loadOrCreateBls12381(r1csPath, pkPath, vkPath, innerR1csPath, innerPkPath,
377376 }
378377
379378 verifyingKey , err := groth16.ValueOfVerifyingKeyFixed [gadget.G1Affine , gadget.G2Affine , gadget.GTEl ](& vkInner )
379+ verifyingKey .PublicAndCommitmentCommitted = vkInner .PublicAndCommitmentCommitted
380380
381381 if err != nil {
382382 return cs , pk , vk , csInner , pkInner , vkInner , err
@@ -385,13 +385,10 @@ func loadOrCreateBls12381(r1csPath, pkPath, vkPath, innerR1csPath, innerPkPath,
385385 log .Info ().Msg ("Compiling circuit..." )
386386 r1csInstance , err := bls12381gadget .Compile (
387387 groth16.PlaceholderProof [gadget.G1Affine , gadget.G2Affine ](& csInner ),
388- groth16.Witness [gadget.ScalarField ]{
389- Public : make ([]emulated.Element [gadget.ScalarField ], csInner .GetNbPublicVariables ()),
390- },
388+ groth16.PlaceholderWitness [gadget.ScalarField ](& csInner ),
391389 verifyingKey ,
392390 )
393391
394- // r1csInstance, err := frontend.Compile(ecc.BLS12_381.ScalarField(), r1cs.NewBuilder, circuit, frontend.WithCompressThreshold(300))
395392 if err != nil {
396393 return cs , pk , vk , csInner , pkInner , vkInner , err
397394 }
0 commit comments