From 438d154b7041aeb303b231b5106800cb8d4cbfb6 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Fri, 13 Oct 2023 02:15:58 +0800 Subject: [PATCH] fix typos (#857) --- backend/groth16/bn254/solidity.go | 4 ++-- backend/plonk/bls12-377/setup.go | 2 +- backend/plonk/bls12-381/setup.go | 2 +- backend/plonk/bls24-315/setup.go | 2 +- backend/plonk/bls24-317/setup.go | 2 +- backend/plonk/bn254/setup.go | 2 +- backend/plonk/bn254/solidity.go | 4 ++-- backend/plonk/bw6-633/setup.go | 2 +- backend/plonk/bw6-761/setup.go | 2 +- backend/plonkfri/bls12-377/setup.go | 2 +- backend/plonkfri/bls12-381/setup.go | 2 +- backend/plonkfri/bls24-315/setup.go | 2 +- backend/plonkfri/bls24-317/setup.go | 2 +- backend/plonkfri/bn254/setup.go | 2 +- backend/plonkfri/bw6-633/setup.go | 2 +- backend/plonkfri/bw6-761/setup.go | 2 +- constraint/core.go | 2 +- examples/rollup/error.go | 4 ++-- .../backend/template/zkpschemes/plonk/plonk.setup.go.tmpl | 2 +- .../backend/template/zkpschemes/plonkfri/plonk.setup.go.tmpl | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/backend/groth16/bn254/solidity.go b/backend/groth16/bn254/solidity.go index 0665d5a803..a7fef49d10 100644 --- a/backend/groth16/bn254/solidity.go +++ b/backend/groth16/bn254/solidity.go @@ -422,7 +422,7 @@ contract Verifier { /// @notice Reverts with InvalidProof if the proof is invalid or /// with PublicInputNotInField the public input is not reduced. /// @notice There is no return value. If the function does not revert, the - /// proof was succesfully verified. + /// proof was successfully verified. /// @param compressedProof the points (A, B, C) in compressed format /// matching the output of compressProof. /// @param input the public input field elements in the scalar field Fr. @@ -487,7 +487,7 @@ contract Verifier { /// @notice Reverts with InvalidProof if the proof is invalid or /// with PublicInputNotInField the public input is not reduced. /// @notice There is no return value. If the function does not revert, the - /// proof was succesfully verified. + /// proof was successfully verified. /// @param proof the points (A, B, C) in EIP-197 format matching the output /// of compressProof. /// @param input the public input field elements in the scalar field Fr. diff --git a/backend/plonk/bls12-377/setup.go b/backend/plonk/bls12-377/setup.go index 3f2822f235..cede3fe039 100644 --- a/backend/plonk/bls12-377/setup.go +++ b/backend/plonk/bls12-377/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonk/bls12-381/setup.go b/backend/plonk/bls12-381/setup.go index 6f668996d2..470f928e90 100644 --- a/backend/plonk/bls12-381/setup.go +++ b/backend/plonk/bls12-381/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonk/bls24-315/setup.go b/backend/plonk/bls24-315/setup.go index 508db24844..bdb6c050ad 100644 --- a/backend/plonk/bls24-315/setup.go +++ b/backend/plonk/bls24-315/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonk/bls24-317/setup.go b/backend/plonk/bls24-317/setup.go index aedca646bf..05e3c69112 100644 --- a/backend/plonk/bls24-317/setup.go +++ b/backend/plonk/bls24-317/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonk/bn254/setup.go b/backend/plonk/bn254/setup.go index 093c631b0d..dcd0481581 100644 --- a/backend/plonk/bn254/setup.go +++ b/backend/plonk/bn254/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonk/bn254/solidity.go b/backend/plonk/bn254/solidity.go index dac8a96c60..5a6c5e9eab 100644 --- a/backend/plonk/bn254/solidity.go +++ b/backend/plonk/bn254/solidity.go @@ -461,7 +461,7 @@ contract PlonkVerifier { // BEGINNING compute_pi ------------------------------------------------- - // public input (not comming from the commit api) contribution + // public input (not coming from the commit api) contribution // ins, n are the public inputs and number of public inputs respectively function sum_pi_wo_api_commit(ins, n, mPtr)->pi_wo_commit { @@ -716,7 +716,7 @@ contract PlonkVerifier { let mPtr := add(state, state_last_mem) // here the random is not a challenge, hence no need to use Fiat Shamir, we just - // need an unpredictible result. + // need an unpredictable result. let random := mod(keccak256(state, 0x20), r_mod) let folded_quotients := mPtr diff --git a/backend/plonk/bw6-633/setup.go b/backend/plonk/bw6-633/setup.go index 17536261eb..3be6c6fd5d 100644 --- a/backend/plonk/bw6-633/setup.go +++ b/backend/plonk/bw6-633/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonk/bw6-761/setup.go b/backend/plonk/bw6-761/setup.go index 2793004a54..e19f17f151 100644 --- a/backend/plonk/bw6-761/setup.go +++ b/backend/plonk/bw6-761/setup.go @@ -186,7 +186,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/backend/plonkfri/bls12-377/setup.go b/backend/plonkfri/bls12-377/setup.go index f4e5ad6daf..f24bb00188 100644 --- a/backend/plonkfri/bls12-377/setup.go +++ b/backend/plonkfri/bls12-377/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/backend/plonkfri/bls12-381/setup.go b/backend/plonkfri/bls12-381/setup.go index 11f574f5f2..5d8ef893a5 100644 --- a/backend/plonkfri/bls12-381/setup.go +++ b/backend/plonkfri/bls12-381/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/backend/plonkfri/bls24-315/setup.go b/backend/plonkfri/bls24-315/setup.go index c3c0837f90..b65e43fd6a 100644 --- a/backend/plonkfri/bls24-315/setup.go +++ b/backend/plonkfri/bls24-315/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/backend/plonkfri/bls24-317/setup.go b/backend/plonkfri/bls24-317/setup.go index 54668b98f8..5ad55bb5c9 100644 --- a/backend/plonkfri/bls24-317/setup.go +++ b/backend/plonkfri/bls24-317/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/backend/plonkfri/bn254/setup.go b/backend/plonkfri/bn254/setup.go index 9f69648ed1..62ecb4ccec 100644 --- a/backend/plonkfri/bn254/setup.go +++ b/backend/plonkfri/bn254/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/backend/plonkfri/bw6-633/setup.go b/backend/plonkfri/bw6-633/setup.go index 1384eed0bd..6ca38844d1 100644 --- a/backend/plonkfri/bw6-633/setup.go +++ b/backend/plonkfri/bw6-633/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/backend/plonkfri/bw6-761/setup.go b/backend/plonkfri/bw6-761/setup.go index a08a528d80..35d9409b84 100644 --- a/backend/plonkfri/bw6-761/setup.go +++ b/backend/plonkfri/bw6-761/setup.go @@ -147,7 +147,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero() diff --git a/constraint/core.go b/constraint/core.go index 12aac144cb..cd23e468d9 100644 --- a/constraint/core.go +++ b/constraint/core.go @@ -192,7 +192,7 @@ func (system *System) CheckSerializationHeader() error { if binaryVersion.Compare(objectVersion) != 0 { log := logger.Logger() - log.Warn().Str("binary", binaryVersion.String()).Str("object", objectVersion.String()).Msg("gnark version (binary) mismatch with constraint system. there are no guarantees on compatibilty") + log.Warn().Str("binary", binaryVersion.String()).Str("object", objectVersion.String()).Msg("gnark version (binary) mismatch with constraint system. there are no guarantees on compatibility") } // TODO @gbotrel maintain version changes and compare versions properly diff --git a/examples/rollup/error.go b/examples/rollup/error.go index 94e45ff069..b712599090 100644 --- a/examples/rollup/error.go +++ b/examples/rollup/error.go @@ -20,7 +20,7 @@ import "errors" var ( // ErrSizeByteSlice memory checking - ErrSizeByteSlice = errors.New("byte slice size is inconsistant with Account size") + ErrSizeByteSlice = errors.New("byte slice size is inconsistent with Account size") // ErrNonExistingAccount account not in the database ErrNonExistingAccount = errors.New("the account is not in the rollup database") @@ -31,7 +31,7 @@ var ( // ErrAmountTooHigh the amount is bigger than the balance ErrAmountTooHigh = errors.New("amount is bigger than balance") - // ErrNonce inconsistant nonce between transfer and account + // ErrNonce inconsistent nonce between transfer and account ErrNonce = errors.New("incorrect nonce") // ErrIndexConsistency the map publicKey(string) -> index(int) gives acces to the account position. diff --git a/internal/generator/backend/template/zkpschemes/plonk/plonk.setup.go.tmpl b/internal/generator/backend/template/zkpschemes/plonk/plonk.setup.go.tmpl index 8cffa80579..b41b6c745a 100644 --- a/internal/generator/backend/template/zkpschemes/plonk/plonk.setup.go.tmpl +++ b/internal/generator/backend/template/zkpschemes/plonk/plonk.setup.go.tmpl @@ -168,7 +168,7 @@ func BuildTrace(spr *cs.SparseR1CS, pt *Trace) { qk := make([]fr.Element, size) qcp := make([][]fr.Element, len(commitmentInfo)) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistent + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent ql[i].SetOne().Neg(&ql[i]) qr[i].SetZero() qm[i].SetZero() diff --git a/internal/generator/backend/template/zkpschemes/plonkfri/plonk.setup.go.tmpl b/internal/generator/backend/template/zkpschemes/plonkfri/plonk.setup.go.tmpl index 8e37dc17a1..f07bd1ecca 100644 --- a/internal/generator/backend/template/zkpschemes/plonkfri/plonk.setup.go.tmpl +++ b/internal/generator/backend/template/zkpschemes/plonkfri/plonk.setup.go.tmpl @@ -131,7 +131,7 @@ func Setup(spr *cs.SparseR1CS) (*ProvingKey, *VerifyingKey, error) { pk.LQkIncompleteDomainSmall = make([]fr.Element, pk.Domain[0].Cardinality) pk.CQkIncomplete = make([]fr.Element, pk.Domain[0].Cardinality) - for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error is size is inconsistant + for i := 0; i < len(spr.Public); i++ { // placeholders (-PUB_INPUT_i + qk_i = 0) TODO should return error if size is inconsistent pk.EvaluationQlDomainBigBitReversed[i].SetOne().Neg(&pk.EvaluationQlDomainBigBitReversed[i]) pk.EvaluationQrDomainBigBitReversed[i].SetZero() pk.EvaluationQmDomainBigBitReversed[i].SetZero()