Skip to content

Commit

Permalink
pull in changes, this is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Jul 8, 2024
1 parent 21651dc commit 62115da
Show file tree
Hide file tree
Showing 531 changed files with 49,133 additions and 9,325 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
52 changes: 41 additions & 11 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: linux-2xl
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 @@ -40,7 +52,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 @@ -61,8 +73,16 @@ jobs:
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.76"
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 @@ -138,18 +158,28 @@ jobs:
run: echo "$HOME/wabt-prefix/bin" >> "$GITHUB_PATH"

- name: Make arbitrator libraries
run: make -j wasm-ci-build

# TODO: Enable clippy check
# - name: Clippy check
# run: cargo clippy --all --manifest-path arbitrator/Cargo.toml -- -D warnings
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 --exclude rust-kzg-bn254 --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
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check

# TODO: Enable rustfmt check
# - name: Rustfmt
# run: cargo fmt --all --exclude rust-kzg-bn254 --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
47 changes: 40 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, long]

steps:
- name: Checkout
Expand All @@ -47,7 +47,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 @@ -62,6 +62,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 @@ -131,23 +146,41 @@ 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 ./...`
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=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 ./...`
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")
- 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")
- 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 @@ -48,6 +48,9 @@ jobs:
submodules: true
ssh-key: ${{ secrets.SSH_KEY }}

- 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 @@ -71,7 +74,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
20 changes: 20 additions & 0 deletions .github/workflows/merge-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Merge Checks

on:
pull_request:
branches: [ master ]
types: [synchronize, opened, reopened, labeled, unlabeled]

jobs:
design-approved-check:
if: ${{ !contains(github.event.*.labels.*.name, 'design-approved') }}
name: Design Approved Check
runs-on: ubuntu-latest
steps:
- name: Check for design-approved label
run: |
echo "Pull request is missing the 'design-approved' label"
echo "This workflow fails so that the pull request cannot be merged"
exit 1
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/*
14 changes: 13 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,16 @@
[submodule "arbitrator/rust-kzg-bn254"]
path = arbitrator/rust-kzg-bn254
url = https://github.com/Layr-Labs/rust-kzg-bn254.git
branch = epociask--better-linting
branch = epociask--better-linting
[submodule "arbitrator/tools/wasmer"]
path = arbitrator/tools/wasmer
url = https://github.com/OffchainLabs/wasmer.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
7 changes: 3 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# golangci-lint configuration

run:
skip-dirs:
- go-ethereum
- fastcache

timeout: 10m

issues:
exclude-dirs:
- go-ethereum
- fastcache
exclude-rules:
- path: _test\.go
linters:
Expand Down
Loading

0 comments on commit 62115da

Please sign in to comment.