Skip to content

Commit 9baa2ad

Browse files
Merge branch 'master' into fix-historical-feed-flood
2 parents 32d3a70 + 2037191 commit 9baa2ad

File tree

378 files changed

+6119
-6022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+6119
-6022
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: Nitro CI Setup
3+
description: Common setup for Nitro CI jobs
4+
5+
runs:
6+
using: composite
7+
8+
steps:
9+
- name: Install dependencies
10+
run: sudo apt update && sudo apt install -y wabt gotestsum
11+
shell: bash
12+
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v5
15+
with:
16+
node-version: "24"
17+
cache: yarn
18+
cache-dependency-path: "**/yarn.lock"
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v6
22+
with:
23+
go-version-file: "go.mod"
24+
25+
- name: Install wasm-ld
26+
run: |
27+
sudo apt-get update && sudo apt-get install -y lld-14
28+
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
29+
shell: bash
30+
31+
- name: Install rust
32+
id: install-rust
33+
uses: ./.github/actions/install-rust
34+
35+
- name: Setup Foundry
36+
uses: foundry-rs/foundry-toolchain@v1
37+
with:
38+
cache: false
39+
version: v1.0.0
40+
41+
- name: Install cbindgen
42+
run: cargo install --force cbindgen
43+
shell: bash
44+
45+
- name: Cache Go build
46+
uses: actions/cache@v4
47+
with:
48+
path: ~/.cache/go-build
49+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
50+
51+
- name: Cache Rust build
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
~/.cargo/
56+
arbitrator/target/
57+
arbitrator/wasm-libraries/target/
58+
arbitrator/wasm-libraries/soft-float/
59+
target/etc/initial-machine-cache/
60+
/home/runner/.rustup/toolchains/
61+
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.version }}-${{ hashFiles('arbitrator/Cargo.lock') }}
62+
63+
- name: Cache cbrotli
64+
id: cache-cbrotli
65+
uses: actions/cache@v4
66+
with:
67+
path: |
68+
target/include/brotli/
69+
target/lib-wasm/
70+
target/lib/libbrotlicommon-static.a
71+
target/lib/libbrotlienc-static.a
72+
target/lib/libbrotlidec-static.a
73+
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}
74+
75+
- name: Build cbrotli-local
76+
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
77+
run: ./scripts/build-brotli.sh -l
78+
shell: bash
79+
80+
- name: Build cbrotli-wasm in docker
81+
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
82+
run: ./scripts/build-brotli.sh -w -d
83+
shell: bash

.github/actions/gomodtidy/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'Go mod tidy checker'
23
description: 'Checks that `go mod tidy` has been applied.'
34
runs:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: 'Install stable Rust'
3+
description: 'Installs stable Rust toolchain with appropriate targets and components.'
4+
5+
inputs:
6+
toolchain:
7+
required: true
8+
description: 'Toolchain to install'
9+
default: '1.88.0'
10+
targets:
11+
required: true
12+
description: 'Compilation targets to install'
13+
default: 'wasm32-wasip1, wasm32-unknown-unknown'
14+
components:
15+
required: true
16+
description: 'Cargo components to include'
17+
default: 'llvm-tools-preview, rustfmt, clippy'
18+
19+
outputs:
20+
version:
21+
description: 'The installed Rust version'
22+
value: ${{ steps.get-version.outputs.version }}
23+
24+
runs:
25+
using: composite
26+
27+
steps:
28+
- name: Install Rust stable
29+
id: install-rust
30+
uses: dtolnay/rust-toolchain@stable
31+
with:
32+
toolchain: ${{ inputs.toolchain }}
33+
targets: ${{ inputs.targets }}
34+
components: ${{ inputs.components }}
35+
36+
- name: Get Rust version
37+
id: get-version
38+
shell: bash
39+
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT

.github/buildspec.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: 0.2
23

