Skip to content

Commit

Permalink
Merge branch 'murisi/mock-masp-prover' (#2695)
Browse files Browse the repository at this point in the history
* murisi/mock-masp-prover:
  masp: move the mock stuff under testing sub-mod
  Added changelog entry.
  Do not allow MASP_TEST_SEED to be used outside of testing.
  Implemented a MockSaplingVerificationContext and enable it for testing flag.
  Modified the transaction generator to use mock prover when in testing mode.
  • Loading branch information
tzemanovic committed Feb 27, 2024
2 parents 3a78df9 + 93b92c7 commit 53affea
Show file tree
Hide file tree
Showing 39 changed files with 253 additions and 269 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/testing/2695-mock-masp-prover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Implemented mock transaction prover and verifier for faster testing and lower
development time. ([\#2695](https://github.com/anoma/namada/pull/2695))
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ ledger-transport-hid = "0.10.0"
libc = "0.2.97"
libloading = "0.7.2"
# branch = "murisi/namada-integration"
masp_primitives = { git = "https://github.com/anoma/masp", tag = "v1.1.0" }
masp_proofs = { git = "https://github.com/anoma/masp", tag = "v1.1.0", default-features = false, features = ["local-prover"] }
masp_primitives = { git = "https://github.com/anoma/masp", rev = "30492323d98b0531fd18b6285cd94afcaa4066d2" }
masp_proofs = { git = "https://github.com/anoma/masp", rev = "30492323d98b0531fd18b6285cd94afcaa4066d2", default-features = false, features = ["local-prover"] }
num256 = "0.3.5"
num_cpus = "1.13.0"
num-derive = "0.3.3"
Expand Down
22 changes: 2 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package = namada
NAMADA_E2E_USE_PREBUILT_BINARIES ?= true
NAMADA_E2E_DEBUG ?= true
RUST_BACKTRACE ?= 1
NAMADA_MASP_TEST_SEED ?= 0
PROPTEST_CASES ?= 100
# Disable shrinking in `make test-pos-sm` for CI runs. If the test fail in CI,
# we only want to get the seed.
Expand Down Expand Up @@ -149,14 +148,12 @@ test: test-unit test-e2e test-wasm test-benches

test-coverage:
# Run integration tests separately because they require `integration`
# feature (and without coverage) and run them with pre-built MASP proofs
# feature (and without coverage)
$(cargo) +$(nightly) llvm-cov --output-path lcov.info \
--features namada/testing \
--lcov \
-- --skip e2e --skip pos_state_machine_test --skip integration \
-Z unstable-options --report-time && \
NAMADA_MASP_TEST_SEED=$(NAMADA_MASP_TEST_SEED) \
NAMADA_MASP_TEST_PROOFS=load \
$(cargo) +$(nightly) test integration:: \
--features integration \
-- -Z unstable-options --report-time
Expand All @@ -176,23 +173,8 @@ test-e2e:
--nocapture \
-Z unstable-options --report-time

# Run integration tests with pre-built MASP proofs
# Run integration tests
test-integration:
NAMADA_MASP_TEST_SEED=$(NAMADA_MASP_TEST_SEED) \
NAMADA_MASP_TEST_PROOFS=load \
make test-integration-slow

# Clear pre-built proofs, run integration tests and save the new proofs
test-integration-save-proofs:
# Clear old proofs first
rm -f test_fixtures/masp_proofs/*.bin || true
NAMADA_MASP_TEST_SEED=$(NAMADA_MASP_TEST_SEED) \
NAMADA_MASP_TEST_PROOFS=save \
TEST_FILTER=masp \
make test-integration-slow

# Run integration tests without specifying any pre-built MASP proofs option
test-integration-slow:
RUST_BACKTRACE=$(RUST_BACKTRACE) \
$(cargo) +$(nightly) test $(jobs) integration::$(TEST_FILTER) --features integration \
-Z unstable-options \
Expand Down
Loading

0 comments on commit 53affea

Please sign in to comment.