Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c813260
chore: update Rust toolchain to 1.91
dannywillems Dec 2, 2025
19839ec
fix(curves): allow asm cfg from ark-ff derive macros
dannywillems Dec 2, 2025
a1cc400
fix(utils): use idiomatic Rust 1.91 methods
dannywillems Dec 2, 2025
80d6cbf
fix(turshi): use idiomatic Rust 1.91 methods
dannywillems Dec 2, 2025
f8985be
fix(poseidon): allow non_local_definitions from ocaml derive macros
dannywillems Dec 2, 2025
4164339
fix(internal-tracing): allow non_local_definitions from ocaml derive …
dannywillems Dec 2, 2025
4f86b36
fix(hasher): use div_ceil() instead of manual implementation
dannywillems Dec 2, 2025
e5a76b6
fix(poly-commitment): use idiomatic Rust 1.91 methods and allow ocaml…
dannywillems Dec 2, 2025
306bfd0
fix(signer): use div_ceil() instead of manual implementation
dannywillems Dec 2, 2025
814f775
fix(kimchi): apply Rust 1.91 clippy fixes
dannywillems Dec 2, 2025
379cfb8
fix(msm): apply Rust 1.91 clippy fixes
dannywillems Dec 2, 2025
7239a08
fix(mvpoly): apply Rust 1.91 clippy fixes
dannywillems Dec 2, 2025
dc74eb2
fix(kimchi-stubs): allow ocaml derive macro warnings
dannywillems Dec 2, 2025
1b5d601
fix(plonk-wasm): apply Rust 1.91 clippy fixes
dannywillems Dec 2, 2025
1d5bf8c
fix(arrabbiata): apply Rust 1.91 clippy fixes
dannywillems Dec 2, 2025
f09ef58
fix(o1vm): apply Rust 1.91 clippy fixes
dannywillems Dec 2, 2025
66159a7
fix(curves): apply toml formatting
dannywillems Dec 2, 2025
44866b0
fix: revert is_multiple_of usage for WASM nightly compatibility
dannywillems Dec 2, 2025
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/benches-mina-prover-set-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
OCAML_VERSION: "4.14.2"
RUST_TOOLCHAIN_VERSION: "1.81"
RUST_TOOLCHAIN_VERSION: "1.91"


jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benches-mina-prover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

env:
OCAML_VERSION: "4.14.2"
RUST_TOOLCHAIN_VERSION: "1.81"
RUST_TOOLCHAIN_VERSION: "1.91"

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
OCAML_VERSION: "4.14.2"
RUST_TOOLCHAIN_VERSION: "1.81"
RUST_TOOLCHAIN_VERSION: "1.91"

jobs:
bench:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust_toolchain_version: ["1.81"]
rust_toolchain_version: ["1.91"]
# 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
25 changes: 4 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,16 @@ jobs:
run: echo 'version=["20"]' >> "$GITHUB_OUTPUT"
- id: defaults
run: |
echo 'rust_version=1.81' >> "$GITHUB_OUTPUT"
echo 'rust_version=1.91' >> "$GITHUB_OUTPUT"
echo 'os=ubuntu-latest' >> "$GITHUB_OUTPUT"
- id: matrix
run: |
# NOTE: This custom matrix configuration is needed to use Rust 1.84 specifically for macOS.
# When https://github.com/o1-labs/proof-systems/issues/3254 is fixed,
# this can be simplified to use a standard matrix configuration.
cat > matrix.json << 'EOF'
{
"include": [
{"rust_toolchain_version": "1.81", "os": "ubuntu-latest"},
{"rust_toolchain_version": "1.82", "os": "ubuntu-latest"},
{"rust_toolchain_version": "1.81", "os": "ubuntu-24.04-arm"},
{"rust_toolchain_version": "1.82", "os": "ubuntu-24.04-arm"},
{"rust_toolchain_version": "1.84", "os": "macos-latest"}
{"rust_toolchain_version": "1.91", "os": "ubuntu-latest"},
{"rust_toolchain_version": "1.91", "os": "ubuntu-24.04-arm"},
{"rust_toolchain_version": "1.91", "os": "macos-latest"}
]
}
EOF
Expand Down Expand Up @@ -98,10 +93,6 @@ jobs:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
ocaml_version: ${{ fromJSON(needs.define-matrix.outputs.ocaml_version) }}
node: ${{ fromJSON(needs.define-matrix.outputs.node) }}
exclude:
# Skip Rust 1.84 due to linting issues - remove when
# https://github.com/o1-labs/proof-systems/pull/3245 is fixed
- rust_and_os: {rust_toolchain_version: '1.84', os: 'macos-latest'}
runs-on: ${{ matrix.rust_and_os.os }}
steps:
- name: Checkout repository
Expand Down Expand Up @@ -203,10 +194,6 @@ jobs:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
ocaml_version: ${{ fromJSON(needs.define-matrix.outputs.ocaml_version) }}
node: ${{ fromJSON(needs.define-matrix.outputs.node) }}
exclude:
# Skip Rust 1.84 due to linting issues - remove when
# https://github.com/o1-labs/proof-systems/pull/3245 is fixed
- rust_and_os: {rust_toolchain_version: '1.84', os: 'macos-latest'}
runs-on: ${{ matrix.rust_and_os.os }}
steps:
- name: Checkout repository
Expand Down Expand Up @@ -276,10 +263,6 @@ jobs:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
ocaml_version: ${{ fromJSON(needs.define-matrix.outputs.ocaml_version) }}
node: ${{ fromJSON(needs.define-matrix.outputs.node) }}
exclude:
# Skip Rust 1.84 due to linting issues - remove when
# https://github.com/o1-labs/proof-systems/pull/3245 is fixed
- rust_and_os: {rust_toolchain_version: '1.84', os: 'macos-latest'}
runs-on: ${{ matrix.rust_and_os.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/o1vm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ["ubuntu-latest"]
strategy:
matrix:
rust_toolchain_version: ["1.81"]
rust_toolchain_version: ["1.91"]
# 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
2 changes: 1 addition & 1 deletion .github/workflows/test-export-vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: "1.81"
rust_toolchain_version: "1.91"

- name: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
Expand Down
1 change: 1 addition & 0 deletions arrabbiata/src/interpreter.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::doc_overindented_list_items)]
//! This module contains the implementation of the IVC scheme in addition to
//! running an arbitrary function that can use up to [crate::NUMBER_OF_COLUMNS]
//! columns.
Expand Down
3 changes: 3 additions & 0 deletions arrabbiata/src/witness.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// We can't use is_multiple_of as it's not available in the older nightly used for WASM builds
#![allow(clippy::manual_is_multiple_of)]