34
env:
@@ -7,32 +8,42 @@ env:
78
phases:
89
pre_build:
910
commands:
10-
- git submodule update --init
11+
- git submodule update --init --recursive
1112
- echo Logging in to Dockerhub....
1213
- docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
1314
- aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin $REPOSITORY_URI
1415
- COMMIT_HASH=$(git rev-parse --short=7 HEAD || echo "latest")
15-
- VERSION_TAG=$(git tag --points-at HEAD | sed '/-/!s/$/_/' | sort -rV | sed 's/_$//' | head -n 1 | grep ^ || git show -s --pretty=%D | sed 's/, /\n/g' | grep -v '^origin/' |grep -v '^grafted\|HEAD\|master\|main$' || echo "dev")
16+
- >-
17+
VERSION_TAG=$(git tag --points-at HEAD | sed '/-/!s/$/_/' | sort -rV |
18+
sed 's/_$//' | head -n 1 | grep ^ || git show -s --pretty=%D | sed 's/, /\n/g' |
19+
grep -v '^origin/' |grep -v '^grafted\|HEAD\|master\|main$' || echo "dev")
1620
- NITRO_VERSION=${VERSION_TAG}-${COMMIT_HASH}
1721
- IMAGE_TAG=${NITRO_VERSION}
1822
- NITRO_DATETIME=$(git show -s --date=iso-strict --format=%cd)
1923
- NITRO_MODIFIED="false"
2024
- echo ${NITRO_VERSION} > ./.nitro-tag.txt
25+
- >-
26+
BUILD_ARGS="--build-arg version=$NITRO_VERSION
27+
--build-arg datetime=$NITRO_DATETIME
28+
--build-arg modified=$NITRO_MODIFIED"
2129
build:
2230
commands:
23-
- echo Build started on `date`
31+
- echo Build started on `date`
2432
- echo Building the Docker image ${NITRO_VERSION}...
25-
- DOCKER_BUILDKIT=1 docker build . -t nitro-node-slim --target nitro-node-slim --build-arg version=$NITRO_VERSION --build-arg datetime=$NITRO_DATETIME --build-arg modified=$NITRO_MODIFIED
26-
- DOCKER_BUILDKIT=1 docker build . -t nitro-node --target nitro-node --build-arg version=$NITRO_VERSION --build-arg datetime=$NITRO_DATETIME --build-arg modified=$NITRO_MODIFIED
27-
- DOCKER_BUILDKIT=1 docker build . -t nitro-node-dev --target nitro-node-dev --build-arg version=$NITRO_VERSION --build-arg datetime=$NITRO_DATETIME --build-arg modified=$NITRO_MODIFIED
28-
- DOCKER_BUILDKIT=1 docker build . -t nitro-node-validator --target nitro-node-validator --build-arg version=$NITRO_VERSION --build-arg datetime=$NITRO_DATETIME --build-arg modified=$NITRO_MODIFIED
33+
- >-
34+
DOCKER_BUILDKIT=1 docker build . --tag nitro-node-slim --target nitro-node-slim $BUILD_ARGS
35+
- >-
36+
DOCKER_BUILDKIT=1 docker build . --tag nitro-node --target nitro-node $BUILD_ARGS
37+
- >-
38+
DOCKER_BUILDKIT=1 docker build . --tag nitro-node-dev --target nitro-node-dev $BUILD_ARGS
39+
- DOCKER_BUILDKIT=1 docker build . --tag nitro-node-validator --target nitro-node-validator $BUILD_ARGS
2940
- docker tag nitro-node:latest $REPOSITORY_URI:$IMAGE_TAG-$ARCH_TAG
3041
- docker tag nitro-node-slim:latest $REPOSITORY_URI:$IMAGE_TAG-slim-$ARCH_TAG
3142
- docker tag nitro-node-dev:latest $REPOSITORY_URI:$IMAGE_TAG-dev-$ARCH_TAG
3243
- docker tag nitro-node-validator:latest $REPOSITORY_URI:$IMAGE_TAG-validator-$ARCH_TAG
33-
post_build:
44+
post_build:
3445
commands:
35-
- echo Build completed on `date`
46+
- echo Build completed on `date`
3647
- echo pushing to repo
3748
- docker push $REPOSITORY_URI:$IMAGE_TAG-$ARCH_TAG
3849
- docker push $REPOSITORY_URI:$IMAGE_TAG-slim-$ARCH_TAG

.github/codeql/codeql-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1+
---
12
name: "Nitro CodeQL config"
2-

.github/manifest-buildspec.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
---
12
version: 0.2
23

34
phases:
45
pre_build:
56
commands:
67
- COMMIT_HASH=$(git rev-parse --short=7 HEAD || echo "latest")
7-
- VERSION_TAG=$(git tag --points-at HEAD | sed '/-/!s/$/_/' | sort -rV | sed 's/_$//' | head -n 1 | grep ^ || git show -s --pretty=%D | sed 's/, /\n/g' | grep -v '^origin/' |grep -v '^grafted\|HEAD\|master\|main$' || echo "dev")
8+
- >-
9+
VERSION_TAG=$(git tag --points-at HEAD | sed '/-/!s/$/_/' | sort -rV |
10+
sed 's/_$//' | head -n 1 | grep ^ || git show -s --pretty=%D | sed 's/, /\n/g' |
11+
grep -v '^origin/' |grep -v '^grafted\|HEAD\|master\|main$' || echo "dev")
812
- NITRO_VERSION=${VERSION_TAG}-${COMMIT_HASH}
913
- IMAGE_TAG=${NITRO_VERSION}
1014

1115
# Log IMAGE_TAG environment variable
1216
- echo "Using IMAGE_TAG environment variable $IMAGE_TAG"
1317

1418
# Login to ECR
15-
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $REPOSITORY_URI
19+
- >-
20+
aws ecr get-login-password --region $AWS_DEFAULT_REGION |
21+
docker login --username AWS --password-stdin $REPOSITORY_URI
1622
# Login to DockerHub if credentials provided
1723
- |
1824
if [ -n "$DOCKERHUB_USERNAME" ] && [ -n "$DOCKERHUB_PASSWORD" ]; then
@@ -33,25 +39,37 @@ phases:
3339
build:
3440
commands:
3541
# Regular node image
36-
- docker manifest create $REPOSITORY_URI:$IMAGE_TAG $REPOSITORY_URI:$IMAGE_TAG-amd64 $REPOSITORY_URI:$IMAGE_TAG-arm64
42+
- >-
43+
docker manifest create $REPOSITORY_URI:$IMAGE_TAG $REPOSITORY_URI:$IMAGE_TAG-amd64
44+
$REPOSITORY_URI:$IMAGE_TAG-arm64
3745
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG $REPOSITORY_URI:$IMAGE_TAG-amd64 --arch amd64
3846
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG $REPOSITORY_URI:$IMAGE_TAG-arm64 --arch arm64
3947
- docker manifest push $REPOSITORY_URI:$IMAGE_TAG
4048

4149
# Slim variant
42-
- docker manifest create $REPOSITORY_URI:$IMAGE_TAG-slim $REPOSITORY_URI:$IMAGE_TAG-slim-amd64 $REPOSITORY_URI:$IMAGE_TAG-slim-arm64
50+
- >-
51+
docker manifest create $REPOSITORY_URI:$IMAGE_TAG-slim $REPOSITORY_URI:$IMAGE_TAG-slim-amd64
52+
$REPOSITORY_URI:$IMAGE_TAG-slim-arm64
4353
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-slim $REPOSITORY_URI:$IMAGE_TAG-slim-amd64 --arch amd64
4454
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-slim $REPOSITORY_URI:$IMAGE_TAG-slim-arm64 --arch arm64
4555
- docker manifest push $REPOSITORY_URI:$IMAGE_TAG-slim
4656

4757
# Dev variant
48-
- docker manifest create $REPOSITORY_URI:$IMAGE_TAG-dev $REPOSITORY_URI:$IMAGE_TAG-dev-amd64 $REPOSITORY_URI:$IMAGE_TAG-dev-arm64
58+
- >-
59+
docker manifest create $REPOSITORY_URI:$IMAGE_TAG-dev $REPOSITORY_URI:$IMAGE_TAG-dev-amd64
60+
$REPOSITORY_URI:$IMAGE_TAG-dev-arm64
4961
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-dev $REPOSITORY_URI:$IMAGE_TAG-dev-amd64 --arch amd64
5062
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-dev $REPOSITORY_URI:$IMAGE_TAG-dev-arm64 --arch arm64
5163
- docker manifest push $REPOSITORY_URI:$IMAGE_TAG-dev
5264

5365
# Validator variant
54-
- docker manifest create $REPOSITORY_URI:$IMAGE_TAG-validator $REPOSITORY_URI:$IMAGE_TAG-validator-amd64 $REPOSITORY_URI:$IMAGE_TAG-validator-arm64
55-
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-validator $REPOSITORY_URI:$IMAGE_TAG-validator-amd64 --arch amd64
56-
- docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-validator $REPOSITORY_URI:$IMAGE_TAG-validator-arm64 --arch arm64
66+
- >-
67+
docker manifest create $REPOSITORY_URI:$IMAGE_TAG-validator $REPOSITORY_URI:$IMAGE_TAG-validator-amd64
68+
$REPOSITORY_URI:$IMAGE_TAG-validator-arm64
69+
- >-
70+
docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-validator
71+
$REPOSITORY_URI:$IMAGE_TAG-validator-amd64 --arch amd64
72+
- >-
73+
docker manifest annotate $REPOSITORY_URI:$IMAGE_TAG-validator
74+
$REPOSITORY_URI:$IMAGE_TAG-validator-arm64 --arch arm64
5775
- docker manifest push $REPOSITORY_URI:$IMAGE_TAG-validator

.github/workflows/_arbitrator.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: nitro-arbitrator
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
arbitrator:
8+
name: Run Arbitrator tests
9+
runs-on: arbitrator-ci
10+
env:
11+
RUST_BACKTRACE: 1
12+
# RUSTFLAGS: -Dwarnings # TODO: re-enable after wasmer upgrade
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
with:
18+
submodules: recursive
19+
20+
- name: Setup CI
21+
uses: ./.github/actions/ci-setup
22+
23+
- name: Install custom go-ethereum
24+
run: |
25+
cd /tmp
26+
git clone --branch v1.16.2 --depth 1 https://github.com/ethereum/go-ethereum.git
27+
cd go-ethereum
28+
go build -o /usr/local/bin/geth ./cmd/geth
29+
30+
- name: Setup emsdk
31+
uses: mymindstorm/setup-emsdk@v14
32+
with:
33+
# Make sure to set a version number!
34+
version: 3.1.6
35+
# This is the name of the cache folder.
36+
# The cache folder will be placed in the build directory,
37+
# so make sure it doesn't conflict with anything!
38+
no-cache: true
39+
40+
- name: Make arbitrator libraries
41+
run: make -j wasm-ci-build
42+
43+
- name: Clippy check
44+
run: cargo clippy --all --manifest-path arbitrator/Cargo.toml -- -D warnings
45+
46+
- name: Run rust tests
47+
run: cargo test -p arbutil -p prover -p jit -p stylus --release --manifest-path arbitrator/prover/Cargo.toml
48+
49+
- name: Check stylus_bechmark
50+
run: cargo check --manifest-path arbitrator/tools/stylus_benchmark/Cargo.toml
51+
52+
- name: Rustfmt
53+
run: cargo fmt -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check
54+
55+
- name: Rustfmt - tools/stylus_benchmark
56+
run: cargo fmt --all --manifest-path arbitrator/tools/stylus_benchmark/Cargo.toml -- --check
57+
58+
- name: Make proofs from test cases
59+
run: make -j test-gen-proofs
60+
61+
- name: Start geth server
62+
run: |
63+
geth --dev --http --http.port 8545 &
64+
sleep 2
65+
66+
- name: Run proof validation tests
67+
run: |
68+
npm install --global yarn
69+
cd contracts-legacy
70+
cp -r ../contracts/test/prover/proofs/* ./test/prover/proofs
71+
yarn install
72+
yarn build
73+
yarn build:forge:yul
74+
yarn hardhat --network localhost test test/prover/*.ts

.github/workflows/_bold-legacy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: bold-legacy
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
bold-legacy:
8+
name: Run Bold Legacy challenge tests
9+
runs-on: arbitrator-ci
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v5
13+
with:
14+
submodules: recursive
15+
16+
17+
- name: Setup CI
18+
uses: ./.github/actions/ci-setup
19+
20+
- name: run challenge tests
21+
run: >-
22+
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags legacychallengetest
23+
--run TestChallenge --timeout 60m --cover
24+
25+
- name: Archive detailed run log
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: full.log
29+
path: full.log
30+
31+
- name: Upload coverage to Codecov
32+
uses: codecov/codecov-action@v5
33+
with:
34+
fail_ci_if_error: false
35+
files: ./coverage.txt,./coverage-redis.txt
36+
verbose: false
37+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)