Skip to content

refactor: drop filter logic in planner for aggregation #7175

refactor: drop filter logic in planner for aggregation

refactor: drop filter logic in planner for aggregation #7175

Workflow file for this run

name: CI-Lint-And-Test
on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
BLITZAR_BACKEND: cpu
jobs:
# Run cargo check (with various feature permutations)
check:
name: Check Package
runs-on: large-8-core-32gb-22-04
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- name: Run cargo check (no features, exclude examples)
run: cargo check --no-default-features
- name: Run cargo check (default features)
run: cargo check --all-targets
- name: Run cargo check (all features)
run: cargo check --all-targets --all-features
- name: Run cargo check (proof-of-sql) (no features)
run: cargo check -p proof-of-sql --no-default-features
- name: Run cargo check (proof-of-sql) (all features)
run: |
cargo check -p proof-of-sql --all-features
cargo check -p proof-of-sql --all-targets --all-features
- name: Run cargo check (proof-of-sql) (just "test" feature)
run: |
cargo check -p proof-of-sql --no-default-features --features="test"
cargo check -p proof-of-sql --all-targets --no-default-features --features="test"
- name: Run cargo check (proof-of-sql) (just "blitzar" feature)
run: |
cargo check -p proof-of-sql --no-default-features --features="blitzar"
cargo check -p proof-of-sql --all-targets --no-default-features --features="blitzar"
- name: Run cargo check (proof-of-sql) (just "arrow" feature)
run: |
cargo check -p proof-of-sql --no-default-features --features="arrow"
cargo check -p proof-of-sql --all-targets --no-default-features --features="arrow"
- name: Run cargo check (proof-of-sql) (just "rayon" feature)
run: |
cargo check -p proof-of-sql --no-default-features --features="rayon"
cargo check -p proof-of-sql --all-targets --no-default-features --features="rayon"
- name: Run cargo check (proof-of-sql) (just "perf" feature)
run: |
cargo check -p proof-of-sql --no-default-features --features="perf"
cargo check -p proof-of-sql --all-targets --no-default-features --features="perf"
- name: Run cargo check (proof-of-sql) (just "std" feature)
run: |
cargo check -p proof-of-sql --no-default-features --features="std"
cargo check -p proof-of-sql --all-targets --no-default-features --features="std"
- name: Run cargo check (proof-of-sql) with no_std target.
run: |
rustup target add thumbv7em-none-eabi
cargo check -p proof-of-sql --target thumbv7em-none-eabi --no-default-features
- name: Check that we can compile `proof-of-sql-planner` to WebAssembly
working-directory: ./crates/proof-of-sql-planner
run: |
cargo install wasm-pack
wasm-pack build --target deno
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- run: cargo test --all-features
testnorayon:
name: Test Suite (without rayon)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- run: cargo test --no-default-features --features="arrow blitzar"
testother:
name: Test Suite (other)
runs-on: large-8-core-32gb-22-04
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- name: Dry run cargo test (proof-of-sql) (test feature only)
run: cargo test -p proof-of-sql --no-run --no-default-features --features="test"
- name: Dry run cargo test (proof-of-sql) (arrow feature only)
run: cargo test -p proof-of-sql --no-run --no-default-features --features="arrow"
- name: Dry run cargo test (proof-of-sql) (blitzar feature only)
run: cargo test -p proof-of-sql --no-run --no-default-features --features="blitzar"
- name: Dry run cargo test (proof-of-sql) (std feature only)
run: cargo test -p proof-of-sql --no-run --no-default-features --features="std"
- name: Run cargo test (proof primitives - Dory) (std feature only - i.e. not using blitzar)
run: |
cargo test proof_primitive::dory::dory_compute_commitments_test --no-default-features --features="std" && \
cargo test proof_primitive::dory::dynamic_dory_compute_commitments_test --no-default-features --features="std"
examples:
name: Run Examples (Heavy)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- name: Run hello_world example (With Blitzar)
run: cargo run --example hello_world --features="proof-of-sql/test"
- name: Run hello_world example (Without Blitzar and With Rayon)
run: cargo run --example hello_world --no-default-features --features="proof-of-sql/rayon proof-of-sql/test"
- name: Run hello_world example (Without Blitzar and Without Rayon)
run: cargo run --example hello_world --no-default-features --features="proof-of-sql/test"
- name: Run space example
run: cargo run --example space
- name: Run dog breeds example
run: cargo run --example dog_breeds
- name: Run wood types example
run: cargo run --example wood_types
- name: Run posql_db example (With Blitzar)
run: bash crates/proof-of-sql-planner/examples/posql_db/run_example.sh
- name: Run posql_db example (Without Blitzar)
run: bash crates/proof-of-sql-planner/examples/posql_db/run_example.sh --no-default-features --features="proof-of-sql/rayon"
clippy:
name: Clippy
runs-on: large-8-core-32gb-22-04
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: |
curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
rustup component add clippy
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- name: Run clippy
run: cargo cl -- -D warnings
# Run cargo f --check
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
run: |
curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
rustup component add rustfmt
- name: Run cargo fmt
run: cargo f --check
udeps:
name: Unused Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nightly toolchain
run: |
curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install nightly
cargo +nightly install cargo-udeps --locked
- name: Run cargo udeps
run: cargo +nightly udeps --all-targets
foundrycheck: # Modified from the foundry book: https://book.getfoundry.sh/config/continuous-integration
name: Foundry project
runs-on: large-8-core-32gb-22-04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.0.0
- name: Install dependencies
run: solidity/scripts/install_deps.sh
- name: Run tests without via-ir or optimization
run: solidity/scripts/pre_forge.sh test
- name: Run tests with via-ir but without optimization
run: solidity/scripts/pre_forge.sh test --via-ir
- name: Run tests with optimization but without via-ir
run: solidity/scripts/pre_forge.sh test --optimize
- name: Run tests with via-ir and optimization
run: solidity/scripts/pre_forge.sh test --via-ir --optimize
- name: Remove preprocessor test files (for they are already tested in the check-yul-preprocessor job)
run: rm -rf solidity/preprocessor/test_files
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Check code coverage
run: solidity/scripts/check_coverage.sh
- name: Check fmt
run: solidity/scripts/pre_forge.sh fmt --check
- name: Run solhint
run: |
npm install -g solhint
cd solidity
solhint '**/*.sol' -w 0
cd ..
- name: Install Slither
run: pip install slither-analyzer
- name: Run slither on verifier
run: slither solidity/src/verifier/Verifier.post.sol --config-file solidity/slither.config.json
- name: Run slither on errors
run: slither solidity/src/base/Errors.sol --config-file solidity/slither.config.json
- name: Run slither on constants
run: slither solidity/src/base/Constants.sol --config-file solidity/slither.config.json
rustevmtests:
name: Rust EVM Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env && rustup toolchain install
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.0.0
- name: Install dependencies
run: solidity/scripts/install_deps.sh
- uses: dtolnay/[email protected]
- name: Run Rust EVM tests
run: cargo test --package proof-of-sql --lib --all-features -- evm_tests --ignored --test-threads=1
- name: Run Planner Rust EVM tests
run: cargo test --package proof-of-sql-planner --all-features --test evm_tests -- --ignored --test-threads=1
check-yul-preprocessor:
name: Check Yul Preprocessor
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black pytest
- name: Run black
run: black --check solidity/preprocessor/
- name: Run pytest
run: pytest solidity/preprocessor/