gnark icon indicating copy to clipboard operation
gnark copied to clipboard

Add VKK parameter to marshall logic of BN254 mpcsetup phase2Evaluations

Open irfanbozkurt opened this issue 1 year ago • 1 comments

Description

Fixes #1136

vkey has a parameter "G1.K" that directly comes from the "G1.VKK" parameter of a Phase2Evaluations. However, Phase2Evaluations's marshalling code lacks this parameter, and this causes vkey to have "G1.K" as an empty list.

Eventually, a proof generated by outputted pkey can't be verified with the outputted vkey.

Type of change

  • [X] Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Simply conduct a multi-party phase2 ceremony locally. At the end of each step (initialize, contribute, verify), save the created artifacts into files.

Finally, call ExtractKeys with the phase2Evaluations that you read from fs and you'll realize that the created vKey has its "G1.K" parameter as an empty list.

Checklist:

  • [X] 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
  • [X] I did not modify files generated from templates
  • [X] golangci-lint does not output errors locally
  • [X] New and existing unit tests pass locally with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

irfanbozkurt avatar May 21 '24 12:05 irfanbozkurt

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 21 '24 12:05 CLAassistant

I just checked out this pr with my own fork of semaphore-mtb-setup but it's not fixing the entire problem for me. I still get

❯ ./semaphore-mtb-setup sol vk                                                                                                                                  
2024/05/27 17:30:23 template: :104:15: executing "" at <index .G1.K 0>: error calling index: reflect: slice index out of range

0xForerunner avatar May 28 '24 00:05 0xForerunner

@irfanbozkurt did you mean to delete this?

0xForerunner avatar Jun 03 '24 14:06 0xForerunner