Merged
Conversation
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
…eck formula comment (#1603)
Signed-off-by: stemlaud <stemlaud@outlook.com> Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
…nding (PLONK bn254) (#1619) Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Signed-off-by: boqishan <boqishan@126.com>
… tests (#1618) Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR collects various small fixes and improvements across the codebase, focusing on code modernization, bug fixes, and quality improvements.
Changes:
- Removed dependency on
golang.org/x/expby using standard library equivalents (slices,cmp) - Removed unnecessary loop variable shadowing (Go 1.22+ style)
- Fixed PLONK verifier to properly handle circuits with zero public inputs
- Enhanced byte-to-native conversion functions with strict inequality checks
- Improved error messages and API documentation
Reviewed changes
Copilot reviewed 37 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod, go.sum | Removed golang.org/x/exp dependency |
| std/recursion/wrapped_hash.go | Changed import from golang.org/x/exp/slices to slices |
| std/fiat-shamir/transcript.go | Changed import from golang.org/x/exp/slices to slices |
| std/math/emulated/field.go | Changed imports to use cmp instead of golang.org/x/exp/constraints, removed custom max function |
| std/math/emulated/field_mul.go | Added zero-term check and replaced custom max with slices.Max |
| std/compress/io.go | Removed custom min function in favor of built-in |
| test/assert_checkcircuit.go | Removed unnecessary loop variable shadowing |
| std/recursion/wrapped_hash_test.go | Removed unnecessary loop variable shadowing |
| backend/plonk/plonk_test.go | Removed unnecessary loop variable shadowing |
| std/recursion/plonk/verifier.go | Fixed handling of zero public inputs in PLONK verifier |
| std/recursion/plonk/verifier_test.go | Added test for zero public inputs case |
| std/conversion/conversion.go | Added disallowEquality parameter to assertBytesLeq for strict inequality checks |
| std/conversion/conversion_test.go | Updated tests for strict inequality checking |
| std/math/uints/hints.go | Improved error message formatting |
| std/commitments/kzg/verifier.go | Fixed type parameter from G2ElementT to GtElementT |
| std/accumulator/merkle/verify.go | Improved function documentation |
| frontend/cs/scs/api_assertions.go | Enhanced AssertIsCrumb with better error messages and comments |
| frontend/cs/r1cs/api_assertions.go | Enhanced AssertIsCrumb with constant handling and better comments |
| backend/plonk/*/prove.go | Fixed variable shadowing bug in getRandomPolynomial |
| backend/groth16/*/mpcsetup/lagrange.go | Removed duplicate twiddle assignment |
| internal/generator/backend/template/zkpschemes/plonk/plonk.prove.go.tmpl | Fixed variable shadowing bug in template |
| internal/generator/backend/template/zkpschemes/groth16/mpcsetup/lagrange.go.tmpl | Removed duplicate twiddle assignment in template |
| internal/stats/snippet.go | Added snippet for AssertIsCrumb |
| internal/stats/latest_stats.csv | Updated stats with AssertIsCrumb benchmarks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collect different fixes.
Note
Broad set of small but important fixes and cleanups across backends and std libs.
twiddles[stage+1][1].BigIntcalls before scalinga[7]inlagrange.goacross all curves and the generator templategetRandomPolynomial(all curves) and update template; minor test cleanups (remove redundant rebinds)AssertIsCrumbwith constant fast-path and single-constraint form in SCS; improved commentsassertBytesLeqacceptdisallowEqualityand enforce strict< modulusby default; update call sites and extend testsGtElementTand constructor signatureslicescmp.Orderedandslices.Max; guard empty polynomials; clearer hint error messagesgolang.org/x/expin favor of stdslices; remove dead code; add stats/snippets forAssertIsCrumb; doc/comment tweaksWritten by Cursor Bugbot for commit c8a606f. This will update automatically on new commits. Configure here.