From b13a607b518bfc5bd9f40bedef2f2c83ed234e8e Mon Sep 17 00:00:00 2001 From: ancient123 Date: Mon, 17 Jul 2023 09:25:39 -0600 Subject: [PATCH] Update build - Use default github rust version - Stop using clippy action, it has been unmaintained since 2020 - No longer enforce nightly fmt rules in CI (they can still be enforced in commit hooks or nix - No longer use cargo test unstable options - Run `cargo clippy --fix` to fix new errors --- .github/workflows/build.yml | 34 ++++------------------- hyperplonk/src/snark.rs | 5 ++-- scripts/run_tests.sh | 2 +- subroutines/src/pcs/univariate_kzg/mod.rs | 10 +++---- 4 files changed, 13 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d7ef89..4a3a048 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,39 +24,17 @@ jobs: - name: Checkout Repository uses: actions/checkout@v3 - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: default - toolchain: stable - override: true - default: true - components: rustfmt, clippy - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: false - default: false - components: rustfmt - - uses: Swatinem/rust-cache@v2 name: Enable Rust Caching - name: Format Check - run: cargo +nightly fmt -- --check + run: cargo fmt -- --check - - name: Clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ github.token }} + - name: Clippy Check + run: cargo clippy --workspace -- -D warnings - - name: Audit - uses: actions-rs/audit-check@v1 - with: - token: ${{ github.token }} + - name: Audit Check + run: cargo audit - name: Check Bench run: cargo bench --no-run @@ -65,7 +43,7 @@ jobs: run: cargo test --no-run -- --ignored - name: Test - run: bash ./scripts/run_tests.sh + run: bash ./scripts/run_tests.sh - name: Generate Documentation run: | diff --git a/hyperplonk/src/snark.rs b/hyperplonk/src/snark.rs index 18d0689..7db5f9c 100644 --- a/hyperplonk/src/snark.rs +++ b/hyperplonk/src/snark.rs @@ -453,7 +453,7 @@ where &mut transcript, )?; - let zero_check_point = zero_check_sub_claim.point.clone(); + let zero_check_point = zero_check_sub_claim.point; // check zero check subclaim let f_eval = eval_f(&vk.params.gate_func, selector_evals, witness_gate_evals)?; @@ -485,8 +485,7 @@ where let perm_check_point = perm_check_sub_claim .product_check_sub_claim .zero_check_sub_claim - .point - .clone(); + .point; let alpha = perm_check_sub_claim.product_check_sub_claim.alpha; let (beta, gamma) = perm_check_sub_claim.challenges; diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 8a8b60f..5e47ef3 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -6,6 +6,6 @@ set -e # We want the code to panic if there is an integer overflow export RUSTFLAGS="-C overflow-checks=on" -cargo test --release --all -- -Zunstable-options --report-time +cargo test --release --all cargo test --no-run --features=print-trace cargo bench --no-run diff --git a/subroutines/src/pcs/univariate_kzg/mod.rs b/subroutines/src/pcs/univariate_kzg/mod.rs index dcf8c8f..252c0d0 100644 --- a/subroutines/src/pcs/univariate_kzg/mod.rs +++ b/subroutines/src/pcs/univariate_kzg/mod.rs @@ -106,11 +106,9 @@ impl PolynomialCommitmentScheme for UnivariateKzgPCS { let (num_leading_zeros, plain_coeffs) = skip_leading_zeros(poly); let msm_time = start_timer!(|| "MSM to compute commitment to plaintext poly"); - let commitment = E::G1::msm_unchecked( - &prover_param.powers_of_g[num_leading_zeros..], - &plain_coeffs, - ) - .into_affine(); + let commitment = + E::G1::msm_unchecked(&prover_param.powers_of_g[num_leading_zeros..], plain_coeffs) + .into_affine(); end_timer!(msm_time); end_timer!(commit_time); @@ -136,7 +134,7 @@ impl PolynomialCommitmentScheme for UnivariateKzgPCS { let proof = E::G1::msm_unchecked( &prover_param.borrow().powers_of_g[num_leading_zeros..], - &witness_coeffs, + witness_coeffs, ) .into_affine();