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

Test with bundled prover instead of local prover. #1017

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Fetch path to Zcash parameters
working-directory: ./zcash_proofs
shell: bash
run: echo "ZCASH_PARAMS=$(cargo run --release --example get-params-path --features directories)" >> $GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

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

We can delete the get-params-path example now; it was only added for use in our CI. (However, we should verify that zebrad's CI isn't also using it; I think they might have been at one stage.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

git grep shows no usage of get-params-path in the zebrad repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, what they actually did is copied those files into their CI. They removed their copies in ZcashFoundation/zebra#7800.

Copy link
Contributor

Choose a reason for hiding this comment

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

So yes, we can just remove zcash_proofs/examples/ entirely (I don't think we need to offer Sprout parameter downloading examples either).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

- name: Cache Zcash parameters
id: cache-params
uses: actions/[email protected]
with:
path: ${{ env.ZCASH_PARAMS }}
key: ${{ runner.os }}-params
- name: Fetch Zcash parameters
if: steps.cache-params.outputs.cache-hit != 'true'
working-directory: ./zcash_proofs
run: cargo run --release --example download-params --features download-params
Copy link
Contributor

Choose a reason for hiding this comment

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

We can delete the download-params example now; it was only added for use in our CI. (However, we should verify that zebrad's CI isn't also using it; I think they might have been at one stage.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

git grep shows no usage of download-params in the zebrad repo.


- name: Run tests
run: cargo test --all-features --verbose --release --all
- name: Run slow tests
Expand Down Expand Up @@ -121,21 +106,6 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Fetch path to Zcash parameters
working-directory: ./zcash_proofs
shell: bash
run: echo "ZCASH_PARAMS=$(cargo run --release --example get-params-path --features directories)" >> $GITHUB_ENV
- name: Cache Zcash parameters
id: cache-params
uses: actions/[email protected]
with:
path: ${{ env.ZCASH_PARAMS }}
key: ${{ runner.os }}-params
- name: Fetch Zcash parameters
if: steps.cache-params.outputs.cache-hit != 'true'
working-directory: ./zcash_proofs
run: cargo run --release --example download-params --features download-params

- name: Generate coverage report
run: cargo tarpaulin --engine llvm --all-features --release --timeout 600 --out xml
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ rand_core.workspace = true
regex = "1.4"
tempfile = "3.5.0"
zcash_note_encryption.workspace = true
zcash_proofs = { workspace = true, features = ["local-prover"] }
zcash_proofs = { workspace = true, features = ["bundled-prover"] }
zcash_primitives = { workspace = true, features = ["test-dependencies"] }
zcash_client_backend = { workspace = true, features = ["test-dependencies", "unstable-serialization", "unstable-spanning-tree"] }
zcash_address = { workspace = true, features = ["test-dependencies"] }
Expand Down
7 changes: 1 addition & 6 deletions zcash_client_sqlite/src/wallet/sapling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,7 @@ pub(crate) mod tests {
};

pub(crate) fn test_prover() -> impl SpendProver + OutputProver {
match LocalTxProver::with_default_location() {
Some(tx_prover) => tx_prover,
None => {
panic!("Cannot locate the Zcash parameters. Please run zcash-fetch-params or fetch-params.sh to download the parameters, and then re-run the tests.");
}
}
LocalTxProver::bundled()
}

#[test]
Expand Down
6 changes: 1 addition & 5 deletions zcash_extensions/src/transparent/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,7 @@ mod tests {
.activation_height(NetworkUpgrade::ZFuture)
.unwrap();

// Only run the test if we have the prover parameters.
let prover = match LocalTxProver::with_default_location() {
Some(prover) => prover,
None => return,
};
let prover = LocalTxProver::bundled();

//
// Opening transaction
Expand Down
12 changes: 0 additions & 12 deletions zcash_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,5 @@ multicore = ["bellman/multicore", "zcash_primitives/multicore"]
[lib]
bench = false

[[example]]
name = "get-params-path"
required-features = ["directories"]

[[example]]
name = "download-params"
required-features = ["download-params"]

[[example]]
name = "download-sprout-and-sapling-params"
required-features = ["download-params"]

[badges]
maintenance = { status = "actively-developed" }
4 changes: 0 additions & 4 deletions zcash_proofs/examples/download-params.rs

This file was deleted.

26 changes: 0 additions & 26 deletions zcash_proofs/examples/download-sprout-and-sapling-params.rs

This file was deleted.

7 changes: 0 additions & 7 deletions zcash_proofs/examples/get-params-path.rs

This file was deleted.

Loading