diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml new file mode 100644 index 0000000000..ceb275485f --- /dev/null +++ b/.github/actions/prepare/action.yml @@ -0,0 +1,53 @@ +name: 'Prepare Halo 2' +description: 'Sets up the Rust toolchain and prepares feature flags' +inputs: + toolchain: + description: 'Rust toolchain to use (defaults to MSRV)' + required: false + default: 1.60.0 + beta-features: + description: 'Include beta features' + required: false + default: false + nightly-features: + description: 'Include nightly features' + required: false + default: false + test-dependencies: + description: 'Include test dependencies' + required: false + default: true +outputs: + feature-flags: + description: 'Feature flags' + value: ${{ steps.prepare-flags.outputs.flags }} +runs: + using: 'composite' + steps: + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ inputs.toolchain }} + override: true + - id: beta + shell: bash + run: echo "feature=beta" >> $GITHUB_OUTPUT + if: inputs.beta-features == 'true' + - id: nightly + shell: bash + run: echo "feature=nightly" >> $GITHUB_OUTPUT + if: inputs.nightly-features == 'true' + - id: test + shell: bash + run: echo "feature=test-dependencies" >> $GITHUB_OUTPUT + if: inputs.test-dependencies == 'true' + - id: prepare-flags + shell: bash + run: > + echo "flags=--no-default-features --features ' + batch + dev-graph + gadget-traces + ${{ steps.beta.outputs.feature }} + ${{ steps.nightly.outputs.feature }} + ${{ steps.test.outputs.feature }} + '" >> $GITHUB_OUTPUT diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index c948247ae3..ef3bb203ad 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -14,10 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.56.1 - override: true + - uses: ./.github/actions/prepare - name: Run benchmark run: cargo bench -- --output-format bencher | tee output.txt - name: Store benchmark result diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd37431e4e..e74dab31d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,15 +20,18 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.56.1 - override: true + - id: prepare + uses: ./.github/actions/prepare - name: Run tests uses: actions-rs/cargo@v1 with: command: test - args: --verbose --release --workspace --features batch,dev-graph,gadget-traces,test-dependencies ${{ matrix.extra_flags }} + args: > + --verbose + --release + --workspace + ${{ steps.prepare.outputs.feature-flags }} + ${{ matrix.extra_flags }} build: name: Build target ${{ matrix.target }} @@ -41,17 +44,20 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - id: prepare + uses: ./.github/actions/prepare with: - toolchain: 1.56.1 - override: true + nightly-features: true + test-dependencies: false - name: Add target run: rustup target add ${{ matrix.target }} - name: cargo build uses: actions-rs/cargo@v1 with: command: build - args: --features batch,dev-graph,gadget-traces,nightly --target ${{ matrix.target }} + args: > + ${{ steps.prepare.outputs.feature-flags }} + --target ${{ matrix.target }} bitrot: name: Bitrot check @@ -61,10 +67,9 @@ jobs: - uses: actions/checkout@v3 # Check bitrot with stable (as we don't need benchmarks or the test-dev-graph # feature flag to work with MSRV). - - uses: actions-rs/toolchain@v1 + - uses: ./.github/actions/prepare with: toolchain: stable - override: true # Build benchmarks and all-features to prevent bitrot - name: Build benchmarks uses: actions-rs/cargo@v1 @@ -77,10 +82,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.56.1 - override: true + - uses: ./.github/actions/prepare - name: cargo build uses: actions-rs/cargo@v1 with: @@ -99,10 +101,11 @@ jobs: steps: - uses: actions/checkout@v3 # Use stable for this to ensure that cargo-tarpaulin can be built. - - uses: actions-rs/toolchain@v1 + - id: prepare + uses: ./.github/actions/prepare with: toolchain: stable - override: true + nightly-features: true - name: Install cargo-tarpaulin uses: actions-rs/cargo@v1 with: @@ -112,7 +115,10 @@ jobs: uses: actions-rs/cargo@v1 with: command: tarpaulin - args: --features batch,dev-graph,gadget-traces,test-dependencies,nightly --timeout 600 --out Xml + args: > + ${{ steps.prepare.outputs.feature-flags }} + --timeout 600 + --out Xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v3.1.1 @@ -122,10 +128,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.56.1 - override: true + - uses: ./.github/actions/prepare - name: cargo fetch uses: actions-rs/cargo@v1 with: @@ -145,10 +148,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.56.1 - override: true + - uses: ./.github/actions/prepare - run: rustup component add rustfmt - uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/lints-beta.yml b/.github/workflows/lints-beta.yml index 71d183e370..dd3181e7fe 100644 --- a/.github/workflows/lints-beta.yml +++ b/.github/workflows/lints-beta.yml @@ -13,15 +13,19 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - id: prepare + uses: ./.github/actions/prepare with: toolchain: beta - components: clippy - override: true + nightly-features: true + - run: rustup component add clippy - name: Run Clippy (beta) uses: actions-rs/clippy-check@v1 continue-on-error: true with: name: Clippy (beta) token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --all-targets -- -W clippy::all + args: > + ${{ steps.prepare.outputs.feature-flags }} + --all-targets + -- -W clippy::all diff --git a/.github/workflows/lints-stable.yml b/.github/workflows/lints-stable.yml index b12d3c0de8..a0effc7ba2 100644 --- a/.github/workflows/lints-stable.yml +++ b/.github/workflows/lints-stable.yml @@ -5,20 +5,23 @@ on: pull_request jobs: clippy: - name: Clippy (1.56.1) + name: Clippy (MSRV) timeout-minutes: 30 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - id: prepare + uses: ./.github/actions/prepare with: - toolchain: 1.56.1 - components: clippy - override: true + nightly-features: true + - run: rustup component add clippy - name: Run clippy uses: actions-rs/clippy-check@v1 with: - name: Clippy (1.56.1) + name: Clippy (MSRV) token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --all-targets -- -D warnings + args: > + ${{ steps.prepare.outputs.feature-flags }} + --all-targets + -- -D warnings diff --git a/README.md b/README.md index 69167e0716..1f0c4e41f1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Minimum Supported Rust Version -Requires Rust **1.56.1** or higher. +Requires Rust **1.60** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. diff --git a/halo2/Cargo.toml b/halo2/Cargo.toml index 7a6bbaa94f..ffe105cf21 100644 --- a/halo2/Cargo.toml +++ b/halo2/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Jack Grigg ", ] edition = "2021" -rust-version = "1.56.1" +rust-version = "1.59" description = "[BETA] Fast zero-knowledge proof-carrying data implementation with no trusted setup" license = "MIT OR Apache-2.0" repository = "https://github.com/zcash/halo2" diff --git a/halo2_gadgets/Cargo.toml b/halo2_gadgets/Cargo.toml index c21cf0f38b..ed2bdcfc1b 100644 --- a/halo2_gadgets/Cargo.toml +++ b/halo2_gadgets/Cargo.toml @@ -9,7 +9,7 @@ authors = [ "Kris Nuttycombe ", ] edition = "2021" -rust-version = "1.56.1" +rust-version = "1.59" description = "Reusable gadgets and chip implementations for Halo 2" license = "MIT OR Apache-2.0" repository = "https://github.com/zcash/halo2" diff --git a/halo2_gadgets/README.md b/halo2_gadgets/README.md index 4ed744f81f..90a803c093 100644 --- a/halo2_gadgets/README.md +++ b/halo2_gadgets/README.md @@ -1,6 +1,6 @@ # halo2_gadgets [![Crates.io](https://img.shields.io/crates/v/halo2_gadgets.svg)](https://crates.io/crates/halo2_gadgets) # -Requires Rust 1.56.1+. +Requires Rust 1.60+. ## Documentation diff --git a/halo2_proofs/Cargo.toml b/halo2_proofs/Cargo.toml index 4319eb7558..4a6d1ac53f 100644 --- a/halo2_proofs/Cargo.toml +++ b/halo2_proofs/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Jack Grigg ", ] edition = "2021" -rust-version = "1.56.1" +rust-version = "1.59" description = """ Fast PLONK-based zero-knowledge proving system with no trusted setup """ diff --git a/halo2_proofs/README.md b/halo2_proofs/README.md index 7c226ff24c..26597d5abc 100644 --- a/halo2_proofs/README.md +++ b/halo2_proofs/README.md @@ -4,7 +4,7 @@ ## Minimum Supported Rust Version -Requires Rust **1.56.1** or higher. +Requires Rust **1.60** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 43c989b553..0000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.56.1 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..948d27daa4 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.60.0"