Skip to content

Commit

Permalink
fix: clippy warnings and PCS API update
Browse files Browse the repository at this point in the history
  • Loading branch information
ed255 committed May 27, 2024
1 parent be40a51 commit 37c916f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions halo2_backend/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub use halo2curves::{CurveAffine, CurveExt};
/// This represents an element of a group with basic operations that can be
/// performed. This allows an FFT implementation (for example) to operate
/// generically over either a field or elliptic curve group.
#[allow(dead_code)]
pub(crate) trait FftGroup<Scalar: Field>:
Copy + Send + Sync + 'static + GroupOpsOwned + ScalarMulOwned<Scalar>
{
Expand Down
2 changes: 1 addition & 1 deletion halo2_backend/src/poly/ipa/multiopen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ where
let mut point_index_set = BTreeSet::new();
for (commitment, point_idx_set) in commitment_set_map.iter() {
if query.get_commitment() == *commitment {
point_index_set = point_idx_set.clone();
point_index_set.clone_from(point_idx_set);
}
}
assert!(!point_index_set.is_empty());
Expand Down
2 changes: 1 addition & 1 deletion halo2_backend/src/poly/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub enum CommitmentReference<'r, C: CurveAffine, M: MSM<C>> {
impl<'r, C: CurveAffine, M: MSM<C>> Copy for CommitmentReference<'r, C, M> {}

impl<'r, C: CurveAffine, M: MSM<C>> PartialEq for CommitmentReference<'r, C, M> {
#![allow(clippy::vtable_address_comparisons)]
#![allow(ambiguous_wide_pointer_comparisons)]
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(&CommitmentReference::Commitment(a), &CommitmentReference::Commitment(b)) => {
Expand Down
2 changes: 1 addition & 1 deletion halo2_frontend/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ fn batch_invert_assigned<F: Field>(assigned: Vec<Vec<Assigned<F>>>) -> Vec<Vec<F
// `Assigned<F>`.
fn poly_invert<F: Field>(
poly: &[Assigned<F>],
inv_denoms: impl Iterator<Item = F> + ExactSizeIterator,
inv_denoms: impl ExactSizeIterator<Item = F>,
) -> Vec<F> {
assert_eq!(inv_denoms.len(), poly.len());
poly.iter()
Expand Down
1 change: 1 addition & 0 deletions halo2_frontend/src/plonk/circuit/constraint_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::fmt::Debug;
/// Represents an index into a vector where each entry corresponds to a distinct
/// point that polynomials are queried at.
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub(crate) struct PointIndex(pub usize);

/// A "virtual cell" is a PLONK cell that has been queried at a particular relative offset
Expand Down
1 change: 1 addition & 0 deletions halo2_proofs/benches/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use criterion::{BenchmarkId, Criterion};
fn criterion_benchmark(c: &mut Criterion) {
/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub struct Variable(Column<Advice>, usize);

#[derive(Clone)]
Expand Down
1 change: 1 addition & 0 deletions halo2_proofs/examples/circuit-layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::marker::PhantomData;

/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub struct Variable(Column<Advice>, usize);

#[derive(Clone)]
Expand Down
3 changes: 3 additions & 0 deletions halo2_proofs/tests/compress_selectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct MyCircuitConfig {

s_add: Selector,
s_mul: Selector,
#[allow(dead_code)]
s_cubed: Selector,

PI: Column<Instance>,
Expand Down Expand Up @@ -82,6 +83,7 @@ trait MyCircuitComposer<F: Field> {
row: usize,
) -> Result<(), Error>;

#[allow(dead_code)]
fn cube<FM>(&self, layouter: &mut impl Layouter<F>, f: FM) -> Result<(Cell, Cell), Error>
where
FM: FnMut() -> Value<(Assigned<F>, Assigned<F>)>;
Expand Down Expand Up @@ -362,6 +364,7 @@ fn test_mycircuit(
let pk = keygen_pk_custom(&params, vk.clone(), &circuit, pk_keygen_compress_selectors)?;

// Proving
#[allow(clippy::useless_vec)]
let instances = vec![vec![Fr::one(), Fr::from_u128(3)]];
let instances_slice: &[&[Fr]] = &(instances
.iter()
Expand Down
1 change: 1 addition & 0 deletions halo2_proofs/tests/plonk_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn plonk_api() {

/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub struct Variable(Column<Advice>, usize);

#[derive(Clone)]
Expand Down
7 changes: 3 additions & 4 deletions p3_frontend/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use halo2_backend::poly::commitment::ParamsProver;
use halo2_backend::poly::kzg::commitment::{KZGCommitmentScheme, ParamsKZG};
use halo2_backend::poly::kzg::multiopen::{ProverSHPLONK, VerifierSHPLONK};
use halo2_backend::poly::kzg::strategy::SingleStrategy;
Expand Down Expand Up @@ -110,10 +109,10 @@ pub(crate) fn setup_prove_verify(
println!("Verifying...");
let mut verifier_transcript =
Blake2bRead::<_, G1Affine, Challenge255<_>>::init(proof.as_slice());
let strategy = SingleStrategy::new(verifier_params);
let strategy = SingleStrategy::new(&verifier_params);

verify_proof_single::<KZGCommitmentScheme<Bn256>, VerifierSHPLONK<'_, Bn256>, _, _, _>(
&params,
verify_proof_single::<KZGCommitmentScheme<Bn256>, VerifierSHPLONK<Bn256>, _, _, _>(
&verifier_params,
&vk,
strategy,
&vec_slices,
Expand Down

0 comments on commit 37c916f

Please sign in to comment.