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

[berkeley] Use Proof_cache for more transaction snark tests, make tests deterministic #14358

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

mrmr1993
Copy link
Member

This PR builds upon #14031, using the Proof_cache mechanism to cache more proofs generated in the transaction snark tests.

In order for this to work, this PR also replaces some uses of the non-deterministic Private_key.create with the Private_key.gen quickcheck generator, so that we achieve cache hits for all of the relevant tests.

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them

@mrmr1993 mrmr1993 requested a review from a team as a code owner October 17, 2023 14:42
@mrmr1993
Copy link
Member Author

!ci-build-me

@@ -993,4 +1011,11 @@ let%test_module "Account precondition tests" =
failwith
"Expected transaction to fail due to invalid account \
precondition in the fee payer" ) )

let () =
match Sys.getenv_opt "PROOF_CACHE_OUT" with
Copy link
Member

Choose a reason for hiding this comment

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

What happens here if we run unit tests with -only-test flags? Would we get a proof cache out at the end which is missing some of the necessary proofs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only if you also set the PROOF_CACHE_OUT environment variable (see here).

Copy link
Member Author

Choose a reason for hiding this comment

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

So basically: don't do that :)

Base automatically changed from feature/use-proof-cache to berkeley October 17, 2023 19:05
@mrmr1993
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member Author

!approved-for-mainnet

@mrmr1993 mrmr1993 merged commit 2825f09 into berkeley Oct 17, 2023
1 of 2 checks passed
@mrmr1993 mrmr1993 deleted the feature/use-proof-cache-more branch October 17, 2023 20:59
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