Skip to content
Open
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
78 changes: 30 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
outputs:
ocaml_version: ${{ steps.ocaml.outputs.version }}
node: ${{ steps.node.outputs.version }}
matrix: ${{ steps.matrix.outputs.value }}
rust_version: ${{ steps.rust.outputs.version }}
os: ${{ steps.os.outputs.version }}
default_rust_version: ${{ steps.defaults.outputs.rust_version }}
default_os: ${{ steps.defaults.outputs.os }}
steps:
Expand All @@ -43,32 +44,21 @@ jobs:
run: echo 'version=["4.14.2"]' >> "$GITHUB_OUTPUT"
- id: node
run: echo 'version=["20"]' >> "$GITHUB_OUTPUT"
- id: rust
run: echo 'version=["1.81", "1.82", "1.84"]' >> "$GITHUB_OUTPUT"
- id: os
run: echo 'version=["ubuntu-latest", "ubuntu-24.04-arm", "macos-latest"]' >> "$GITHUB_OUTPUT"
- id: defaults
run: |
echo 'rust_version=1.81' >> "$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"}
]
}
EOF
echo "value=$(cat matrix.json | jq -c .)" >> "$GITHUB_OUTPUT"

refresh-cache:
needs: ['define-matrix']
strategy:
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
matrix:
rust_toolchain_version: ${{ fromJSON(needs.define-matrix.outputs.rust_version) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
runs-on: ${{ matrix.os }}
steps:
# if 'workflow_run'
Expand All @@ -78,7 +68,7 @@ jobs:
- uses: ./.github/actions/toolchain-shared
if: ${{ github.event_name == 'workflow_run' }}
with:
rust_toolchain_version: ${{ matrix.rust_and_os.rust_toolchain_version }}
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}
- name: start-fresh
if: ${{ github.event_name == 'workflow_run' }}
shell: bash
Expand All @@ -95,14 +85,11 @@ jobs:
needs: ['define-matrix', 'refresh-cache']
strategy:
matrix:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
rust_toolchain_version: ${{ fromJSON(needs.define-matrix.outputs.rust_version) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
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 }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand All @@ -117,7 +104,7 @@ jobs:
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_and_os.rust_toolchain_version }}
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}

- name: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
Expand Down Expand Up @@ -178,8 +165,8 @@ jobs:
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
matrix.rust_and_os.rust_toolchain_version == needs.define-matrix.outputs.default_rust_version &&
matrix.rust_and_os.os == needs.define-matrix.outputs.default_os
matrix.rust_toolchain_version == needs.define-matrix.outputs.default_rust_version &&
matrix.os == needs.define-matrix.outputs.default_os
run: |
eval $(opam env)
RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all-features --no-deps --workspace --exclude xtask
Expand All @@ -190,8 +177,8 @@ jobs:
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
matrix.rust_and_os.rust_toolchain_version == needs.define-matrix.outputs.default_rust_version &&
matrix.rust_and_os.os == needs.define-matrix.outputs.default_os
matrix.rust_toolchain_version == needs.define-matrix.outputs.default_rust_version &&
matrix.os == needs.define-matrix.outputs.default_os
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book/html
Expand All @@ -200,14 +187,11 @@ jobs:
needs: ['define-matrix', 'refresh-cache']
strategy:
matrix:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
rust_toolchain_version: ${{ fromJSON(needs.define-matrix.outputs.rust_version) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
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 }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand All @@ -217,7 +201,7 @@ jobs:
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_and_os.rust_toolchain_version }}
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}

- name: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
Expand All @@ -236,10 +220,11 @@ jobs:
needs: ['define-matrix', 'refresh-cache']
strategy:
matrix:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
rust_toolchain_version: ${{ fromJSON(needs.define-matrix.outputs.rust_version) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
ocaml_version: ${{ fromJSON(needs.define-matrix.outputs.ocaml_version) }}
node: ${{ fromJSON(needs.define-matrix.outputs.node) }}
runs-on: ${{ matrix.rust_and_os.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand All @@ -249,7 +234,7 @@ jobs:
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_and_os.rust_toolchain_version }}
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}

- name: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
Expand All @@ -268,14 +253,11 @@ jobs:
needs: ['define-matrix', 'refresh-cache']
strategy:
matrix:
rust_and_os: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
rust_toolchain_version: ${{ fromJSON(needs.define-matrix.outputs.rust_version) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
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 }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand All @@ -285,7 +267,7 @@ jobs:
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_and_os.rust_toolchain_version }}
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}
components: llvm-tools-preview

