Skip to content

Nightly - ETH Bench #213

Nightly - ETH Bench

Nightly - ETH Bench #213

name: Nightly - ETH Bench
on:
schedule:
- cron: '0 2 * * *' # run at 2am to stagger tests (take around 15m to pass)
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- profile_name: "network8"
l1_ep: "https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/sepolia"
l2_ep: "http://34.175.214.161:18124"
bridge_ep: "http://34.175.214.161:18080"
l1_pk_secret_name: "L1_SEPOLIA_FUNDED_PRIVATE_KEY"
l2_pk_secret_name: "NETWORK5_PRIVATE_KEY_0X126"
bridge_addr: "0x27DAeD0badd500740762d1792F3277a7F3DAdd79"
steps:
- name: Checkout current repository
uses: actions/checkout@v3
- name: Clone eth-bench repository
run: git clone --recurse-submodules -j8 https://github.com/xavier-romero/eth-bench.git
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and run benchmarks
run: |
#!/bin/bash
cd eth-bench
cat <<EOF > ./tmp_profiles.json
{
"profiles": {
"${{ matrix.profile_name }}": {
"description": "Nightly Tests",
"node_url": "${{ matrix.l2_ep }}",
"l1_ep": "${{ matrix.l1_ep }}",
"bridge_addr": "${{ matrix.bridge_addr }}",
"bridge_ep": "${{ matrix.bridge_ep }}",
"funded_key": "${{ secrets[matrix.l2_pk_secret_name] }}",
"l1_funded_key": "${{ secrets[matrix.l1_pk_secret_name] }}"
}
}
}
EOF
export PROFILE=${{ matrix.profile_name }}
docker build . -t eth-bench-temp-${{ matrix.profile_name }}
docker run --rm \
--volume "$(pwd):/app" \
--volume "$(pwd)/profiles.json:/app/profiles.json" \
--volume "$(pwd)/logs:/app/logs" \
--env PYTHONUNBUFFERED=1 \
--env PROFILE=${PROFILE} \
--workdir /app \
eth-bench-temp-${{ matrix.profile_name}} \
python bench.py -p "$PROFILE" -c 5 -t 12 --confirmed --allconfirmed --unconfirmed --erc20 --uniswap --precompileds --pairings --eventminter --recover
docker run --rm \
--volume "$(pwd):/app" \
--volume "$(pwd)/profiles.json:/app/profiles.json" \
--volume "$(pwd)/logs:/app/logs" \
--env PYTHONUNBUFFERED=1 \
--env PROFILE=${PROFILE} \
--workdir /app \
eth-bench-temp-${{ matrix.profile_name}} \
python bench.py -p "$PROFILE" --bridge2l2
docker run --rm \
--volume "$(pwd):/app" \
--volume "$(pwd)/profiles.json:/app/profiles.json" \
--volume "$(pwd)/logs:/app/logs" \
--env PYTHONUNBUFFERED=1 \
--env PROFILE=${PROFILE} \
--workdir /app \
eth-bench-temp-${{ matrix.profile_name}} \
python bench.py -p "$PROFILE" --bridge2l1
EXIT_CODE=$?
echo "Benchmark exit code for profile ${PROFILE}: $EXIT_CODE"
exit $EXIT_CODE
- name: Upload benchmark log
if: always()
uses: actions/upload-artifact@v3
with:
name: benchmark-log-${{ matrix.profile_name }}
path: ./eth-bench/bench_${{ matrix.profile_name }}.log