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

pre-built MASP proofs for integration tests #1768

Merged
merged 4 commits into from
Aug 14, 2023
Merged

Conversation

tzemanovic
Copy link
Member

@tzemanovic tzemanovic commented Jul 26, 2023

Describe your changes

To speed-up MASP integration tests that were timing out in CI, this PR adds the ability to save and load proofs to/from files stored in test_fixtures/masp_proofs.

# Run the tests with the saved proofs.
make test-integration

# Delete old proofs, run the tests and save the new proofs.
# Use this is there's a breaking change in either the proof creation or 
# in the MASP integration tests that invalidates the previously saved proofs.
make test-integration-save-proofs

# Run without pre-built proofs
make test-integration-slow

The prebuilt proofs are added to make test-coverage to allow running integration tests in the CI.

The MASP proof builder in fn gen_shielded_transfer is optionally given a seed to produce deterministic output. When not specified, the original behavior is preserved (i.e. using OsRng, but now wrapped in StdRng which is cryptographically secure - see https://rust-random.github.io/rand/rand/trait.SeedableRng.html#method.from_rng for more details).

To enable deterministic builders, the Conversions type and notes positions in ShieldedContext are changed to BTreeMap and BTreeSet resp to provide deterministic output from fn collect_unspent_notes.

Indicate on which release or other PRs this topic is based on

0.20.0

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@tzemanovic tzemanovic force-pushed the tomas/pregen-masp-proofs branch from 29e5b07 to f805edb Compare July 26, 2023 16:36
@tzemanovic tzemanovic force-pushed the tomas/pregen-masp-proofs branch from f805edb to 83f5c2d Compare July 27, 2023 07:09
@tzemanovic tzemanovic requested a review from murisi July 27, 2023 07:33
@tzemanovic tzemanovic marked this pull request as ready for review July 27, 2023 07:33
@Fraccaman
Copy link
Member

this is awesome! Minor thing: can we remove the masp test from the e2e.json file?

@tzemanovic
Copy link
Member Author

this is awesome! Minor thing: can we remove the masp test from the e2e.json file?

cheers! It is already removed on main but this branch is based on 0.20 so it still appears here

@tzemanovic tzemanovic mentioned this pull request Aug 9, 2023
2 tasks
Fraccaman added a commit that referenced this pull request Aug 11, 2023
* origin/tomas/pregen-masp-proofs:
  changelog: add #1768
  make: add recipes for integration tests with saved MASP proofs
  test: add masp_proofs test fixtures
  shared/masp: allow to save and load proofs for tests
@Fraccaman Fraccaman mentioned this pull request Aug 11, 2023
Fraccaman added a commit that referenced this pull request Aug 13, 2023
* origin/tomas/pregen-masp-proofs:
  changelog: add #1768
  make: add recipes for integration tests with saved MASP proofs
  test: add masp_proofs test fixtures
  shared/masp: allow to save and load proofs for tests
Fraccaman added a commit that referenced this pull request Aug 13, 2023
* origin/tomas/pregen-masp-proofs:
  changelog: add #1768
  make: add recipes for integration tests with saved MASP proofs
  test: add masp_proofs test fixtures
  shared/masp: allow to save and load proofs for tests
@Fraccaman Fraccaman merged commit 01c63da into main Aug 14, 2023
@Fraccaman Fraccaman deleted the tomas/pregen-masp-proofs branch August 14, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants