Skip to content

Commit

Permalink
Merge branch 'execution-service-5' into execution-service-6
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Nov 14, 2023
2 parents 6ac2544 + 0507e12 commit 52ce48d
Show file tree
Hide file tree
Showing 254 changed files with 11,482 additions and 4,113 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
43 changes: 15 additions & 28 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run-name: Arbitrator CI triggered from @${{ github.actor }} of ${{ github.head_r

on:
workflow_dispatch:
merge_group:
pull_request:
paths:
- 'arbitrator/**'
Expand All @@ -24,7 +25,7 @@ jobs:
runs-on: ubuntu-8
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -36,35 +37,30 @@ jobs:
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
- name: Install go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.20.x

- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
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: "stable"
override: true
components: 'llvm-tools-preview, rustfmt, clippy'
targets: 'wasm32-wasi, wasm32-unknown-unknown'

- name: Install grcov
uses: actions-rs/install@v0.1
uses: jaxxstorm/action-install[email protected]
with:
crate: grcov
version: latest
use-tool-cache: true

- name: Install rust wasm targets
run: rustup target add wasm32-wasi wasm32-unknown-unknown
repo: mozilla/grcov
tag: v0.8.18
extension: "\\.bz2"
cache: enable

- name: Cache Rust intermediate build products
uses: actions/cache@v3
Expand Down Expand Up @@ -119,7 +115,7 @@ jobs:

- name: Setup emsdk
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
uses: mymindstorm/setup-emsdk@v11
uses: mymindstorm/setup-emsdk@v12
with:
# Make sure to set a version number!
version: 3.1.6
Expand Down Expand Up @@ -147,22 +143,13 @@ jobs:
echo RUSTDOCFLAGS="-Cpanic=abort" >> $GITHUB_ENV
- name: Clippy check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --manifest-path arbitrator/Cargo.toml -- -D warnings
run: cargo clippy --all --manifest-path arbitrator/Cargo.toml -- -D warnings

- name: Run rust tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --manifest-path arbitrator/Cargo.toml
run: cargo test --all --manifest-path arbitrator/Cargo.toml

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

- name: Make proofs from test cases
run: make -j test-gen-proofs
Expand Down
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
39 changes: 13 additions & 26 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,22 +29,22 @@ jobs:

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

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

- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.20.x

Expand All @@ -52,27 +53,10 @@ jobs:
sudo apt-get update && sudo apt-get install -y lld-14
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
- name: Install rust wasm32-unknown-unknown
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "stable"
target: wasm32-unknown-unknown

- name: Install rust wasm32-wasi
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "stable"
target: wasm32-wasi

- 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: Cache Build Products
uses: actions/cache@v3
Expand Down Expand Up @@ -124,16 +108,19 @@ 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 ./linter/koanf ./...
go run ./linter/pointercheck ./...
- name: Set environment variables
run: |
mkdir -p target/tmp
echo "TMPDIR=$(pwd)/target/tmp" >> "$GITHUB_ENV"
mkdir -p target/tmp/deadbeefbee
echo "TMPDIR=$(pwd)/target/tmp/deadbeefbee" >> "$GITHUB_ENV"
echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV"
echo "GOGC=80" >> "$GITHUB_ENV"
Expand Down
17 changes: 7 additions & 10 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 @@ -23,13 +25,13 @@ on:
jobs:
analyze:
name: Analyze
if: github.repository == 'OffchainLabs/nitro' # don't run in any forks without "Advanced Security" enabled
runs-on: ubuntu-8
permissions:
actions: read
contents: read
security-events: write
env:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'on'
WABT_VERSION: 1.0.32

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

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

Expand All @@ -59,24 +61,19 @@ jobs:
config-file: ./.github/codeql/codeql-config.yml

- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.20.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: Cache Rust Build Products
uses: actions/cache@v3
Expand Down
22 changes: 17 additions & 5 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,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
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 @@ -39,7 +40,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 @@ -49,7 +50,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 @@ -58,14 +59,25 @@ 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: |
# Unfortunately, `docker cp` seems to always result in a "permission denied"
# We work around this by piping a tarball through stdout
docker run --rm --entrypoint tar localhost:5000/nitro-node-dev:latest -cf - target/machines/latest | tar xf -
module_root="$(cat "target/machines/latest/module-root.txt")"
echo "::set-output name=module-root::$module_root"
echo "name=module-root=$module_root" >> $GITHUB_STATE
echo -e "\x1b[1;34mWAVM module root:\x1b[0m $module_root"
- name: Upload WAVM machine as artifact
Expand Down
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ solgen/go/
target/
yarn-error.log
local/
testdata
system_tests/test-data/*
system_tests/testdata/*
arbos/testdata/*
Loading

0 comments on commit 52ce48d

Please sign in to comment.