Skip to content
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
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
BUILD_TARGET:
- release
- dev

steps:
- uses: actions/checkout@v4
- name: Cache cargo crates
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.BUILD_TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests for `core`
run: cargo test --profile ${{ matrix.BUILD_TARGET }} --all-features -p haloumi-core

doc-links:
if: github.event.pull_request.draft == false
name: Intra-doc links
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: 'Install rust-toolchain.toml'
run: rustup toolchain install
- name: cargo fetch
run: cargo fetch

# Ensure intra-documentation links all resolve correctly
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
- name: Check intra-doc links
run: cargo doc --workspace --document-private-items --no-deps

fmt:
if: github.event.pull_request.draft == false
name: Rustfmt
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: rustup component add rustfmt --toolchain nightly
- run: cargo +nightly fmt --all -- --check

clippy:
if: github.event.pull_request.draft == false
name: Clippy
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: 'Install rust-toolchain.toml'
run: rustup toolchain install

- name: Run Clippy on `core`
if: always()
run: cargo clippy -p haloumi-core --all-targets --all-features -- -Dwarnings

20 changes: 10 additions & 10 deletions core/src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,33 @@ where
/// Output of the evaluation.
type Output;

/// Evaluate the [`Expression::Constant`] case.
/// Evaluate the Expression::Constant case.
fn constant(&self, f: &F) -> Self::Output;

/// Evaluate the [`Expression::Selector`] case.
/// Evaluate the Expression::Selector case.
fn selector(&self, selector: &E::Selector) -> Self::Output;

/// Evaluate the [`Expression::Fixed`] case.
/// Evaluate the Expression::Fixed case.
fn fixed(&self, fixed_query: &E::FixedQuery) -> Self::Output;

/// Evaluate the [`Expression::Advice`] case.
/// Evaluate the Expression::Advice case.
fn advice(&self, advice_query: &E::AdviceQuery) -> Self::Output;

/// Evaluate the [`Expression::Instance`] case.
/// Evaluate the Expression::Instance case.
fn instance(&self, instance_query: &E::InstanceQuery) -> Self::Output;

/// Evaluate the [`Expression::Challenge`] case.
/// Evaluate the Expression::Challenge case.
fn challenge(&self, challenge: &E::Challenge) -> Self::Output;

/// Evaluate the [`Expression::Negated`] case.
/// Evaluate the Expression::Negated case.
fn negated(&self, expr: Self::Output) -> Self::Output;

/// Evaluate the [`Expression::Sum`] case.
/// Evaluate the Expression::Sum case.
fn sum(&self, lhs: Self::Output, rhs: Self::Output) -> Self::Output;

/// Evaluate the [`Expression::Product`] case.
/// Evaluate the Expression::Product case.
fn product(&self, lhs: Self::Output, rhs: Self::Output) -> Self::Output;

/// Evaluate the [`Expression::Scaled`] case.
/// Evaluate the Expression::Scaled case.
fn scaled(&self, lhs: Self::Output, rhs: &F) -> Self::Output;
}
2 changes: 1 addition & 1 deletion core/src/info_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub trait ConstraintSystemInfo<F: Field> {
fn gates(&self) -> Vec<&dyn GateInfo<Self::Polynomial>>;

/// Returns a list with data about the lookups defined in the system.
fn lookups<'cs>(&'cs self) -> Vec<LookupData<'cs, Self::Polynomial>>;
fn lookups(&self) -> Vec<LookupData<Self::Polynomial>>;
}

/// Trait for querying information about the a gate in the constraint system.
Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.85.0"
components = ["rustfmt", "clippy"]