Update libmdbx bindings #2246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Build | |
| on: [push, pull_request] | |
| # Cancel in-progress runs for the same ref | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} | |
| env: | |
| TEST_CASES: | | |
| consensus spec tests mainnet fulu empty block transition | |
| pectra-devnet-6 without epoch transition | |
| jobs: | |
| build: | |
| # Skip pull_request events for same-repo branches (push already covers them) | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| include: | |
| - os: ubuntu-latest | |
| backend: arkworks,blst,constantine,mcl | |
| - os: windows-latest | |
| backend: arkworks,constantine,zkcrypto | |
| default_kzg_backend: arkworks | |
| test_kzg_backends: | | |
| set KZG_BACKEND=constantine | |
| cargo test --release --no-default-features --features arkworks,constantine,zkcrypto --workspace --exclude zkvm_host --exclude zkvm_guest_risc0 -- kzg | |
| cargo test --release --no-default-features --features zkcrypto --workspace --exclude zkvm_host --exclude zkvm_guest_risc0 -- kzg | |
| - os: macos-latest | |
| backend: arkworks,blst,mcl | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| if: runner.os == 'Linux' | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| - name: Install system dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get update && \ | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ | |
| --no-install-recommends -yq \ | |
| ca-certificates \ | |
| libssl-dev \ | |
| clang \ | |
| cmake \ | |
| unzip \ | |
| protobuf-compiler \ | |
| libprotobuf-dev \ | |
| libz-dev | |
| - name: Disable autocrlf (Windows) | |
| if: runner.os == 'Windows' | |
| run: git config --global core.autocrlf false | |
| - name: Setup nim for constantine backend | |
| if: runner.os != 'Macos' | |
| uses: jiro4989/setup-nim-action@v2 | |
| with: | |
| nim-version: "2.0.2" | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| parent-nim-install-directory: ${{ runner.temp }} | |
| - name: Install dependencies for constantine backend | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ | |
| --no-install-recommends -yq \ | |
| libgmp-dev \ | |
| llvm | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Run cargo build | |
| run: cargo build --release --no-default-features --features default-networks,${{ matrix.backend }} --workspace --exclude zkvm_host --exclude zkvm_guest_risc0 --exclude c_grandine --exclude csharp_grandine | |
| - name: Check if code is formatted (Linux) | |
| if: runner.os == 'Linux' | |
| run: cargo fmt --check | |
| - name: Download consensus-spec-tests | |
| run: bash scripts/download_spec_tests.sh | |
| - name: Run Clippy (Linux) | |
| if: runner.os == 'Linux' | |
| run: scripts/ci/clippy.bash --deny warnings | |
| # It's a known issue that networking tests randomly fails on Macos | |
| - name: Run tests | |
| if: runner.os == 'Macos' | |
| run: cargo test --release --no-fail-fast --no-default-features --features default-networks,${{ matrix.backend }} --workspace --exclude zkvm_host --exclude zkvm_guest_risc0 --exclude c_grandine --exclude csharp_grandine -- --skip behaviour --skip common | |
| # For debugging on window-specific error | |
| - name: Run tests | |
| if: runner.os != 'Macos' | |
| run: cargo test --release --no-default-features --features default-networks,${{ matrix.backend }} --workspace --exclude zkvm_host --exclude zkvm_guest_risc0 --exclude c_grandine --exclude csharp_grandine | |
| env: | |
| KZG_BACKEND: ${{ matrix.default_kzg_backend }} | |
| - name: Run other kzg backend tests | |
| if: matrix.test_kzg_backends != '' | |
| run: ${{ matrix.test_kzg_backends }} | |
| - name: Check consensus-spec-tests coverage (Linux) | |
| if: runner.os == 'Linux' | |
| run: scripts/ci/consensus-spec-tests-coverage.rb | |
| zkvm-test: | |
| # Skip pull_request events for same-repo branches (push already covers them) | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
| strategy: | |
| matrix: | |
| backend: [risc0, sp1, pico, ziren, zisk] | |
| include: | |
| # zkVM test - risc0 implementation | |
| - backend: risc0 | |
| # Refer to docs: https://dev.risczero.com/api/zkvm/install#using-rzup-in-ci | |
| install: | | |
| curl -L https://risczero.com/install | bash | |
| echo "/home/runner/.risc0/bin" >> $GITHUB_PATH | |
| export PATH="/home/runner/.risc0/bin:$PATH" | |
| rzup install rust 1.91.1 | |
| rzup install cpp 2024.1.5 | |
| rzup install r0vm 3.0.4 | |
| rzup install cargo-risczero 3.0.4 | |
| cargo risczero --version | |
| execute: RUST_LOG=info RISC0_DEV_MODE=1 cargo run -p zkvm_host --features risc0 --release -- --test "$TEST" execute | |
| # zkVM test - SP1 implementation | |
| - backend: sp1 | |
| install: | | |
| curl -L https://sp1up.succinct.xyz | bash | |
| echo "/home/runner/.sp1/bin" >> $GITHUB_PATH | |
| export PATH="/home/runner/.sp1/bin:$PATH" | |
| sp1up -v 6.0.2 | |
| cargo prove --version | |
| execute: RUST_LOG=info SP1_PROVER=light cargo run -p zkvm_host --features sp1 --release -- --test "$TEST" execute | |
| # zkVM test - Brevis Pico implementation | |
| - backend: pico | |
| install: | | |
| rustup install nightly-2025-08-04 | |
| rustup component add rust-src --toolchain nightly-2025-08-04 | |
| cargo +nightly-2025-08-04 install --git https://github.com/brevis-network/pico pico-cli | |
| cargo pico --version | |
| execute: RUST_LOG=info cargo +nightly-2025-08-04 run -p zkvm_host --features pico --release -- --test "$TEST" execute | |
| # zkVM test - ZiskOS implementation | |
| - backend: zisk | |
| install: | | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get update | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get install -y xz-utils jq curl build-essential qemu-system libomp-dev libgmp-dev nlohmann-json3-dev protobuf-compiler uuid-dev libgrpc++-dev libsecp256k1-dev libsodium-dev libpqxx-dev nasm libopenmpi-dev openmpi-bin openmpi-common libclang-dev clang gcc-riscv64-unknown-elf | |
| curl https://raw.githubusercontent.com/0xPolygonHermez/zisk/main/ziskup/install.sh | GH_RUNNER=true ZISK_VERSION=0.13.0 bash | |
| echo "/home/runner/.config/.zisk/bin" >> $GITHUB_PATH | |
| export PATH="/home/runner/.config/.zisk/bin:$PATH" | |
| cargo-zisk -V | |
| execute: RUST_LOG=info cargo run -p zkvm_host --features zisk --release -- --test "$TEST" execute | |
| # zkVM test - ZKM implementation | |
| - backend: ziren | |
| install: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| pre_build: | | |
| source ~/.zkm-toolchain/env | |
| if ! rustup toolchain list | grep -q "nightly-2025-06-30"; then | |
| rustup toolchain install nightly-2025-06-30-x86_64-unknown-linux-gnu | |
| fi | |
| cd zkvm/guest/ziren | |
| rustup run nightly-2025-06-30 cargo build --release --target mipsel-zkm-zkvm-elf | |
| execute: | | |
| source ~/.zkm-toolchain/env | |
| RUST_LOG=info cargo run -p zkvm_host --features ziren --release -- --test "$TEST" execute | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| if: runner.os == 'Linux' | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| # this might remove tools that are actually needed, if set to "true" but frees about 6 GB | |
| tool-cache: false | |
| - name: Install system dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get update && \ | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ | |
| --no-install-recommends -yq \ | |
| ca-certificates \ | |
| libssl-dev \ | |
| clang \ | |
| cmake \ | |
| unzip \ | |
| protobuf-compiler \ | |
| libprotobuf-dev \ | |
| libz-dev | |
| - name: Setup nim for constantine backend | |
| uses: jiro4989/setup-nim-action@v2 | |
| with: | |
| nim-version: "2.0.2" | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| parent-nim-install-directory: ${{ runner.temp }} | |
| - name: Install dependencies for constantine backend | |
| shell: bash | |
| run: | | |
| sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ | |
| --no-install-recommends -yq \ | |
| libgmp-dev \ | |
| llvm | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| lfs: true | |
| - name: Check out necessary submodules only | |
| shell: bash | |
| run: | | |
| git submodule update --init dedicated_executor eth2_libp2p | |
| - name: Cache ZKM toolchain | |
| if: matrix.backend == 'ziren' | |
| id: cache-zkm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.zkm-toolchain | |
| key: ${{ runner.os }}-zkm-toolchain-nightly-2025-06-30-v2 | |
| restore-keys: | | |
| ${{ runner.os }}-zkm-toolchain-nightly-2025-06-30- | |
| - name: Installing ${{ matrix.backend }} zkVM | |
| run: ${{ matrix.install }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pre-build step for ${{ matrix.backend }} | |
| if: matrix.pre_build != '' | |
| run: ${{ matrix.pre_build }} | |
| - name: Running ${{ matrix.backend }} test | |
| run: | | |
| IFS=$'\n' | |
| for TEST in $TEST_CASES; do | |
| echo "Running test: $TEST" | |
| ${{ matrix.execute }} | |
| done |