Skip to content

Conversation

@AlexandreBelling
Copy link
Collaborator

Description

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Test A
  • Test B

How has this been benchmarked?

  • Benchmark A, on Macbook pro M1, 32GB RAM
  • Benchmark B, on x86 Intel xxx, 16GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@AlexandreBelling AlexandreBelling self-assigned this Mar 31, 2025
@AlexandreBelling AlexandreBelling marked this pull request as ready for review April 9, 2025 08:48
@AlexandreBelling
Copy link
Collaborator Author

The PR is ready. I decided it's maybe simpler to keep the original function. I renamed it however

Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Looks good to me. Indeed I think we could optimize that we wouldn't add constraints for every constant (if they are duplicate), but I guess it shouldn't happen too much?

Only thing I would change is the name of the existing method - the documentation says GetWireConstraintsNoDuplicate but method name is GetWireConstraintsN. But I would keep it as is, because we use it using implicit interfaces and then its easier to keep existing implementation working.

@AlexandreBelling
Copy link
Collaborator Author

Fair enough. I have applied your suggestion. For the constant, it seems easy enough to use a map to read ten times the same constants. For MiMC, the constant is essentially the "0" that we use to initialize the state of a MiMC hasher.

@AlexandreBelling
Copy link
Collaborator Author

Lemme test this on my end before merging. Will merge after. Happy to get a reapproval :)

Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Yep - now it seems better. Now only the method documentation doesn't match the implementation.

Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

LGTM now. Thanks!

@AlexandreBelling AlexandreBelling merged commit 1e252ac into master Apr 9, 2025
5 checks passed
@AlexandreBelling AlexandreBelling deleted the feat/get-wires-constraints-exact branch April 9, 2025 12:50
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.

3 participants