Skip to content

Conversation

@ivokub
Copy link
Collaborator

@ivokub ivokub commented Apr 18, 2024

Description

To allow different compatibility, it is beneficial to support different hash-to-field functions to hash the commitments to field in Solidity contract. This PR extends the ExportSolidity method to take in options which allow changing the functions. Later, we could possibly use the extendability to also change the HTF function for PLONK Solidity verifier, but keeping unchanged for now.

Also added TargetSolidity options for the prover and verifier which chooses all the parameters optimally for Solidity verifier. For PLONK prover it is currently no-op, but this allows more simply to change the hash functions we use within (with corresponding little gas savings).

Ref #1094

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

In package backend/solidity:

  • TestNoCommitment
  • TestSingleCommitment
  • TestTwoCommitments

And the subtests

How has this been benchmarked?

Not benchmarked, only changes Solidity verifier

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

@ivokub ivokub self-assigned this Apr 18, 2024
@ivokub ivokub added type: consolidate strengthen an existing feature priority: P3-low Issue priority: low. labels Apr 18, 2024
@ivokub ivokub force-pushed the feat/solidity-groth16-hashfn branch from 8f46a87 to d263ef2 Compare September 5, 2024 11:19
@ivokub ivokub marked this pull request as ready for review September 5, 2024 11:23
@ivokub ivokub force-pushed the feat/solidity-groth16-hashfn branch from d263ef2 to a314982 Compare September 5, 2024 11:23
@ivokub ivokub merged commit d651b89 into master Sep 5, 2024
@ivokub ivokub deleted the feat/solidity-groth16-hashfn branch September 5, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P3-low Issue priority: low. type: consolidate strengthen an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants