diff --git a/operator/pkg/operator.go b/operator/pkg/operator.go index d4c36355c..8e6fcbc95 100644 --- a/operator/pkg/operator.go +++ b/operator/pkg/operator.go @@ -31,6 +31,7 @@ import ( eigentypes "github.com/Layr-Labs/eigensdk-go/types" "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend/groth16" + bn254 "github.com/consensys/gnark/backend/groth16/bn254" "github.com/consensys/gnark/backend/plonk" "github.com/consensys/gnark/backend/witness" ethcommon "github.com/ethereum/go-ethereum/common" @@ -598,6 +599,18 @@ func (o *Operator) verifyGroth16Proof(proofBytes []byte, pubInputBytes []byte, v return false } + bn254Proof, ok := proof.(*bn254.Proof) + if !ok { + o.Logger.Warn("groth16 proof is not bn254") + return false + } + numCommitments := len(bn254Proof.Commitments) + if numCommitments > 1 { + o.Logger.Warn("too many commitments for groth16 proof (unsound for v0.10.0)", + "numCommitments", numCommitments) + return false + } + pubInputReader := bytes.NewReader(pubInputBytes) pubInput, err := witness.New(curve.ScalarField()) if err != nil {