use ark_ec::CurveConfig;
use ark_ff::PrimeField;
use ark_poly::Evaluations;
Expand Down
5 changes: 5 additions & 0 deletions curves/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ readme = "../README.md"
edition = "2021"
license = "Apache-2.0"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
"cfg(feature, values(\"asm\"))",
] }

[dependencies]
ark-bn254.workspace = true
ark-ec.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion hasher/src/roinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl ROInput {
// Check that the number of bytes is consistent with the expected lengths
let expected_len_bits = fields_len * Fp::MODULUS_BIT_SIZE as usize + bits_len;
// Round up to nearest multiple of 8
let expected_len = (expected_len_bits + 7) / 8 + SER_HEADER_SIZE;
let expected_len = expected_len_bits.div_ceil(8) + SER_HEADER_SIZE;
if input.len() != expected_len {
return Err(Error);
}
Expand Down
2 changes: 2 additions & 0 deletions internal-tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ macro_rules! decl_traces {
}

#[cfg(feature = "ocaml_types")]
#[allow(non_local_definitions)]
#[allow(dead_code)]
pub mod caml {
use super::*;

Expand Down
3 changes: 3 additions & 0 deletions kimchi-stubs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//! a math library that Proof-systems builds on top of.
//!

#![allow(non_local_definitions)]
#![allow(unexpected_cfgs)]

extern crate libc;

/// Caml helpers
Expand Down
4 changes: 1 addition & 3 deletions kimchi/benches/amortization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ pub fn amortization(c: &mut Criterion) {

let ctx = BenchmarkCtx::new(16);
let proof_and_public = ctx.create_proof();
let proofs: Vec<_> = core::iter::repeat(proof_and_public)
.take(1 << PROOFS)
.collect();
let proofs: Vec<_> = std::iter::repeat_n(proof_and_public, 1 << PROOFS).collect();

group.sample_size(10);
for size in 0..=PROOFS {
Expand Down
2 changes: 1 addition & 1 deletion kimchi/benches/proof_criterion_mina.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn bench_proof_creation_mina(c: &mut Criterion) {
// Parse filename "kimchi_inputs_CURVENAME_SEED.ser" into two parameters
let (curve_name, seed): (&str, &str) = filename
.split('/')
.last()
.next_back()
.unwrap()
.strip_prefix("kimchi_inputs_")
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion kimchi/benches/proof_iai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn bench_proof_creation() {
fn bench_proof_creation_and_verification() {
let ctx = BenchmarkCtx::new(14);
let proof_and_public = ctx.create_proof();
ctx.batch_verification(&vec![proof_and_public]);
ctx.batch_verification(&[proof_and_public]);
}

iai::main!(bench_proof_creation, bench_proof_creation_and_verification);
2 changes: 1 addition & 1 deletion kimchi/src/alphas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<F: Field> Alphas<F> {
&self,
ty: ArgumentType,
num: u32,
) -> MustConsumeIterator<Cloned<Take<Skip<Iter<F>>>>, F> {
) -> MustConsumeIterator<Cloned<Take<Skip<Iter<'_, F>>>>, F> {
let ty = if matches!(ty, ArgumentType::Gate(_)) {
ArgumentType::Gate(GateType::Zero)
} else {
Expand Down
2 changes: 1 addition & 1 deletion kimchi/src/bin/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn main() {
let ctx = BenchmarkCtx::new(4);
let proof_and_public = ctx.create_proof();
loop {
ctx.batch_verification(black_box(&vec![proof_and_public.clone()]));
ctx.batch_verification(black_box(std::slice::from_ref(&proof_and_public)));
}
}
_ => panic!("you must provide an argument (prove or verify)"),
Expand Down
13 changes: 6 additions & 7 deletions kimchi/src/circuits/lookup/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use ark_poly::{
univariate::DensePolynomial as DP, EvaluationDomain, Evaluations as E,
Radix2EvaluationDomain as D,
};
use core::iter;
use itertools::repeat_n;
use o1_utils::field_helpers::i32_to_field;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
Expand Down Expand Up @@ -287,12 +286,12 @@ impl<F: PrimeField> LookupConstraintSystem<F> {

// it's 1 everywhere, except at the entries where
// the runtime table applies
evals.extend(iter::repeat(F::one()).take(runtime_table_offset));
evals.extend(iter::repeat(F::zero()).take(runtime_len));
evals.extend(
iter::repeat(F::one())
.take(d1_size - runtime_table_offset - runtime_len),
);
evals.extend(std::iter::repeat_n(F::one(), runtime_table_offset));
evals.extend(std::iter::repeat_n(F::zero(), runtime_len));
evals.extend(std::iter::repeat_n(
F::one(),
d1_size - runtime_table_offset - runtime_len,
));

// although the last zk_rows are fine
for e in evals.iter_mut().rev().take(zk_rows) {
Expand Down
4 changes: 2 additions & 2 deletions kimchi/src/circuits/polynomials/foreign_field_add/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub fn create_chain<F: PrimeField>(
for i in 0..num {
// Create foreign field addition row
for w in &mut witness {
w.extend(core::iter::repeat(F::zero()).take(1));
w.extend(std::iter::repeat_n(F::zero(), 1));
}
let right = ForeignElement::from_biguint(inputs[i + 1].clone());
let (output, _sign, ovf, carry) =
Expand Down Expand Up @@ -298,7 +298,7 @@ pub fn extend_witness_bound_addition<F: PrimeField>(
// Extend the witness for the add gate
let offset = witness[0].len();
for col in witness.iter_mut().take(COLUMNS) {
col.extend(core::iter::repeat(F::zero()).take(2))
col.extend(std::iter::repeat_n(F::zero(), 2))
}

init_bound_rows(
Expand Down
4 changes: 2 additions & 2 deletions kimchi/src/circuits/polynomials/foreign_field_mul/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub fn create<F: PrimeField>(

// Extend the witness by two rows for foreign field multiplication
for w in &mut witness {
w.extend(core::iter::repeat(F::zero()).take(2));
w.extend(std::iter::repeat_n(F::zero(), 2));
}

// Create the foreign field multiplication witness rows
Expand Down Expand Up @@ -329,7 +329,7 @@ impl<F: PrimeField> ExternalChecks<F> {
for chunk in self.high_bounds.clone().chunks(2) {
// Extend the witness for the generic gate
for col in witness.iter_mut().take(COLUMNS) {
col.extend(core::iter::repeat(F::zero()).take(1))
col.extend(std::iter::repeat_n(F::zero(), 1))
}
let last_row = witness[0].len() - 1;
// Fill in with dummy if it is an odd number of bounds
Expand Down
2 changes: 1 addition & 1 deletion kimchi/src/circuits/polynomials/keccak/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Constants for each witness' index offsets and lengths
// Constants for each witness' index offsets and lengths

// KECCAK PARAMETERS
/// The dimension of the Keccak state
Expand Down
1 change: 1 addition & 0 deletions kimchi/src/circuits/polynomials/keccak/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ impl PiRho {
let aux = grid!(100, rotation_e.expand_rot);
for y in 0..DIM {
for x in 0..DIM {
#[allow(clippy::needless_range_loop)]
for q in 0..QUARTERS {
state_b[(2 * x + 3 * y) % DIM][y][q] = aux(y, x, q);
}
Expand Down
1 change: 1 addition & 0 deletions kimchi/src/circuits/polynomials/turshi.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::doc_overindented_list_items)]
//! This implements the constraints of the Cairo gates
//!
//! Cairo programs can have the following assembly-like instructions:
Expand Down
1 change: 1 addition & 0 deletions kimchi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![doc = include_str!("../README.md")]
#![allow(non_local_definitions)]

pub use groupmap;
pub use mina_curves;
Expand Down
2 changes: 1 addition & 1 deletion kimchi/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ where
}

// padding
w.extend(core::iter::repeat(G::ScalarField::zero()).take(length_padding));
w.extend(std::iter::repeat_n(G::ScalarField::zero(), length_padding));

// zk-rows
for row in w.iter_mut().rev().take(index.cs.zk_rows as usize) {
Expand Down
2 changes: 1 addition & 1 deletion kimchi/src/snarky/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ where
}

// pad with zeros for the public output part
public_input.extend(core::iter::repeat(F::zero()).take(self.public_output.len()));
public_input.extend(std::iter::repeat_n(F::zero(), self.public_output.len()));

// re-initialize `next_var` (which will grow every time we compile or generate a witness)
self.next_var = self.num_public_inputs;
Expand Down
2 changes: 1 addition & 1 deletion kimchi/src/tests/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mod tests {
rmp_serde::from_slice(&ser_pf).unwrap();

// verify the deserialized proof (must accept the proof)
ctx.batch_verification(&vec![(de_pf, public_input)]);
ctx.batch_verification(&[(de_pf, public_input)]);
}

#[test]
Expand Down
7 changes: 3 additions & 4 deletions msm/src/circuit_design/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
};
use ark_ff::PrimeField;
use log::debug;
use std::{collections::BTreeMap, iter, marker::PhantomData};
use std::{collections::BTreeMap, marker::PhantomData};

/// Witness builder environment. Operates on multiple rows at the same
/// time. `CIx::N_COL` must be equal to `N_WIT + N_FSEL`; passing these two
Expand Down Expand Up @@ -345,9 +345,8 @@ impl<
);
if table_id.length() < domain_size {
let n_repeated_dummy_value: usize = domain_size - table_id.length() - 1;
let repeated_dummy_value: Vec<F> = iter::repeat(-F::one())
.take(n_repeated_dummy_value)
.collect();
let repeated_dummy_value: Vec<F> =
std::iter::repeat_n(-F::one(), n_repeated_dummy_value).collect();
m.extend(repeated_dummy_value);
m.push(F::from(n_repeated_dummy_value as u64));
}
Expand Down
2 changes: 2 additions & 0 deletions msm/src/fec/interpreter.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::doc_overindented_list_items)]

use crate::{
circuit_design::{
capabilities::{read_column_array, write_column_array_const, write_column_const},
Expand Down
7 changes: 3 additions & 4 deletions msm/src/lookups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::logup::{Logup, LogupWitness, LookupTableID};
use ark_ff::{FftField, PrimeField};
use kimchi::circuits::domains::EvaluationDomains;
use rand::{seq::SliceRandom, thread_rng, Rng};
use std::{cmp::Ord, iter};
use std::cmp::Ord;

/// Dummy lookup table. For the cases when you don't need one -- a single dummy element 0.
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
Expand Down Expand Up @@ -144,9 +144,8 @@ impl<F: FftField> LookupWitness<F> {
};
let dummy_value = F::rand(&mut rng);
let repeated_dummy_value: Vec<F> = {
let r: Vec<F> = iter::repeat(dummy_value)
.take((domain.d1.size - table_size) as usize)
.collect();
let r: Vec<F> =
std::iter::repeat_n(dummy_value, (domain.d1.size - table_size) as usize).collect();
r
};
let t_evals = {
Expand Down
3 changes: 3 additions & 0 deletions msm/src/serialization/interpreter.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// We can't use is_multiple_of as it's not available in the older nightly used for WASM builds
#![allow(clippy::manual_is_multiple_of)]

use ark_ff::{PrimeField, Zero};
use num_bigint::{BigInt, BigUint, ToBigInt};
use num_integer::Integer;
Expand Down
2 changes: 1 addition & 1 deletion msm/src/test/proof_system.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Tests for the proof system itself, targeting prover and verifier.
//! Tests for the proof system itself, targeting prover and verifier.

#[cfg(test)]
mod tests {
Expand Down
4 changes: 2 additions & 2 deletions mvpoly/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//! Different representations are provided in the sub-modules:
//! - `monomials`: a representation based on monomials
//! - `prime`: a representation based on a mapping from variables to prime
//! numbers. This representation is unmaintained for now. We leave it
//! for interested users.
//! numbers. This representation is unmaintained for now. We leave it
//! for interested users.
//!
//! "Expressions", as defined in the [kimchi] crate, can be converted into a
//! multi-variate polynomial using the `from_expr` method.
Expand Down
Loading
Loading