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

Clarifying Documentation Through Corrections in Code Comments #954

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion constraint/r1cs.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (it *R1CIterator) Next() *R1C {
// if cptHints != 0 {
// // TODO @gbotrel @ivokub investigate --> emulated hints seems to go in this path a lot.
// sbb.WriteString(strconv.Itoa(cptHints))
// sbb.WriteString(" unconstrained hints; i.e. wire created through NewHint() but doesn't not appear in the constraint system")
// sbb.WriteString(" unconstrained hints; i.e. wire created through NewHint() but does not appear in the constraint system")
// sbb.WriteByte('\n')
// log := logger.Logger()
// log.Warn().Err(errors.New(sbb.String())).Send()
Expand Down
2 changes: 1 addition & 1 deletion constraint/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type ConstraintSystem interface {
// debug information only once.
AttachDebugInfo(debugInfo DebugInfo, constraintID []int)

// CheckUnconstrainedWires returns and error if the constraint system has wires that are not uniquely constrained.
// CheckUnconstrainedWires returns an error if the constraint system has wires that are not uniquely constrained.
// This is experimental.
CheckUnconstrainedWires() error

Expand Down
4 changes: 2 additions & 2 deletions frontend/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type API interface {
// * -1 if i1<i2.
//
// If the absolute difference between the variables i1 and i2 is known, then
// it is more efficient to use the bounded methdods in package
// it is more efficient to use the bounded methods in package
// [github.com/consensys/gnark/std/math/bits].
Cmp(i1, i2 Variable) Variable

Expand All @@ -127,7 +127,7 @@ type API interface {
// AssertIsLessOrEqual fails if v > bound.
//
// If the absolute difference between the variables b and bound is known, then
// it is more efficient to use the bounded methdods in package
// it is more efficient to use the bounded methods in package
// [github.com/consensys/gnark/std/math/bits].
AssertIsLessOrEqual(v Variable, bound Variable)

Expand Down
2 changes: 1 addition & 1 deletion frontend/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func parseCircuit(builder Builder, circuit Circuit) (err error) {
log := logger.Logger()
log.Info().Int("nbSecret", s.Secret).Int("nbPublic", s.Public).Msg("parsed circuit inputs")

// leaf handlers are called when encoutering leafs in the circuit data struct
// leaf handlers are called when encountering leafs in the circuit data struct
// leafs are Constraints that need to be initialized in the context of compiling a circuit
variableAdder := func(targetVisibility schema.Visibility) func(f schema.LeafInfo, tInput reflect.Value) error {
return func(f schema.LeafInfo, tInput reflect.Value) error {
Expand Down
4 changes: 2 additions & 2 deletions logger/logger.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package logger provides a configurable logger accross gnark components
// Package logger provides a configurable logger across gnark components
//
// The root logger defined by default uses github.com/rs/zerolog with a console writer
package logger
Expand Down Expand Up @@ -29,7 +29,7 @@ func SetOutput(w io.Writer) {
logger = logger.Output(w)
}

// Set allow a gnark user to overhide the global logger
// Set allow a gnark user to override the global logger
func Set(l zerolog.Logger) {
logger = l
}
Expand Down
2 changes: 1 addition & 1 deletion profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
// Profile represents an active constraint system profiling session.
type Profile struct {
// defaults to ./gnark.pprof
// if blank, profiile is not written to disk
// if blank, profile is not written to disk
filePath string

// actual pprof profile struct
Expand Down
2 changes: 1 addition & 1 deletion profile/profile_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// since we are assuming usage of this package from a single go routine, this channel only has
// one "producer", and one "consumer". it's purpose is to guarantee the order of execution of
// one "producer", and one "consumer". its purpose is to guarantee the order of execution of
// adding / removing a profiling session and sampling events, while enabling the caller
// (frontend.Compile) to sample the events asynchronously.
var chCommands = make(chan command, 100)
Expand Down
2 changes: 1 addition & 1 deletion std/commitments/kzg/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func (v *Verifier[FR, G1El, G2El, GTEl]) BatchVerifySinglePoint(digests []Commit
func (v *Verifier[FR, G1El, G2El, GTEl]) BatchVerifyMultiPoints(digests []Commitment[G1El], proofs []OpeningProof[FR, G1El], points []emulated.Element[FR], vk VerifyingKey[G1El, G2El]) error {
var fr FR

// check consistency nb proogs vs nb digests
// check consistency nb proofs vs nb digests
if len(digests) != len(proofs) {
return fmt.Errorf("number of commitments doesn't match number of proofs")
}
Expand Down
2 changes: 1 addition & 1 deletion std/internal/logderivarg/logderivarg.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// ∏_{f∈F} (x-f)^count(f, S) == ∏_{s∈S} x-s,
//
// where function `count` counts the number of occurences of f in S. The problem
// where function `count` counts the number of occurrences of f in S. The problem
// with this approach is the high cost for exponentiating the left-hand side of
// the equation. However, in [Haböck22] it was shown that when avoiding the
// poles, we can perform the same check for the log-derivative variant of the
Expand Down