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

CI: add Rust 1.76 #2933

Merged
merged 2 commits into from
Jan 8, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
RUST_TOOLCHAIN_COVERAGE_VERSION: "1.74"
strategy:
matrix:
rust_toolchain_version: ["1.71", "1.72", "1.73", "1.74", "1.75"]
rust_toolchain_version: ["1.71", "1.72", "1.73", "1.74", "1.75", "1.76"]
# FIXME: currently not available for 5.0.0.
# It might be related to boxroot dependency, and we would need to bump
# up the ocaml-rs dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn compute_ffadd_values<F: PrimeField>(
/// opcode: true for addition, false for subtraction
/// modulus: modulus of the foreign field
pub fn create_chain<F: PrimeField>(
inputs: &Vec<BigUint>,
inputs: &[BigUint],
opcodes: &[FFOps],
modulus: BigUint,
) -> [Vec<F>; COLUMNS] {
Expand Down
12 changes: 6 additions & 6 deletions kimchi/src/tests/foreign_field_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ fn full_circuit<F: PrimeField>(

// Creates the witness with the public input for FFAdd containing the 1 value
fn short_witness<F: PrimeField>(
inputs: &Vec<BigUint>,
inputs: &[BigUint],
opcodes: &[FFOps],
modulus: BigUint,
) -> [Vec<F>; COLUMNS] {
Expand All @@ -277,7 +277,7 @@ fn short_witness<F: PrimeField>(
// opcode: true for addition, false for subtraction
// modulus: modulus of the foreign field
fn long_witness<F: PrimeField>(
inputs: &Vec<BigUint>,
inputs: &[BigUint],
opcodes: &[FFOps],
modulus: BigUint,
) -> [Vec<F>; COLUMNS] {
Expand Down Expand Up @@ -1406,7 +1406,7 @@ where

// Compute addition witness
let witness = short_witness(
&vec![left_input, right_input],
&[left_input, right_input],
&[FFOps::Add],
foreign_field_modulus.clone(),
);
Expand Down Expand Up @@ -1481,7 +1481,7 @@ fn test_ffadd_finalization() {
let left = modulus.clone() - BigUint::one();
let right = modulus.clone() - BigUint::one();
// create a chain of 1 addition
let add_witness = witness::create_chain::<Fp>(&vec![left, right], operation, modulus);
let add_witness = witness::create_chain::<Fp>(&[left, right], operation, modulus);
for col in 0..COLUMNS {
witness[col].extend(add_witness[col].iter());
}
Expand Down Expand Up @@ -1553,7 +1553,7 @@ fn test_gate_invalid_foreign_field_modulus() {
#[test]
fn test_witness_max_foreign_field_modulus() {
short_witness::<PallasField>(
&vec![BigUint::zero(), BigUint::zero()],
&[BigUint::zero(), BigUint::zero()],
&[FFOps::Add],
BigUint::max_foreign_field_modulus::<PallasField>(),
);
Expand All @@ -1563,7 +1563,7 @@ fn test_witness_max_foreign_field_modulus() {
#[should_panic]
fn test_witness_invalid_foreign_field_modulus() {
short_witness::<PallasField>(
&vec![BigUint::zero(), BigUint::zero()],
&[BigUint::zero(), BigUint::zero()],
&[FFOps::Add],
BigUint::max_foreign_field_modulus::<PallasField>() + BigUint::one(),
);
Expand Down
4 changes: 2 additions & 2 deletions msm/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn prove<
>(
domain: EvaluationDomains<G::ScalarField>,
srs: &OpeningProof::SRS,
constraints: &Vec<E<G::ScalarField>>,
constraints: &[E<G::ScalarField>],
fixed_selectors: Box<[Vec<G::ScalarField>; N_FSEL]>,
inputs: ProofInputs<N_WIT, G::ScalarField, ID>,
rng: &mut RNG,
Expand Down Expand Up @@ -288,7 +288,7 @@ where

// Compute ∑ α^i constraint_i as an expression
let combined_expr =
Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone());
Expr::combine_constraints(0..(constraints.len() as u32), constraints.to_vec());

// We want to compute the quotient polynomial, i.e.
// t(X) = (∑ α^i constraint_i(X)) / Z_H(X).
Expand Down
4 changes: 2 additions & 2 deletions msm/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn verify<
>(
domain: EvaluationDomains<G::ScalarField>,
srs: &OpeningProof::SRS,
constraints: &Vec<E<G::ScalarField>>,
constraints: &[E<G::ScalarField>],
fixed_selectors: Box<[Vec<G::ScalarField>; N_FSEL]>,
proof: &Proof<N_WIT, N_REL, N_DSEL, N_FSEL, G, OpeningProof, ID>,
public_inputs: Witness<NPUB, Vec<G::ScalarField>>,
Expand Down Expand Up @@ -286,7 +286,7 @@ where
};

let combined_expr =
Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone());
Expr::combine_constraints(0..(constraints.len() as u32), constraints.to_vec());
// Note the minus! ft polynomial at zeta (ft_eval0) is minus evaluation of the expression.
let ft_eval0 = -PolishToken::evaluate(
combined_expr.to_polish().as_slice(),
Expand Down
1 change: 0 additions & 1 deletion mvpoly/src/pbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
//! use mvpoly::prime::Dense;
//! use mina_curves::pasta::Fp;
//!
//! #[test]
//! fn test_mul_by_one() {
//! mvpoly::pbt::test_mul_by_one::<Fp, 2, 2, Dense<Fp, 2, 2>>();
//! mvpoly::pbt::test_mul_by_one::<Fp, 4, 2, Dense<Fp, 4, 2>>();
Expand Down
10 changes: 5 additions & 5 deletions poly-commitment/src/kzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use std::ops::Neg;
/// P2_1(ζ) + P2_2(ζ) * polyscale + P2_1(ζω) polyscale^2 + P2_2(ζω) * polyscale^3
/// ```
pub fn combine_evaluations<G: CommitmentCurve>(
evaluations: &Vec<Evaluation<G>>,
evaluations: &[Evaluation<G>],
polyscale: G::ScalarField,
) -> Vec<G::ScalarField> {
let mut polyscale_i = G::ScalarField::one();
Expand Down Expand Up @@ -431,10 +431,10 @@ impl<
/// Also, chunking is not supported.
pub fn verify(
&self,
srs: &PairingSRS<Pair>, // SRS
evaluations: &Vec<Evaluation<G>>, // commitments to the polynomials
polyscale: F, // scaling factor for polynoms
elm: &[F], // vector of evaluation points
srs: &PairingSRS<Pair>, // SRS
evaluations: &[Evaluation<G>], // commitments to the polynomials
polyscale: F, // scaling factor for polynoms
elm: &[F], // vector of evaluation points
) -> bool {
let poly_commitment: G::Group = {
let mut scalars: Vec<F> = Vec::new();
Expand Down
8 changes: 4 additions & 4 deletions poly-commitment/tests/kzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p1], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p1], polyscale);
// We have 2 evaluation points.
assert_eq!(output.len(), 2);
// polyscale is not used.
Expand All @@ -60,7 +60,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p2], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p2], polyscale);
// We have 2 evaluation points
assert_eq!(output.len(), 2);
// polyscale is not used.
Expand Down Expand Up @@ -92,7 +92,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p1, eval_p2], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p1, eval_p2], polyscale);
// We have 2 evaluation points
assert_eq!(output.len(), 2);
let exp_output = [Fp::from(1 + 3 * 2), Fp::from(2 + 4 * 2)];
Expand Down Expand Up @@ -123,7 +123,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p1, eval_p2], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p1, eval_p2], polyscale);
// We have 2 evaluation points
assert_eq!(output.len(), 2);
let o1 = Fp::from(1 + 3 * 2 + 5 * 4 + 7 * 8);
Expand Down
Loading