Skip to content

Conversation

@Tabaie
Copy link
Contributor

@Tabaie Tabaie commented Sep 4, 2024

This PR fixes (i.e. always the same value) the randomness used in unsafe KZG SRS production. This results in getting the same SRS for a given domain every time, and even the same verifying key for different domain sizes over the same curve.
The intended application of this are tests involving batch verification of commitments - for example when verifying multiple PlonK proofs.

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

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

@Tabaie Tabaie requested a review from gbotrel September 4, 2024 18:49
@ivokub ivokub changed the title feat constant "randomness" - domain-size-independent vk feat constant 'randomness' - domain-size-independent vk Sep 5, 2024
@ivokub
Copy link
Collaborator

ivokub commented Sep 5, 2024

I would instead use an option for this a la WithAlpha etc. and keep the default behaviour to be randomized. I think if we by default use fixed alpha then it may obscure some other errors (e.g. some deserialized values are static when they are not supposed to be).

@gbotrel
Copy link
Collaborator

gbotrel commented Sep 5, 2024

+1 with @ivokub suggestion, just also on the off chance that some cavalier users, by mistake, do use this SRS in prod.

@ivokub
Copy link
Collaborator

ivokub commented Oct 3, 2024

I added an option to set the toxic value. @gbotrel can you review?

@ivokub ivokub merged commit 0002294 into master Oct 3, 2024
@ivokub ivokub deleted the feat/unsafezkg-samevk-simple branch October 3, 2024 13:28
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.

4 participants