Skip to content

fix(prover): make WriterstoEqual actually compare both encodings - #3732

Open
coeniebeyers wants to merge 2 commits into
LFDT-Lineth:mainfrom
coeniebeyers:upstream-writersto-equal
Open

fix(prover): make WriterstoEqual actually compare both encodings#3732
coeniebeyers wants to merge 2 commits into
LFDT-Lineth:mainfrom
coeniebeyers:upstream-writersto-equal

Conversation

@coeniebeyers

Copy link
Copy Markdown

Fixes #3731.

WriterstoEqual serialized both operands into one reused bytes.Buffer; the buffer's backing array survives Reset(), so the comparison matched a slice against itself and any two same-length encodings compared equal. This made LoadSetup's verifying-key↔SRS check always pass, silently.

Each operand now gets its own buffer. Includes table-driven tests plus TestWriterstoEqual_Regression_SameLengthDifferentContent, which fails on the previous implementation, and a doc-comment correction ("reports whether" implied a boolean return).

Fix authored by @mkrielza.

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this PR.
  • I have informed the team of any breaking changes if there are any.

No breaking API changes.

mkrielza and others added 2 commits August 6, 2026 10:34
Signed-off-by: Marelize <marelize.kriel@adhara.io>
Signed-off-by: Coenie Beyers <coenie.beyers@adhara.io>
…test

Signed-off-by: Coenie Beyers <coenie.beyers@adhara.io>
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.

[Prover] WriterstoEqual compares a slice against itself, making LoadSetup's verifying-key check always pass

2 participants