Skip to content

Commit

Permalink
Merge tag 'v3.1.2' into release/v3.x-fh
Browse files Browse the repository at this point in the history
Arbitrum Nitro v3.1.2
  • Loading branch information
sduchesneau committed Aug 30, 2024
2 parents 2b78e52 + 309340a commit 10b43ea
Show file tree
Hide file tree
Showing 189 changed files with 10,133 additions and 2,148 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ go-ethereum/tests
**/*.yml
contracts/build
contracts/cache/
safe-smart-account/build/
solgen/go
**/node_modules

Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ jobs:
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.76"
toolchain: 'stable'
components: 'llvm-tools-preview, rustfmt, clippy'

- name: Install rust nightly
uses: dtolnay/rust-toolchain@nightly
id: install-rust-nightly
with:
toolchain: "nightly-2024-02-04"
toolchain: 'nightly-2024-08-06'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'rust-src, rustfmt, clippy'

- name: Set STYLUS_NIGHTLY_VER environment variable
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV"

- name: Cache Rust intermediate build products
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -156,28 +159,19 @@ jobs:
run: echo "$HOME/wabt-prefix/bin" >> "$GITHUB_PATH"

- name: Make arbitrator libraries
run: make -j wasm-ci-build STYLUS_NIGHTLY_VER="+nightly-2024-02-04"
run: make -j wasm-ci-build

- name: Clippy check
run: cargo clippy --all --manifest-path arbitrator/Cargo.toml -- -D warnings

- name: Run rust tests
uses: actions-rs/cargo@v1
with:
command: test
args: -p arbutil -p prover -p jit -p stylus --release --manifest-path arbitrator/prover/Cargo.toml
run: cargo test -p arbutil -p prover -p jit -p stylus --release --manifest-path arbitrator/prover/Cargo.toml

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check
run: cargo fmt -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check

- name: Rustfmt - langs/rust
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path arbitrator/langs/rust/Cargo.toml -- --check
run: cargo fmt --all --manifest-path arbitrator/langs/rust/Cargo.toml -- --check

- name: Make proofs from test cases
run: make -j test-gen-proofs
Expand Down
97 changes: 75 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,23 @@ jobs:
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: 'wasm32-unknown-unknown, wasm32-wasi'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
toolchain: 'stable'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'llvm-tools-preview, rustfmt, clippy'

- name: Install rust nightly
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
id: install-rust-nightly
with:
profile: minimal
toolchain: "nightly"
toolchain: 'nightly-2024-08-06'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'rust-src, rustfmt, clippy'

- name: Install rust wasm targets
run: rustup target add wasm32-wasi wasm32-unknown-unknown
- name: Set STYLUS_NIGHTLY_VER environment variable
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV"

