diff --git a/prover/server/prover/batch_address_append_circuit.go b/prover/server/prover/batch_address_append_circuit.go index a3935909a..458da3652 100644 --- a/prover/server/prover/batch_address_append_circuit.go +++ b/prover/server/prover/batch_address_append_circuit.go @@ -37,33 +37,6 @@ type BatchAddressTreeAppendCircuit struct { } func (circuit *BatchAddressTreeAppendCircuit) Define(api frontend.API) error { - // Create an array of binary digits representing 2^height - 1 - binaryDigits := make([]frontend.Variable, int(circuit.TreeHeight)) - for i := range binaryDigits { - binaryDigits[i] = 1 - } - // Validate StartIndex + BatchSize <= 2^TreeHeight - maxIndex := api.Sub(api.FromBinary(binaryDigits...), 1) - endIndex := api.Add(circuit.StartIndex, circuit.BatchSize) - api.AssertIsLessOrEqual(endIndex, maxIndex) - - // Validate array sizes match BatchSize - if len(circuit.LowElementValues) != int(circuit.BatchSize) || - len(circuit.LowElementNextIndices) != int(circuit.BatchSize) || - len(circuit.LowElementNextValues) != int(circuit.BatchSize) || - len(circuit.LowElementIndices) != int(circuit.BatchSize) || - len(circuit.NewElementValues) != int(circuit.BatchSize) { - return fmt.Errorf("array lengths must match BatchSize") - } - - // Validate proof lengths match TreeHeight - for i := 0; i < int(circuit.BatchSize); i++ { - if len(circuit.LowElementProofs[i]) != int(circuit.TreeHeight) || - len(circuit.NewElementProofs[i]) != int(circuit.TreeHeight) { - return fmt.Errorf("proof lengths must match TreeHeight") - } - } - currentRoot := circuit.OldRoot indexBits := api.ToBinary(circuit.StartIndex, int(circuit.TreeHeight))