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

Add analyzeMethods() to ZkProgram #829

Merged

Conversation

maht0rz
Copy link
Contributor

@maht0rz maht0rz commented Apr 5, 2023

This PR implements #827 and adds a simple unit test for the proof_system.ts to test it.

I have encountered a few issues when implementing this:

  • i couldn't find an appropriate type/interface definition for analyzeMethod, so i've used its ReturnType instead.
  • run-unit-tests.sh does not work on Mac due to using features available on bash v4+ (mac runs bash v3). I have installed bash v5 with brew and ran unit tests by hand like this to workaround this issue: /opt/homebrew/bin/bash ./run-unit-tests.sh. This could be solved for the long term by replacing /bin/bash in the shell scripts to respect the user env, more information here

Question on the side - .github/workflows/build-action.yml does not seem to run unit tests. When/where do the unit tests run, assuming they're part of the CI? Answer: run-ci-tests.sh

Copy link
Collaborator

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

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

Very cool, thanks for this addition!

expect(incrementMethodMetadata).toEqual(
expect.objectContaining({
rows: 18,
digest: '62d893f727b12d540bdc483427cbd70b',
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove the digest here and in the other test? otherwise this will break every time pickles internal circuits change

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, never mind, this just gets the circuit created from the method directly, without extra stuff added by pickles. should be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please shine a bit more light in what you meant by ‘extra stuff added by pickles’? Do you mean the wrap circuit in SmartContract or something? 🧐

@mitschabaude
Copy link
Collaborator

@maht0rz one ask before I merge this - can you add your addition to CHANGELOG.md?

@maht0rz
Copy link
Contributor Author

maht0rz commented Apr 5, 2023

@mitschabaude i will add it to the changelog and ping you once i’m done thanks!

@mitschabaude mitschabaude merged commit 33a9946 into o1-labs:main Apr 7, 2023
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.

2 participants