- name: Install nightly wasm targets
run: |
rustup component add rust-src --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Cache Build Products
uses: actions/cache@v3
Expand Down Expand Up @@ -140,18 +138,59 @@ jobs:
echo "TMPDIR=$(pwd)/target/tmp/deadbeefbee" >> "$GITHUB_ENV"
echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV"
echo "GOGC=80" >> "$GITHUB_ENV"
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
- name: run tests without race detection
- name: run tests without race detection and path state scheme
if: matrix.test-mode == 'defaults'
env:
TEST_STATE_SCHEME: path
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -timeout 20m -parallel=8 > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
- name: run tests with race detection
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -timeout 20m -tags=cionly > >(stdbuf -oL tee -a full.log | grep -vE "INFO|seal"); then
exit 1
fi
done
- name: run tests without race detection and hash state scheme
if: matrix.test-mode == 'defaults'
env:
TEST_STATE_SCHEME: hash
run: |
packages=`go list ./...`
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -timeout 20m -tags=cionly; then
exit 1
fi
done
- name: run tests with race detection and path state scheme
if: matrix.test-mode == 'race'
env:
TEST_STATE_SCHEME: path
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -race -timeout 30m -parallel=8 > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -race -timeout 30m > >(stdbuf -oL tee -a full.log | grep -vE "INFO|seal"); then
exit 1
fi
done
- name: run tests with race detection and hash state scheme
if: matrix.test-mode == 'race'
env:
TEST_STATE_SCHEME: hash
run: |
packages=`go list ./...`
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -race -timeout 30m; then
exit 1
fi
done
- name: run redis tests
if: matrix.test-mode == 'defaults'
Expand All @@ -161,19 +200,34 @@ jobs:
if: matrix.test-mode == 'challenge'
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -parallel=8 -tags=challengetest -run=TestChallenge > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=challengetest -run=TestChallenge > >(stdbuf -oL tee -a full.log | grep -vE "INFO|seal"); then
exit 1
fi
done
- name: run stylus tests
if: matrix.test-mode == 'stylus'
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -timeout 60m -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -parallel=8 -tags=stylustest -run="TestProgramArbitrator" > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -timeout 60m -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=stylustest -run="TestProgramArbitrator" > >(stdbuf -oL tee -a full.log | grep -vE "INFO|seal"); then
exit 1
fi
done
- name: run long stylus tests
if: matrix.test-mode == 'long'
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -timeout 60m -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -parallel=8 -tags=stylustest -run="TestProgramLong" > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
for package in $packages; do
echo running tests for $package
if ! stdbuf -oL gotestsum --format short-verbose --packages="$package" --rerun-fails=2 --no-color=false -- -timeout 60m -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=stylustest -run="TestProgramLong" > >(stdbuf -oL tee -a full.log | grep -vE "INFO|seal"); then
exit 1
fi
done
- name: Archive detailed run log
uses: actions/upload-artifact@v3
Expand All @@ -189,4 +243,3 @@ jobs:
files: ./coverage.txt,./coverage-redis.txt
verbose: false
token: ${{ secrets.CODECOV_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/merge-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: |
set -x pipefail
status_state="pending"
if ${{ contains(github.event.*.labels.*.name, 'design-approved') }}; then
if ${{ contains(github.event.pull_request.labels.*.name, 'design-approved') && !contains(github.event.pull_request.labels.*.name, 'after-next-version') }}; then
status_state="success"
else
resp="$(curl -sSL --fail-with-body \
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@
[submodule "arbitrator/langs/bf"]
path = arbitrator/langs/bf
url = https://github.com/OffchainLabs/stylus-sdk-bf.git
[submodule "safe-smart-account"]
path = safe-smart-account
url = https://github.com/safe-global/safe-smart-account.git
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
28 changes: 23 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ WORKDIR /workspace
COPY contracts/package.json contracts/yarn.lock contracts/
RUN cd contracts && yarn install
COPY contracts contracts/
COPY safe-smart-account safe-smart-account/
RUN cd safe-smart-account && yarn install
COPY Makefile .
RUN . ~/.bashrc && NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-solidity

Expand All @@ -43,8 +45,8 @@ FROM wasm-base AS wasm-libs-builder
# clang / lld used by soft-float wasm
RUN apt-get update && \
apt-get install -y clang=1:14.0-55.7~deb12u1 lld=1:14.0-55.7~deb12u1 wabt
# pinned rust 1.75.0
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.75.0 --target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
# pinned rust 1.80.1
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.80.1 --target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
COPY ./Makefile ./
COPY arbitrator/Cargo.* arbitrator/
COPY arbitrator/arbutil arbitrator/arbutil
Expand Down Expand Up @@ -82,6 +84,7 @@ COPY ./wavmio ./wavmio
COPY ./zeroheavy ./zeroheavy
COPY ./contracts/src/precompiles/ ./contracts/src/precompiles/
COPY ./contracts/package.json ./contracts/yarn.lock ./contracts/
COPY ./safe-smart-account ./safe-smart-account
COPY ./solgen/gen.go ./solgen/
COPY ./fastcache ./fastcache
COPY ./go-ethereum ./go-ethereum
Expand All @@ -91,7 +94,7 @@ COPY --from=contracts-builder workspace/contracts/node_modules/@offchainlabs/upg
COPY --from=contracts-builder workspace/.make/ .make/
RUN PATH="$PATH:/usr/local/go/bin" NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-wasm-bin

FROM rust:1.75-slim-bookworm AS prover-header-builder
FROM rust:1.80.1-slim-bookworm AS prover-header-builder
WORKDIR /workspace
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
Expand All @@ -100,6 +103,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
COPY arbitrator/Cargo.* arbitrator/
COPY ./Makefile ./
COPY arbitrator/arbutil arbitrator/arbutil
COPY arbitrator/bench arbitrator/bench
COPY arbitrator/brotli arbitrator/brotli
COPY arbitrator/caller-env arbitrator/caller-env
COPY arbitrator/prover arbitrator/prover
Expand All @@ -116,7 +120,7 @@ RUN NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-prover-header
FROM scratch AS prover-header-export
COPY --from=prover-header-builder /workspace/target/ /

FROM rust:1.75-slim-bookworm AS prover-builder
FROM rust:1.80.1-slim-bookworm AS prover-builder
WORKDIR /workspace
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
Expand All @@ -128,21 +132,28 @@ RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
COPY --from=brotli-library-export / target/
COPY arbitrator/Cargo.* arbitrator/
COPY arbitrator/arbutil arbitrator/arbutil
COPY arbitrator/bench arbitrator/bench
COPY arbitrator/brotli arbitrator/brotli
COPY arbitrator/caller-env arbitrator/caller-env
COPY arbitrator/prover/Cargo.toml arbitrator/prover/
COPY arbitrator/prover/benches arbitrator/prover/benches
COPY arbitrator/bench/Cargo.toml arbitrator/bench/
COPY arbitrator/jit/Cargo.toml arbitrator/jit/
COPY arbitrator/stylus/Cargo.toml arbitrator/stylus/
COPY arbitrator/tools/wasmer arbitrator/tools/wasmer
COPY arbitrator/wasm-libraries/user-host-trait/Cargo.toml arbitrator/wasm-libraries/user-host-trait/Cargo.toml
RUN bash -c 'mkdir arbitrator/{prover,jit,stylus}/src arbitrator/wasm-libraries/user-host-trait/src'
RUN echo "fn test() {}" > arbitrator/jit/src/lib.rs && \
echo "fn test() {}" > arbitrator/prover/src/lib.rs && \
echo "fn test() {}" > arbitrator/bench/src/lib.rs && \
echo "fn test() {}" > arbitrator/prover/benches/merkle_bench.rs && \
echo "fn test() {}" > arbitrator/stylus/src/lib.rs && \
echo "fn test() {}" > arbitrator/wasm-libraries/user-host-trait/src/lib.rs && \
cargo build --manifest-path arbitrator/Cargo.toml --release --lib && \
rm arbitrator/prover/src/lib.rs arbitrator/jit/src/lib.rs arbitrator/stylus/src/lib.rs && \
rm arbitrator/wasm-libraries/user-host-trait/src/lib.rs
rm arbitrator/wasm-libraries/user-host-trait/src/lib.rs && \
rm arbitrator/prover/benches/merkle_bench.rs && \
rm arbitrator/bench/src/lib.rs
COPY ./Makefile ./
COPY arbitrator/prover arbitrator/prover
COPY arbitrator/wasm-libraries arbitrator/wasm-libraries
Expand Down Expand Up @@ -179,6 +190,7 @@ COPY ./Makefile ./
COPY ./arbitrator ./arbitrator
COPY ./solgen ./solgen
COPY ./contracts ./contracts
COPY ./safe-smart-account ./safe-smart-account
RUN NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-replay-env

FROM debian:bookworm-slim AS machine-versions
Expand Down Expand Up @@ -226,6 +238,7 @@ COPY . ./
COPY --from=contracts-builder workspace/contracts/build/ contracts/build/
COPY --from=contracts-builder workspace/contracts/out/ contracts/out/
COPY --from=contracts-builder workspace/contracts/node_modules/@offchainlabs/upgrade-executor/build/contracts/src/UpgradeExecutor.sol/UpgradeExecutor.json contracts/node_modules/@offchainlabs/upgrade-executor/build/contracts/src/UpgradeExecutor.sol/
COPY --from=contracts-builder workspace/safe-smart-account/build/ safe-smart-account/build/
COPY --from=contracts-builder workspace/.make/ .make/
COPY --from=prover-header-export / target/
COPY --from=brotli-library-export / target/
Expand All @@ -250,7 +263,12 @@ COPY --from=node-builder /workspace/target/bin/nitro /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/relay /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/nitro-val /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/seq-coordinator-manager /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/prover /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/dbconv /usr/local/bin/
COPY ./scripts/convert-databases.bash /usr/local/bin/
COPY --from=machine-versions /workspace/machines /home/user/target/machines
COPY ./scripts/validate-wasm-module-root.sh .
RUN ./validate-wasm-module-root.sh /home/user/target/machines /usr/local/bin/prover
USER root
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
Expand Down
Loading

0 comments on commit 10b43ea

Please sign in to comment.