Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Input feed #8

Open
wants to merge 143 commits into
base: master
Choose a base branch
from
Open

[WIP] Input feed #8

wants to merge 143 commits into from

Conversation

bh2smith
Copy link

@bh2smith bh2smith commented Nov 30, 2018

New functionality includes

  • JSON to Serial R1CS and distributed R1CS
  • Plain Text to Serial R1CS

along with demo data.

Experimenting and Playing

Tests of these can be run in the command line (assuming installed dependencies) by

mvn -Dtest=distributedFromJSONTest test

and

mvn -Dtest=distributedFromTextTest test

To test on a third-party R1CS, one can edit the jsonFilePath and/or textFilePath in either of relations/DistributedInputFeedTest.java or relations/SerialInputFeedTest.java.

Note that one should consult the file format README in src/test/data/ before testing on your own format.

# Conflicts:
#	src/main/java/relations/objects/LinearCombination.java
- JSON import now accepts string or long values in constraint dictionary.
- Offload some repeted code to function call
- more general style for plain text input
Copy link

@fleupold fleupold left a comment

Choose a reason for hiding this comment

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

Great to see your progress! Looking at the size of this change we should have probably started sharing code earlier 😉.

I don't think the hash_transform files (e.g. hash_transform.qap.matrix_c) should be checked in. I like that you added simple examples to help understand what the python script does, but we shouldn't put our real use cases inside version control.

I think the python script in general, should not really be part of DIZK. It's unlikely that it will ever get merged in the main DIZK repository and could as well be a standalone repo that we as Gnosis manage.

To me, it looks like this PR contains a couple of different changes that would be nice to separate into their own PRs.

  1. adding toString methods
  2. pyscript to convert pepper into json (could become part of our dex-zksnarks repo or standalone)
  3. distributedR1CSFromJSON + tests (I somehow can't find the implementation of that function)

pyscripts/r1cs/utils.py Outdated Show resolved Hide resolved
pyscripts/r1cs/utils.py Outdated Show resolved Hide resolved
pyscripts/r1cs/utils.py Outdated Show resolved Hide resolved
pyscripts/r1cs/utils.py Outdated Show resolved Hide resolved
pyscripts/r1cs/utils.py Outdated Show resolved Hide resolved
src/main/java/profiler/generation/R1CSConstruction.java Outdated Show resolved Hide resolved
src/main/java/profiler/generation/R1CSConstruction.java Outdated Show resolved Hide resolved
src/main/java/profiler/generation/R1CSConstruction.java Outdated Show resolved Hide resolved
src/main/java/relations/objects/LinearCombination.java Outdated Show resolved Hide resolved
src/test/java/relations/DistributedInputFeedTest.java Outdated Show resolved Hide resolved
Copy link

@fleupold fleupold left a comment

Choose a reason for hiding this comment

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

Cool, the R1CS file reader is really awesome. I think we should split this code up a little bit more since at the moment there are a lot of different readers added. I find it quite hard to understand what's going on.

src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
src/main/java/relations/r1cs/FileToR1CS.java Outdated Show resolved Hide resolved
# Conflicts:
#	src/main/java/profiler/scripts/upload_and_login.sh
# Conflicts:
#	src/main/java/profiler/Profiler.java
#	src/main/java/profiler/scripts/launch.sh
#	src/main/java/profiler/scripts/upload_and_login.sh
…ed test data and update other test data accordingly
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.

None yet

3 participants