Skip to content

small fixes v15#1646

Merged
ivokub merged 25 commits intomasterfrom
typo/fixes-v15
Jan 26, 2026
Merged

small fixes v15#1646
ivokub merged 25 commits intomasterfrom
typo/fixes-v15

Conversation

@ivokub
Copy link
Copy Markdown
Collaborator

@ivokub ivokub commented Nov 11, 2025

Collect different fixes.


Note

Broad set of small but important fixes and cleanups across backends and std libs.

  • Groth16 FFT kernels: remove duplicate twiddles[stage+1][1].BigInt calls before scaling a[7] in lagrange.go across all curves and the generator template
  • PLONK prover: fix variable shadowing in getRandomPolynomial (all curves) and update template; minor test cleanups (remove redundant rebinds)
  • Constraints API: optimize AssertIsCrumb with constant fast-path and single-constraint form in SCS; improved comments
  • Conversion utils: make assertBytesLeq accept disallowEquality and enforce strict < modulus by default; update call sites and extend tests
  • KZG verifier: correct generic type to GtElementT and constructor signature
  • Recursion/PLONK verifier: handle zero public inputs; fix PI accumulation when no publics; add dedicated test; switch to std slices
  • Emulated field/uints: use cmp.Ordered and slices.Max; guard empty polynomials; clearer hint error messages
  • Misc: drop golang.org/x/exp in favor of std slices; remove dead code; add stats/snippets for AssertIsCrumb; doc/comment tweaks

Written by Cursor Bugbot for commit c8a606f. This will update automatically on new commits. Configure here.

MozirDmitriy and others added 24 commits September 17, 2025 11:46
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
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>
… 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>
@ivokub ivokub requested a review from Copilot January 26, 2026 11:41
@ivokub ivokub marked this pull request as ready for review January 26, 2026 11:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/exp by 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.

@ivokub ivokub merged commit 407111e into master Jan 26, 2026
13 checks passed
@ivokub ivokub deleted the typo/fixes-v15 branch January 26, 2026 12:13
@ivokub ivokub restored the typo/fixes-v15 branch January 26, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.