Skip to content

Commit

Permalink
Merge pull request #211 from OffchainLabs/nitro-2.2.5-merge
Browse files Browse the repository at this point in the history
Nitro 2.2.5 merge
  • Loading branch information
rachel-bousfield authored Apr 3, 2024
2 parents 92d0c23 + 132234f commit efbf8ea
Show file tree
Hide file tree
Showing 301 changed files with 24,581 additions and 7,417 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ solgen/go
**/node_modules

target/**/*
!target/machines
!target/machines/*
!target/machines/**/*
brotli/buildfiles/**/*

# these are used by environment outside the docker:
Expand Down
50 changes: 28 additions & 22 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
description: 'Enable tmate'
required: false
default: false
merge_group:
pull_request:
paths:
- 'arbitrator/**'
Expand Down Expand Up @@ -36,23 +37,31 @@ jobs:
detached: true

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_CHECKOUT }}
submodules: recursive

- name: Install Ubuntu dependencies
run: |
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update && sudo apt-get install -y \
build-essential cmake ethereum lld-14 libudev-dev
build-essential cmake lld-14 libudev-dev
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Install custom go-ethereum
run: |
cd /tmp
git clone --branch v1.13.8 --depth 1 https://github.com/ethereum/go-ethereum.git
cd go-ethereum
# Enable KZG point evaluation precompile early
sed -i 's#var PrecompiledContractsBerlin = map\[common.Address\]PrecompiledContract{#\0 common.BytesToAddress([]byte{0x0a}): \&kzgPointEvaluation{},#g' core/vm/contracts.go
go build -o /usr/local/bin/geth ./cmd/geth
- name: Setup nodejs
uses: actions/setup-node@v3
with:
Expand All @@ -61,28 +70,18 @@ jobs:
cache-dependency-path: '**/yarn.lock'

- name: Install rust stable
uses: actions-rs/toolchain@v1
id: install-rust
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: "1.75"
override: true
components: 'llvm-tools-preview, rustfmt'
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"

- name: Install rust wasm targets
run: rustup target add wasm32-wasi wasm32-unknown-unknown

- name: Install nightly wasm targets
run: |
rustup component add rust-src --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
toolchain: "nightly-2024-02-04"
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'rust-src, rustfmt, clippy'

- name: Cache Rust intermediate build products
uses: actions/cache@v3
Expand Down Expand Up @@ -118,6 +117,9 @@ jobs:
make -j
make install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Cache cbrotli
uses: actions/cache@v3
id: cache-cbrotli
Expand Down Expand Up @@ -155,7 +157,10 @@ jobs:
run: echo "$HOME/wabt-prefix/bin" >> "$GITHUB_PATH"

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

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

- name: Run rust tests
uses: actions-rs/cargo@v1
Expand All @@ -169,14 +174,14 @@ jobs:
command: fmt
args: -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check

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

- name: Make proofs from test cases
run: make -j8 test-gen-proofs
run: make -j test-gen-proofs

- name: Start geth server
run: |
Expand All @@ -189,4 +194,5 @@ jobs:
cd contracts
yarn install
yarn build
yarn build:forge:yul
yarn hardhat --network localhost test test/prover/*.ts
1 change: 1 addition & 0 deletions .github/workflows/arbitrator-skip-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Arbitrator skip CI
run-name: Arbitrator skip CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

on:
merge_group:
pull_request:
paths-ignore:
- 'arbitrator/**'
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run-name: Go tests CI triggered from @${{ github.actor }} of ${{ github.head_ref

on:
workflow_dispatch:
merge_group:
pull_request:
push:
branches:
Expand All @@ -28,7 +29,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_CHECKOUT }}
submodules: true
Expand All @@ -54,12 +55,12 @@ jobs:
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
- name: Install rust stable
uses: actions-rs/toolchain@v1
id: install-rust
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: "stable"
override: true
targets: 'wasm32-unknown-unknown, wasm32-wasi'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install rust nightly
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -126,11 +127,13 @@ jobs:
run: make -j build-node-deps

- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-go-installation: true
skip-pkg-cache: true
- name: Custom Lint
run: |
go run ./linters ./...
- name: Set environment variables
run: |
Expand All @@ -143,13 +146,13 @@ jobs:
if: matrix.test-mode == 'defaults'
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 > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
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
if: matrix.test-mode == 'race'
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -race -parallel=8 > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
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")
- name: run redis tests
if: matrix.test-mode == 'defaults'
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ name: "CodeQL"
on:
push:
branches: [ "master" ]
merge_group:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
Expand All @@ -30,7 +32,6 @@ jobs:
contents: read
security-events: write
env:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'on'
WABT_VERSION: 1.0.32

strategy:
Expand All @@ -42,7 +43,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_CHECKOUT }}
submodules: true
Expand Down Expand Up @@ -73,12 +74,10 @@ jobs:
go-version: 1.21.x

- name: Install rust stable
uses: actions-rs/toolchain@v1
id: install-rust
with:
profile: minimal
toolchain: "stable"
override: true
uses: dtolnay/rust-toolchain@stable

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Cache Rust Build Products
uses: actions/cache@v3
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run-name: Docker build CI triggered from @${{ github.actor }} of ${{ github.head

on:
workflow_dispatch:
merge_group:
pull_request:
push:
branches:
Expand All @@ -22,13 +23,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_CHECKOUT }}
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host

Expand All @@ -40,7 +41,7 @@ jobs:
restore-keys: ${{ runner.os }}-buildx-

- name: Build nitro-node docker
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
target: nitro-node
push: true
Expand All @@ -50,7 +51,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Build nitro-node-dev docker
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
target: nitro-node-dev
push: true
Expand All @@ -59,6 +60,17 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Start background nitro-testnode
shell: bash
run: |
cd nitro-testnode
./test-node.bash --init --dev &
- name: Wait for rpc to come up
shell: bash
run: |
${{ github.workspace }}/.github/workflows/waitForNitro.sh
- name: Print WAVM module root
id: module-root
run: |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release CI
run-name: Release CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

on:
workflow_dispatch:

jobs:
build_and_run:
runs-on: ubuntu-8

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: ${{ runner.os }}-buildx-

- name: Startup Nitro testnode
run: ./scripts/startup-testnode.bash
13 changes: 13 additions & 0 deletions .github/workflows/waitForNitro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# poll the nitro endpoint until we get a 0 return code or 30mins have passed, in that case exit 1
timeout_time=$(($(date +%s) + 1800))

while (( $(date +%s) <= timeout_time )); do
if curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' 'http://localhost:8547'; then
exit 0
else
sleep 20
fi
done

exit 1
Loading

0 comments on commit efbf8ea

Please sign in to comment.