- name: Use shared OCaml setting up steps
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- CI: add support for macos-latest with Rust 1.84
([#3131](https://github.com/o1-labs/proof-systems/pull/3131))
- CI: add support for 1.84 for all platforms, fixing linter for Rust 1.84, and
add missing build section for dylib on MacOS
([#3320](https://github.com/o1-labs/proof-systems/pull/3320))

### [arrabbiata](./arrabbiata)

Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ members = [
]
resolver = "2"

# Ignore non-local impl warnings from OCaml derive macros in nested contexts
# See: https://github.com/o1-labs/proof-systems/issues/3319
[workspace.lints.rust]
non_local_definitions = "allow"

[workspace.dependencies]
ark-algebra-test-templates = "0.5"
ark-bn254 = { version = "0.5" }
Expand Down
2 changes: 1 addition & 1 deletion arrabbiata/src/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ impl<F> Index<ChallengeTerm> for Challenges<F> {
}
}

impl<'a> AlphaChallengeTerm<'a> for ChallengeTerm {
impl AlphaChallengeTerm<'_> for ChallengeTerm {
const ALPHA: Self = Self::ConstraintCombiner;
}
3 changes: 3 additions & 0 deletions curves/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ readme = "../README.md"
edition = "2021"
license = "Apache-2.0"

[features]
asm = ["ark-ff/asm"]

[dependencies]
ark-bn254.workspace = true
ark-ec.workspace = true
Expand Down
12 changes: 6 additions & 6 deletions folding/src/eval_leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub enum EvalLeaf<'a, F> {
Result(Vec<F>),
}

impl<'a, F: core::fmt::Display> core::fmt::Display for EvalLeaf<'a, F> {
impl<F: core::fmt::Display> core::fmt::Display for EvalLeaf<'_, F> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let slice = match self {
EvalLeaf::Const(c) => {
Expand All @@ -25,39 +25,39 @@ impl<'a, F: core::fmt::Display> core::fmt::Display for EvalLeaf<'a, F> {
}
}

impl<'a, F: core::ops::Add<Output = F> + Clone> core::ops::Add for EvalLeaf<'a, F> {
impl<F: core::ops::Add<Output = F> + Clone> core::ops::Add for EvalLeaf<'_, F> {
type Output = Self;

fn add(self, rhs: Self) -> Self {
Self::bin_op(|a, b| a + b, self, rhs)
}
}

impl<'a, F: core::ops::Sub<Output = F> + Clone> core::ops::Sub for EvalLeaf<'a, F> {
impl<F: core::ops::Sub<Output = F> + Clone> core::ops::Sub for EvalLeaf<'_, F> {
type Output = Self;

fn sub(self, rhs: Self) -> Self {
Self::bin_op(|a, b| a - b, self, rhs)
}
}

impl<'a, F: core::ops::Mul<Output = F> + Clone> core::ops::Mul for EvalLeaf<'a, F> {
impl<F: core::ops::Mul<Output = F> + Clone> core::ops::Mul for EvalLeaf<'_, F> {
type Output = Self;

fn mul(self, rhs: Self) -> Self {
Self::bin_op(|a, b| a * b, self, rhs)
}
}

impl<'a, F: core::ops::Mul<Output = F> + Clone> core::ops::Mul<F> for EvalLeaf<'a, F> {
impl<F: core::ops::Mul<Output = F> + Clone> core::ops::Mul<F> for EvalLeaf<'_, F> {
type Output = Self;

fn mul(self, rhs: F) -> Self {
self * Self::Const(rhs)
}
}

impl<'a, F: Clone> EvalLeaf<'a, F> {
impl<F: Clone> EvalLeaf<'_, F> {
pub fn map<M: Fn(&F) -> F, I: Fn(&mut F)>(self, map: M, in_place: I) -> Self {
use EvalLeaf::*;
match self {
Expand Down
3 changes: 3 additions & 0 deletions internal-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
edition = "2021"
license = "Apache-2.0"

[lints]
workspace = true

[dependencies]
ocaml = { workspace = true, optional = true }
ocaml-gen = { workspace = true, optional = true }
Expand Down
40 changes: 20 additions & 20 deletions ivc/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ impl ColumnIndexer<usize> for AdditionColumn {
}
}

impl FoldingColumnTrait for AdditionColumn {
fn is_witness(&self) -> bool {
true
}
}

impl<const N_COL: usize, const N_FSEL: usize> Index<AdditionColumn>
for PlonkishWitness<N_COL, N_FSEL, Fp>
{
type Output = [Fp];

fn index(&self, index: AdditionColumn) -> &Self::Output {
match index {
AdditionColumn::A => &self.witness.cols[0].evals,
AdditionColumn::B => &self.witness.cols[1].evals,
AdditionColumn::C => &self.witness.cols[2].evals,
}
}
}

/// Simply compute A + B - C
pub fn interpreter_simple_add<
F: PrimeField,
Expand Down Expand Up @@ -153,12 +173,6 @@ pub fn heavy_test_simple_add() {

// ---- Defining the folding configuration ----
// FoldingConfig
impl FoldingColumnTrait for AdditionColumn {
fn is_witness(&self) -> bool {
true
}
}

type AppWitnessBuilderEnv = WitnessBuilderEnv<
Fp,
AdditionColumn,
Expand All @@ -169,20 +183,6 @@ pub fn heavy_test_simple_add() {
DummyLookupTable,
>;

impl<const N_COL: usize, const N_FSEL: usize> Index<AdditionColumn>
for PlonkishWitness<N_COL, N_FSEL, Fp>
{
type Output = [Fp];

fn index(&self, index: AdditionColumn) -> &Self::Output {
match index {
AdditionColumn::A => &self.witness.cols[0].evals,
AdditionColumn::B => &self.witness.cols[1].evals,
AdditionColumn::C => &self.witness.cols[2].evals,
}
}
}

type Config<
const N_COL_TOTAL: usize,
const N_CHALS: usize,
Expand Down
6 changes: 6 additions & 0 deletions kimchi-stubs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ repository = "https://github.com/MinaProtocol/mina"
license = "MIT/Apache-2.0"
edition = "2021"

[lints]
workspace = true

[lib]
name = "kimchi_stubs"
# Important: do not ask to build a dynamic library.
# On MacOS arm64, ocaml-rs.v0.2.2 causes build issues.
# On the Mina side, a fake and empty dllkimchi_stubs.so file is used.
crate-type = ["lib", "staticlib"]

[features]
no-std = []

[dependencies]
libc.workspace = true
num-bigint = { workspace = true, features = ["rand", "serde"] }
Expand Down
2 changes: 1 addition & 1 deletion kimchi-stubs/src/arkworks/bigint_256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl From<BigInteger256> for CamlBigInteger256 {
}
}

unsafe impl<'a> ocaml::FromValue<'a> for CamlBigInteger256 {
unsafe impl ocaml::FromValue<'_> for CamlBigInteger256 {
fn from_value(value: ocaml::Value) -> Self {
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
*x.as_ref()
Expand Down
4 changes: 2 additions & 2 deletions kimchi-stubs/src/arkworks/group_projective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use mina_curves::pasta::curves::{pallas::ProjectivePallas, vesta::ProjectiveVest
#[derive(Clone, Copy, ocaml_gen::CustomType)]
pub struct CamlGroupProjectivePallas(pub ProjectivePallas);

unsafe impl<'a> ocaml::FromValue<'a> for CamlGroupProjectivePallas {
unsafe impl ocaml::FromValue<'_> for CamlGroupProjectivePallas {
fn from_value(value: ocaml::Value) -> Self {
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
*x.as_ref()
Expand Down Expand Up @@ -111,7 +111,7 @@ impl Neg for &CamlGroupProjectivePallas {
#[derive(Clone, Copy, ocaml_gen::CustomType)]
pub struct CamlGroupProjectiveVesta(pub ProjectiveVesta);

unsafe impl<'a> ocaml::FromValue<'a> for CamlGroupProjectiveVesta {
unsafe impl ocaml::FromValue<'_> for CamlGroupProjectiveVesta {
fn from_value(value: ocaml::Value) -> Self {
let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value);
*x.as_ref()
Expand Down
Loading
Loading