Skip to content

Commit

Permalink
Merge branch 'master' into improve-blocks-reexecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli authored May 7, 2024
2 parents cee7d1f + 5c06be7 commit 5613359
Show file tree
Hide file tree
Showing 421 changed files with 41,392 additions and 7,250 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@ brotli/buildfiles/**/*
nitro-testnode/**/*

# Arbitrator ignores
arbitrator/tools/module_roots
arbitrator/tools/pricer

# Rust outputs
arbitrator/target/**/*
arbitrator/target
arbitrator/stylus/tests/*/target/
arbitrator/wasm-testsuite/target/
arbitrator/wasm-libraries/target/
arbitrator/tools/wasmer/target/
arbitrator/tools/wasm-tools/
arbitrator/tools/pricers/
arbitrator/tools/module_roots/
arbitrator/langs/rust/target/
arbitrator/langs/bf/target/

# Compiled files
**/*.o
Expand Down
42 changes: 37 additions & 5 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ run-name: Arbitrator CI triggered from @${{ github.actor }} of ${{ github.head_r

on:
workflow_dispatch:
inputs:
enable_tmate:
type: boolean
description: 'Enable tmate'
required: false
default: false
merge_group:
pull_request:
paths:
Expand All @@ -16,14 +22,20 @@ on:

env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
# RUSTFLAGS: -Dwarnings # TODO: re-enable after wasmer upgrade
WABT_VERSION: 1.0.32

jobs:
arbitrator:
name: Run Arbitrator tests
runs-on: ubuntu-8
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.enable_tmate }}
with:
detached: true

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -38,7 +50,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Install custom go-ethereum
run: |
Expand All @@ -59,8 +71,16 @@ jobs:
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.75"
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"
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 @@ -136,16 +156,28 @@ 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
run: cargo test --all --manifest-path arbitrator/Cargo.toml
uses: actions-rs/cargo@v1
with:
command: test
args: -p arbutil -p prover -p jit -p stylus --release --manifest-path arbitrator/prover/Cargo.toml

- name: Rustfmt
run: cargo fmt --all --manifest-path arbitrator/Cargo.toml -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -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

- name: Make proofs from test cases
run: make -j test-gen-proofs
Expand Down
41 changes: 34 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-mode: [defaults, race, challenge]
test-mode: [defaults, race, challenge, stylus]

steps:
- name: Checkout
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Install wasm-ld
run: |
Expand All @@ -61,6 +61,21 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install rust nightly
uses: actions-rs/toolchain@v1
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
- name: Cache Build Products
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -130,23 +145,35 @@ jobs:
if: matrix.test-mode == 'defaults'
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -timeout 20m
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: |
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- -race -timeout 30m
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'
run: TEST_REDIS=redis://localhost:6379/0 gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./...

- name: run challenge tests
if: matrix.test-mode == 'challenge'
run: |
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")
- name: run stylus tests
if: matrix.test-mode == 'stylus'
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=challengetest -run=TestChallenge
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=stylustest -run=TestProgramArbitrator > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")
- name: Archive detailed run log
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.test-mode }}-full.log
path: full.log

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
with:
submodules: true

- name: Install dependencies
run: sudo apt update && sudo apt install -y wabt

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand All @@ -70,7 +73,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ target/
yarn-error.log
local/
system_tests/test-data/*
.configs/
system_tests/testdata/*
arbos/testdata/*
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
[submodule "arbitrator/wasm-testsuite/testsuite"]
path = arbitrator/wasm-testsuite/testsuite
url = https://github.com/WebAssembly/testsuite.git
[submodule "arbitrator/tools/wasmer"]
path = arbitrator/tools/wasmer
url = https://github.com/OffchainLabs/wasmer.git
[submodule "nitro-testnode"]
path = nitro-testnode
url = https://github.com/OffchainLabs/nitro-testnode.git
[submodule "arbitrator/langs/rust"]
path = arbitrator/langs/rust
url = https://github.com/OffchainLabs/stylus-sdk-rs.git
[submodule "arbitrator/langs/c"]
path = arbitrator/langs/c
url = https://github.com/OffchainLabs/stylus-sdk-c.git
[submodule "arbitrator/langs/bf"]
path = arbitrator/langs/bf
url = https://github.com/OffchainLabs/stylus-sdk-bf.git
Loading

0 comments on commit 5613359

Please sign in to comment.