diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f7fe58aca..ebaaf091f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,7 +29,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: "nightly-fe2acca4e379793539db80e032d76ffe0110298b" + version: "v0.3.0" # Build to generate the ABI bindings. - name: cargo build diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 414549366..20e9fb00f 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -4,7 +4,7 @@ on: - main pull_request: -name: compliance +name: compliance 07 jobs: compliance: runs-on: ubuntu-latest @@ -25,11 +25,11 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: "nightly-fe2acca4e379793539db80e032d76ffe0110298b" + version: "v0.3.0" - uses: KengoTODA/actions-setup-docker-compose@v1 with: - version: '2.14.2' + version: "2.14.2" - name: Clone Test Executor uses: actions/checkout@v4 diff --git a/.github/workflows/compliance_v06.yaml b/.github/workflows/compliance_v06.yaml index 0ec61e281..26a019743 100644 --- a/.github/workflows/compliance_v06.yaml +++ b/.github/workflows/compliance_v06.yaml @@ -4,7 +4,7 @@ on: - main pull_request: -name: compliance +name: compliance 06 jobs: compliance: runs-on: ubuntu-latest @@ -24,7 +24,7 @@ jobs: - uses: KengoTODA/actions-setup-docker-compose@v1 with: - version: '2.14.2' + version: "2.14.2" - name: Clone Test Executor uses: actions/checkout@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3a42b1d6b..d67257a90 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -64,7 +64,7 @@ jobs: if: contains( ${{ matrix.target }}, 'apple') uses: foundry-rs/foundry-toolchain@v1 with: - version: "nightly-fe2acca4e379793539db80e032d76ffe0110298b" + version: "v0.3.0" - name: Install protobuf if: contains( ${{ matrix.target }}, 'apple') diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index f62badb15..270f0a647 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -35,7 +35,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: "nightly-fe2acca4e379793539db80e032d76ffe0110298b" + version: "v0.3.0" - name: Install latest nextest release uses: taiki-e/install-action@nextest diff --git a/Dockerfile b/Dockerfile index 2502811bb..98c5ab56c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ # Adapted from https://github.com/paradigmxyz/reth/blob/main/Dockerfile # syntax=docker/dockerfile:1.4 -FROM ghcr.io/foundry-rs/foundry:nightly-fe2acca4e379793539db80e032d76ffe0110298b as foundry - FROM --platform=$TARGETPLATFORM rust:1.83.0 AS chef-builder # Install system dependencies @@ -12,12 +10,10 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg - RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config protobuf-compiler nodejs yarn rsync -# copy foundry tool -COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge - SHELL ["/bin/bash", "-c"] RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="/root/.foundry/bin:${PATH}" +RUN foundryup -i v0.3.0 RUN cargo install cargo-chef --locked diff --git a/Dockerfile.build b/Dockerfile.build index d5c5578bf..35f03015b 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,6 +1,6 @@ ARG CROSS_BASE_IMAGE -FROM ghcr.io/foundry-rs/foundry:nightly-fe2acca4e379793539db80e032d76ffe0110298b as foundry +FROM ghcr.io/foundry-rs/foundry:v0.3.0 as foundry FROM $CROSS_BASE_IMAGE COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge @@ -19,4 +19,3 @@ RUN apt-get update && apt-get install -y unzip RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip \ && unzip protoc-3.15.8-linux-x86_64.zip -d /usr/local \ && chmod +x /usr/local/bin/protoc - diff --git a/crates/contracts/contracts/foundry.toml b/crates/contracts/contracts/foundry.toml index ea3c24180..d6e198401 100644 --- a/crates/contracts/contracts/foundry.toml +++ b/crates/contracts/contracts/foundry.toml @@ -5,6 +5,9 @@ libs = ['lib'] test = 'test' cache_path = 'cache' solc_version = '0.8.26' +optimizer = true +optimizer_runs = 200 +evm_version = 'paris' remappings = [ 'forge-std/=lib/forge-std/src', diff --git a/docs/developing.md b/docs/developing.md index 94daa0ea4..2dc9ddd69 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -12,13 +12,13 @@ git submodule update --init --recursive 2. Install prerequisites -* [Rust/Cargo](https://www.rust-lang.org/tools/install): 1.72 or higher with nightly +* [Rust/Cargo](https://www.rust-lang.org/tools/install): 1.83 or higher with nightly * [Cocogitto](https://github.com/cocogitto/cocogitto): Commit linting * [Docker](https://docs.docker.com/engine/install/): Run spec tests * [PDM](https://pdm.fming.dev/latest/#installation): Run spec tests * [Protoc](https://grpc.io/docs/protoc-installation/): Compile protobuf * [Buf](https://buf.build/docs/installation): Protobuf linting -* [Foundry](https://book.getfoundry.sh/getting-started/installation): Compile contracts +* [Foundry ^0.3.0](https://book.getfoundry.sh/getting-started/installation): Compile contracts ## Build & Test