Skip to content

Commit

Permalink
feat: arbos32
Browse files Browse the repository at this point in the history
  • Loading branch information
artemmartyhin committed Oct 8, 2024
1 parent 97f7c20 commit c091825
Show file tree
Hide file tree
Showing 2,273 changed files with 556,557 additions and 1,775 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ arbitrator/prover/test-cases/**/*
arbitrator/prover/test-cases

# external tools and IDEs
.vscode
.vscode
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 2 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: "Nitro CodeQL config"

189 changes: 189 additions & 0 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Arbitrator CI
run-name: Arbitrator CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

on:
workflow_dispatch:
inputs:
enable_tmate:
type: boolean
description: 'Enable tmate'
required: false
default: false
merge_group:
pull_request:
paths:
- 'arbitrator/**'
- 'contracts'
- '.github/workflows/arbitrator-ci.yml'
- 'Makefile'
push:
branches:
- master

env:
RUST_BACKTRACE: 1
# 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:
submodules: recursive

- name: Install Ubuntu dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
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.23.x

- name: Install custom go-ethereum
run: |
cd /tmp
git clone --branch v1.14.11 --depth 1 https://github.com/ethereum/go-ethereum.git
cd go-ethereum
go build -o /usr/local/bin/geth ./cmd/geth
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
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-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:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
arbitrator/target/
arbitrator/wasm-libraries/target/
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-full-${{ hashFiles('arbitrator/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-full-
${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-
- name: Cache wabt build
id: cache-wabt
uses: actions/cache@v3
with:
path: ~/wabt-prefix
key: ${{ runner.os }}-wabt-${{ env.WABT_VERSION }}

- name: Install latest wabt
if: steps.cache-wabt.outputs.cache-hit != 'true'
run: |
cd "$(mktemp -d)"
git clone --recursive -b "$WABT_VERSION" https://github.com/WebAssembly/wabt .
mkdir build
cd build
mkdir -p ~/wabt-prefix
cmake .. -DCMAKE_INSTALL_PREFIX="$HOME/wabt-prefix"
make -j
make install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Cache cbrotli
uses: actions/cache@v3
id: cache-cbrotli
with:
path: |
target/include/brotli/
target/lib-wasm/
target/lib/libbrotlicommon-static.a
target/lib/libbrotlienc-static.a
target/lib/libbrotlidec-static.a
key: ${{ runner.os }}-brotli-3-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
restore-keys: ${{ runner.os }}-brotli-2-

- name: Build cbrotli-local
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
run: ./scripts/build-brotli.sh -l

- name: Setup emsdk
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
uses: mymindstorm/setup-emsdk@v12
with:
# Make sure to set a version number!
version: 3.1.6
# This is the name of the cache folder.
# The cache folder will be placed in the build directory,
# so make sure it doesn't conflict with anything!
actions-cache-folder: 'emsdk-cache'
no-cache: true

- name: Build cbrotli-wasm
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
run: ./scripts/build-brotli.sh -w

- name: Add wabt to path
run: echo "$HOME/wabt-prefix/bin" >> "$GITHUB_PATH"

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

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

- name: Run rust tests
run: cargo test -p arbutil -p prover -p jit -p stylus --release --manifest-path arbitrator/prover/Cargo.toml

- name: Rustfmt
run: cargo fmt -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check

- name: Rustfmt - langs/rust
run: cargo fmt --all --manifest-path arbitrator/langs/rust/Cargo.toml -- --check

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

- name: Start geth server
run: |
geth --dev --http --http.port 8545 &
sleep 2
- name: Run proof validation tests
run: |
npm install --global yarn
cd contracts
yarn install
yarn build
yarn build:forge:yul
yarn hardhat --network localhost test test/prover/*.ts
21 changes: 21 additions & 0 deletions .github/workflows/arbitrator-skip-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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/**'
- 'contracts/src/osp/**'
- 'contracts/src/mock/**'
- 'contracts/test/**'
- 'contracts/hardhat.config.ts'
- 'Makefile'

jobs:
arbitrator:
name: Run Arbitrator tests
runs-on: ubuntu-latest
steps:
- name: Do nothing
run: echo "doing nothing"
Loading

0 comments on commit c091825

Please sign in to comment.