diff --git a/.github/actions/ci-deps/action.yml b/.github/actions/ci-deps/action.yml deleted file mode 100644 index 4100cf0f0..000000000 --- a/.github/actions/ci-deps/action.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Install CI deps - -inputs: - cache-key: - required: false - local-cache: - required: false - GITHUB_TOKEN: - required: true - description: "GITHUB_TOKEN needed to make GitHub API requests" - -runs: - using: "composite" - - steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v8 - with: - github-token: ${{ inputs.GITHUB_TOKEN }} - # Do not use systemd - init: none - - - name: Set up Nix cache - uses: DeterminateSystems/magic-nix-cache-action@v3 - - - name: Install CI deps - shell: bash - run: | - # Remove previously installed nix profiles - nix profile remove '.*' - # Install the current one - nix profile install .#ci-deps - # Set up CI environment - nix run .#ci-env >> $GITHUB_ENV - - - id: get-info - name: Get info - shell: bash - run: | - RUST_VERSION="$(taplo get -f rust-toolchain.toml 'toolchain.channel')" - echo "cache-primary-key=toolchain-${{ runner.os }}-${{ runner.arch }}-${RUST_VERSION}" >> "$GITHUB_OUTPUT" - - - id: toolchain-cache-restore - name: Restore Cargo Cache (Local Restore) - if: ${{ inputs.local-cache }} - uses: 0xmozak/local-cache/restore@ff33c7264117faa1bbd99aa0ddb467a9ccc3919e - with: - key: ${{ steps.get-info.outputs.cache-primary-key }} - path: | - ~/.cargo/git - ~/.cargo/registry - - - id: toolchain-cache-save - name: Persist Cargo Cache (Local Save) - if: ${{ steps.toolchain-cache-restore.outputs.cache-hit != 'true' }} - uses: 0xmozak/local-cache/save@ff33c7264117faa1bbd99aa0ddb467a9ccc3919e - with: - key: ${{ steps.get-info.outputs.cache-primary-key }} - path: | - ~/.cargo/git - ~/.cargo/registry - - - id: local-cache - name: Cache Rust artifacts (Local) - uses: 0xmozak/rust-cache@d5f76b3ac4ba287ab299d4d3586d5cd11ad21cab - with: - prefix-key: ${{ inputs.cache-key != '' && inputs.cache-key || null }} - cache-provider: "local" - - - name: Debug - shell: bash - run: echo cache-hit=${{ steps.local-cache.outputs.cache-hit }} partial-hit=${{ steps.local-cache.outputs.partial-hit }} - - - name: Cache Rust artifacts (Remote) - uses: 0xmozak/rust-cache@d5f76b3ac4ba287ab299d4d3586d5cd11ad21cab - if: ${{ steps.local-cache.outputs.cache-hit != 'true'}} - with: - require-full-match: ${{ steps.local-cache.outputs.partial-hit }} - prefix-key: ${{ inputs.cache-key != '' && inputs.cache-key || null }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34d96a7b6..5d2f14c6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: ["main"] + branches: [ "main" ] pull_request: types: - opened @@ -28,29 +28,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install CI deps - uses: ./.github/actions/ci-deps + - name: Install rust toolkit + uses: ./.github/actions/rust with: local-cache: ${{ needs.check-runner.outputs.runner-label == 'self-hosted' }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Compile and archive all the tests - run: nice cargo nextest archive --locked --features="enable_poseidon_starks" --all-targets --archive-file mozak-vm-tests.tar.zst + - name: Compile + run: nice cargo nextest run --no-run --locked --features="enable_poseidon_starks" --all-targets - - name: Run all the tests from the archive - run: MOZAK_STARK_DEBUG=true nice cargo nextest run --no-fail-fast --archive-file mozak-vm-tests.tar.zst - - run-examples: - needs: check-runner - runs-on: ${{ needs.check-runner.outputs.runner-label }} - steps: - - uses: actions/checkout@v4 - - - name: Install CI deps - uses: ./.github/actions/ci-deps - with: - local-cache: ${{ needs.check-runner.outputs.runner-label == 'self-hosted' }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test + run: MOZAK_STARK_DEBUG=true nice cargo nextest run --no-fail-fast --locked --features="enable_poseidon_starks" --all-targets - name: Build and run examples run: | @@ -63,8 +50,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install CI deps - uses: ./.github/actions/ci-deps + - name: Install rust toolkit + uses: ./.github/actions/rust with: local-cache: ${{ needs.check-runner.outputs.runner-label == 'self-hosted' }} @@ -81,14 +68,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install CI deps - uses: ./.github/actions/ci-deps + - name: Install rust toolkit + uses: ./.github/actions/rust with: local-cache: ${{ needs.check-runner.outputs.runner-label == 'self-hosted' }} - name: Build all examples run: | - cd examples-builder && cargo build --all-features + cd examples-builder + cargo build --all-features cargo-fmt: needs: check-runner @@ -96,11 +84,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install CI deps - uses: ./.github/actions/ci-deps + - name: Install rust toolkit + uses: ./.github/actions/rust with: local-cache: ${{ needs.check-runner.outputs.runner-label == 'self-hosted' }} + - name: Run fmt run: cargo fmt --all --check @@ -121,8 +110,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install CI deps - uses: ./.github/actions/ci-deps + - name: Install rust toolkit + uses: ./.github/actions/rust with: local-cache: ${{ needs.check-runner.outputs.runner-label == 'self-hosted' }} diff --git a/examples/Cargo.lock b/examples/Cargo.lock index 47e651ba8..291eec140 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -478,7 +478,7 @@ dependencies = [ [[package]] name = "plonky2" version = "0.1.4" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#1017c3065b0c6a07621af69a78007938e8c036a1" dependencies = [ "ahash 0.8.6", "anyhow", @@ -501,7 +501,7 @@ dependencies = [ [[package]] name = "plonky2_field" version = "0.1.1" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#1017c3065b0c6a07621af69a78007938e8c036a1" dependencies = [ "anyhow", "itertools", @@ -516,12 +516,12 @@ dependencies = [ [[package]] name = "plonky2_maybe_rayon" version = "0.1.1" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#1017c3065b0c6a07621af69a78007938e8c036a1" [[package]] name = "plonky2_util" version = "0.1.1" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#1017c3065b0c6a07621af69a78007938e8c036a1" [[package]] name = "poseidon2-example-mozak-guest" diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 21e5175c6..000000000 --- a/flake.lock +++ /dev/null @@ -1,103 +0,0 @@ -{ - "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1706941198, - "narHash": "sha256-t6/qloMYdknVJ9a3QzjylQIZnQfgefJ5kMim50B7dwA=", - "owner": "nix-community", - "repo": "fenix", - "rev": "28dbd8b43ea328ee708f7da538c63e03d5ed93c8", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1706830856, - "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1706701482, - "narHash": "sha256-4FF5l9v2lBgOUWzP3DcntfsXvEuao5FhhQcJ4SbwjFE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "269ce7215bb5b436546786e8d354d37903e102a8", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "fenix": "fenix", - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" - } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1706875368, - "narHash": "sha256-KOBXxNurIU2lEmO6lR2A5El32X9x8ITt25McxKZ/Ew0=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "8f6a72871ec87ed53cfe43a09fb284168a284e7e", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 4ef554cba..000000000 --- a/flake.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - description = "A very basic flake"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = inputs @ {flake-parts, ...}: - flake-parts.lib.mkFlake {inherit inputs;} { - systems = [ - "x86_64-linux" - "aarch64-darwin" - ]; - - perSystem = { - config, - system, - pkgs, - ... - }: { - _module.args.pkgs = import inputs.nixpkgs { - inherit system; - - overlays = [ - inputs.fenix.overlays.default - ]; - - config = {}; - }; - - formatter = pkgs.alejandra; - - packages.rust-toolchain = pkgs.fenix.fromToolchainFile { - file = ./rust-toolchain.toml; - sha256 = "sha256-/Qcw88/iUz/WDWv19OZs4zL/EpdLHsD7loh65qSXvU8="; - }; - - packages.ci-deps = pkgs.symlinkJoin { - name = "ci-deps"; - - paths = with pkgs; - [ - taplo - nodejs_20 - wasmtime - cargo-nextest - config.packages.rust-toolchain - ] - ++ lib.lists.optional (stdenv.isDarwin) pkgs.darwin.libiconv; - }; - - # CI Setup for GitHub Actions - packages.ci-env = pkgs.writeScriptBin "ci-setup" '' - echo CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-args=-Wl,-rpath,${config.packages.ci-deps}/lib/" - echo CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS="-C link-args=-Wl,-rpath,${config.packages.ci-deps}/lib/" - ''; - - devShells.default = pkgs.mkShell { - nativeBuildInputs = [ - config.packages.ci-deps - ]; - - CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS = ''-C link-args=-Wl,-rpath,${config.packages.ci-deps}/lib/''; - CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS = ''-C link-args=-Wl,-rpath,${config.packages.ci-deps}/lib/''; - }; - }; - }; -} diff --git a/guest/Cargo.lock b/guest/Cargo.lock index 8b6df2abb..21a2473c7 100644 --- a/guest/Cargo.lock +++ b/guest/Cargo.lock @@ -260,7 +260,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "plonky2" version = "0.1.4" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#ec95756268799d296565c6fd779d4ef90703bd57" dependencies = [ "ahash", "anyhow", @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "plonky2_field" version = "0.1.1" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#ec95756268799d296565c6fd779d4ef90703bd57" dependencies = [ "anyhow", "itertools", @@ -298,12 +298,12 @@ dependencies = [ [[package]] name = "plonky2_maybe_rayon" version = "0.1.1" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#ec95756268799d296565c6fd779d4ef90703bd57" [[package]] name = "plonky2_util" version = "0.1.1" -source = "git+https://github.com/0xmozak/plonky2.git#ce9ee7146678253418a936b78945e5ebaea0e0d5" +source = "git+https://github.com/0xmozak/plonky2.git#ec95756268799d296565c6fd779d4ef90703bd57" [[package]] name = "ppv-lite86" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c44dfa5bc..163bdf59c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-01-23" -components = ["rustfmt", "rust-src", "rust-analyzer", "clippy"] +channel = "nightly-2024-01-17" +components = ["rustfmt", "rust-src", "rust-analyzer"] profile = "minimal"