From 39d9e3db656a488b1e65aa9d3ff75c990c11d71d Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 14 Aug 2024 20:50:51 -0400 Subject: [PATCH 01/19] Smoke test for nitro testnode --- .github/workflows/ci.yml | 5 +- .github/workflows/smoke-test-node.bash | 46 ++++++ smoke-test-node.bash | 210 +++++++++++++++++++++++++ 3 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/smoke-test-node.bash create mode 100755 smoke-test-node.bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a78e451c..95abd251 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,9 @@ jobs: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- - + - name: Startup Nitro testnode run: ${{ github.workspace }}/.github/workflows/testnode.bash + + - name: Start smoke test + run: ${{ github.workspace }}/.github/workflows/smoke-test-node.bash diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash new file mode 100644 index 00000000..72eb9b1b --- /dev/null +++ b/.github/workflows/smoke-test-node.bash @@ -0,0 +1,46 @@ +#!/bin/bash +# The script starts up the test node and waits until the timeout (10min) or +# until send-l2 succeeds. + +# Start the test node and get PID, to terminate it once send-l2 is done. +cd ${GITHUB_WORKSPACE} + +./snoke-test-node.bash --init --detach + +START=$(date +%s) +L2_TRANSACTION_SUCCEEDED=false +L3_TRANSACTION_SUCCEEDED=false +SUCCEEDED=false + +while true; do +if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then +if ${GITHUB_WORKSPACE}/snoke-test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then +echo "Sending l2 transaction succeeded" +L2_TRANSACTION_SUCCEEDED=true +fi +fi + +if [ "$L2_TRANSACTION_SUCCEEDED" = true ]; then +SUCCEEDED=true +break +fi + +# Check if the timeout (10 min) has been reached. +NOW=$(date +%s) +DIFF=$((NOW - START)) +if [ "$DIFF" -ge 600 ]; then +echo "Timed out" +break +fi + +sleep 10 +done + +docker-compose stop + +if [ "$SUCCEEDED" = false ]; then +docker-compose logs +exit 1 +fi + +exit 0 diff --git a/smoke-test-node.bash b/smoke-test-node.bash new file mode 100755 index 00000000..bedbeb30 --- /dev/null +++ b/smoke-test-node.bash @@ -0,0 +1,210 @@ +#!/usr/bin/env bash + +set -e + +NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-cf4b74e-dev +ESPRESSO_VERSION=ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration + +DEFAULT_NITRO_CONTRACTS_VERSION="develop" + +: ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION} +: ${TOKEN_BRIDGE_BRANCH:=$DEFAULT_TOKEN_BRIDGE_VERSION} +export NITRO_CONTRACTS_BRANCH +export TOKEN_BRIDGE_BRANCH + +echo "Using NITRO_CONTRACTS_BRANCH: $NITRO_CONTRACTS_BRANCH" +echo "Using TOKEN_BRIDGE_BRANCH: $TOKEN_BRIDGE_BRANCH" + +mydir=`dirname $0` +cd "$mydir" + +if [[ $# -gt 0 ]] && [[ $1 == "script" ]]; then + shift + docker compose run scripts "$@" + exit $? +fi + +num_volumes=`docker volume ls --filter label=com.docker.compose.project=nitro-testnode -q | wc -l` + +if [[ $num_volumes -eq 0 ]]; then + force_init=true +else + force_init=false +fi + +run=true +detach=false +force_build=false +validate=true +tokenbridge=true +lightClientAddr=0xb6eb235fa509e3206f959761d11e3777e16d0e98 +espresso=true +latest_espresso_image=true +batchposters=1 +devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 +l1chainid=1337 +while [[ $# -gt 0 ]]; do + case $1 in + --init) + if ! $force_init; then + read -p "are you sure? [y/n]" -n 1 response + if [[ $response == "y" ]] || [[ $response == "Y" ]]; then + force_init=true + echo + else + exit 0 + fi + fi + shift + ;; + --detach) + detach=true + shift + ;; + *) + echo Usage: $0 \[OPTIONS..] + echo $0 script [SCRIPT-ARGS] + echo + echo OPTIONS: + echo --init remove all data, rebuild, deploy new rollup + echo --detach detach from nodes after running them + echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help + exit 0 + esac +done + +if $force_init; then + force_build=true +fi + +NODES="sequencer" +INITIAL_SEQ_NODES="sequencer" +NODES="$NODES redis" + +if [ $batchposters -gt 0 ]; then + NODES="$NODES poster" +fi + +if [ $batchposters -gt 1 ]; then + NODES="$NODES poster_b" +fi + +if [ $batchposters -gt 2 ]; then + NODES="$NODES poster_c" +fi + +NODES="$NODES validator" + +if $force_build; then + INITIAL_SEQ_NODES="$INITIAL_SEQ_NODES espresso-dev-node" +else + NODES="$NODES espresso-dev-node" +fi + + +if $force_build; then + echo == Building.. + LOCAL_BUILD_NODES="scripts rollupcreator" + if $tokenbridge; then + LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" + fi + docker compose build --no-rm $LOCAL_BUILD_NODES +fi + +echo == Pulling the latest Espresso image +docker pull $ESPRESSO_VERSION +docker tag $ESPRESSO_VERSION nitro-node-dev-testnode + + +if $force_build; then + docker compose build --no-rm $NODES scripts +fi + +if $force_init; then + echo == Removing old data.. + docker compose down + leftoverContainers=`docker container ls -a --filter label=com.docker.compose.project=nitro-testnode -q | xargs echo` + if [ `echo $leftoverContainers | wc -w` -gt 0 ]; then + docker rm $leftoverContainers + fi + docker volume prune -f --filter label=com.docker.compose.project=nitro-testnode + leftoverVolumes=`docker volume ls --filter label=com.docker.compose.project=nitro-testnode -q | xargs echo` + if [ `echo $leftoverVolumes | wc -w` -gt 0 ]; then + docker volume rm $leftoverVolumes + fi + + echo == Generating l1 keys + docker compose run scripts write-accounts + docker compose run --entrypoint sh geth -c "echo passphrase > /datadir/passphrase" + docker compose run --entrypoint sh geth -c "chown -R 1000:1000 /keystore" + docker compose run --entrypoint sh geth -c "chown -R 1000:1000 /config" + + echo == Starting geth + docker compose up --wait geth + + echo == Funding validator, sequencer and l2owner + docker compose run scripts send-l1 --ethamount 1000 --to validator --wait + docker compose run scripts send-l1 --ethamount 1000 --to sequencer --wait + docker compose run scripts send-l1 --ethamount 1000 --to l2owner --wait + docker compose run scripts send-l1 --ethamount 10000 --to espresso-sequencer --wait + + echo == create l1 traffic + docker compose run scripts send-l1 --ethamount 1000 --to user_l1user --wait + docker compose run scripts send-l1 --ethamount 0.0001 --from user_l1user --to user_l1user_b --wait --delay 500 --times 1000000 > /dev/null & + + l2ownerAddress=`docker compose run scripts print-address --account l2owner | tail -n 1 | tr -d '\r\n'` + + echo == Writing l2 chain config + docker compose run scripts --l2owner $l2ownerAddress write-l2-chain-config --espresso $espresso + + sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'` + l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` + wasmroot=`docker compose run --entrypoint sh sequencer -c "cat /home/user/target/machines/latest/module-root.txt"` + + echo == Deploying L2 chain + docker compose run -e PARENT_CHAIN_RPC="http://geth:8545" -e DEPLOYER_PRIVKEY=$l2ownerKey -e PARENT_CHAIN_ID=$l1chainid -e CHILD_CHAIN_NAME="arb-dev-test" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=$wasmroot -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l2_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_chain_info.json" -e LIGHT_CLIENT_ADDR=$lightClientAddr rollupcreator create-rollup-testnode + docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" + + + echo == Writing configs + docker compose run scripts write-config --espresso $espresso --lightClientAddress $lightClientAddr + + echo == Initializing redis + docker compose up --wait redis + docker compose run scripts redis-init + + echo == Funding l2 funnel and dev key + docker compose up --wait $INITIAL_SEQ_NODES + docker compose run scripts bridge-funds --ethamount 100000 --wait + docker compose run scripts send-l2 --ethamount 10000 --to espresso-sequencer --wait + docker compose run scripts send-l2 --ethamount 100 --to l2owner --wait + + if $tokenbridge; then + echo == Deploying L1-L2 token bridge + sleep 10 # no idea why this sleep is needed but without it the deploy fails randomly + rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` + l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` + docker compose run -e ROLLUP_OWNER_KEY=$l2ownerKey -e ROLLUP_ADDRESS=$rollupAddress -e PARENT_KEY=$devprivkey -e PARENT_RPC=http://geth:8545 -e CHILD_KEY=$devprivkey -e CHILD_RPC=http://sequencer:8547 tokenbridge deploy:local:token-bridge + docker compose run --entrypoint sh tokenbridge -c "cat network.json && cp network.json l1l2_network.json && cp network.json localNetwork.json" + echo + fi + + echo == Deploy CacheManager on L2 + docker compose run -e CHILD_CHAIN_RPC="http://sequencer:8547" -e CHAIN_OWNER_PRIVKEY=$l2ownerKey rollupcreator deploy-cachemanager-testnode +fi + +if $run; then + UP_FLAG="" + if $detach; then + UP_FLAG="--wait" + fi + + echo == Launching Sequencer + echo if things go wrong - use --init to create a new chain + echo + + docker compose up $UP_FLAG $NODES +fi + + + From d0736917210c2ef489fe2dafc0e4b128a0dae897 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 14 Aug 2024 21:14:11 -0400 Subject: [PATCH 02/19] check latest confirmation --- .github/workflows/smoke-test-node.bash | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash index 72eb9b1b..137494f6 100644 --- a/.github/workflows/smoke-test-node.bash +++ b/.github/workflows/smoke-test-node.bash @@ -1,26 +1,37 @@ #!/bin/bash # The script starts up the test node and waits until the timeout (10min) or -# until send-l2 succeeds. +# until send-l2 succeeds and the latest confirmation is fetched. # Start the test node and get PID, to terminate it once send-l2 is done. cd ${GITHUB_WORKSPACE} -./snoke-test-node.bash --init --detach +./smoke-test-node.bash --init --detach START=$(date +%s) L2_TRANSACTION_SUCCEEDED=false -L3_TRANSACTION_SUCCEEDED=false +LATEST_CONFIRMATION_FETCHED=false SUCCEEDED=false while true; do if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then -if ${GITHUB_WORKSPACE}/snoke-test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then +if ${GITHUB_WORKSPACE}/smoke-test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then echo "Sending l2 transaction succeeded" L2_TRANSACTION_SUCCEEDED=true fi fi -if [ "$L2_TRANSACTION_SUCCEEDED" = true ]; then +if [ "$LATEST_CONFIRMATION_FETCHED" = false ]; then + rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` + cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error" > /dev/null + error=` cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error"` + if [ "$error" == "" ]; then + echo "Lastest confirmation fetched" + LATEST_CONFIRMATION_FETCHED=true + fi +fi + + +if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$LASTEST_CONFIRMATION_FETCHED" = true ]; then SUCCEEDED=true break fi From c8fc615a0d59f4ac33d100a8d860401632a9a34b Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 10:28:51 -0400 Subject: [PATCH 03/19] update the ci to use ubuntu-24.04 --- .github/workflows/ci.yml | 2 +- .github/workflows/smoke-test-node.bash | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) mode change 100644 => 100755 .github/workflows/smoke-test-node.bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95abd251..8a4975bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ on: jobs: build_and_run: - runs-on: ubuntu-8 + runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash old mode 100644 new mode 100755 index 137494f6..5a41c6f5 --- a/.github/workflows/smoke-test-node.bash +++ b/.github/workflows/smoke-test-node.bash @@ -2,9 +2,7 @@ # The script starts up the test node and waits until the timeout (10min) or # until send-l2 succeeds and the latest confirmation is fetched. -# Start the test node and get PID, to terminate it once send-l2 is done. -cd ${GITHUB_WORKSPACE} - +# Start the test node and get PID, to terminate it once send-l2 is done and the latest confirmation is fetched. ./smoke-test-node.bash --init --detach START=$(date +%s) @@ -22,7 +20,6 @@ fi if [ "$LATEST_CONFIRMATION_FETCHED" = false ]; then rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` - cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error" > /dev/null error=` cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error"` if [ "$error" == "" ]; then echo "Lastest confirmation fetched" From 1872de15f37969f61fd8c23d8f6b2b28dfb7e82e Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 10:46:00 -0400 Subject: [PATCH 04/19] seperate the smoke test and make it run once every day --- .github/workflows/ci.yml | 8 +++---- .github/workflows/smoke-test.yml | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/smoke-test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a4975bc..eed3ac76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,12 @@ on: push: branches: - master - - develop - + - integration + jobs: build_and_run: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout @@ -36,5 +36,3 @@ jobs: - name: Startup Nitro testnode run: ${{ github.workspace }}/.github/workflows/testnode.bash - - name: Start smoke test - run: ${{ github.workspace }}/.github/workflows/smoke-test-node.bash diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml new file mode 100644 index 00000000..2e19ad27 --- /dev/null +++ b/.github/workflows/smoke-test.yml @@ -0,0 +1,40 @@ +name: Smoke Test CI +run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }} + +on: + workflow_dispatch: + merge_group: + pull_request: + push: + branches: + - master + - integration + schedule: + # Run at the end of every day to make + - cron: "0 0 * * *" + + +jobs: + build_and_run: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} + restore-keys: ${{ runner.os }}-buildx- + + - name: Start Smoke Test with Latest Espresso Image + run: ${{ github.workspace }}/.github/workflows/smoke-test-node.bash From 70c9e3ce017e21d3c959b2c2a869070b5f310e29 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 11:26:21 -0400 Subject: [PATCH 05/19] install foundry in ci --- .github/workflows/smoke-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 2e19ad27..d890fd97 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -36,5 +36,10 @@ jobs: key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + - name: Start Smoke Test with Latest Espresso Image run: ${{ github.workspace }}/.github/workflows/smoke-test-node.bash From 9a4a418fdf6edf1c86cd3a05f8ed786feb700893 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 11:28:44 -0400 Subject: [PATCH 06/19] change to docker compose --- .github/workflows/smoke-test-node.bash | 4 ++-- .github/workflows/testnode.bash | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash index 5a41c6f5..b9d242cd 100755 --- a/.github/workflows/smoke-test-node.bash +++ b/.github/workflows/smoke-test-node.bash @@ -44,10 +44,10 @@ fi sleep 10 done -docker-compose stop +docker compose stop if [ "$SUCCEEDED" = false ]; then -docker-compose logs +docker compose logs exit 1 fi diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 0e57e13d..41a87ce4 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -44,10 +44,10 @@ while true; do sleep 10 done -docker-compose stop +docker compose stop if [ "$SUCCEEDED" = false ]; then - docker-compose logs + docker compose logs exit 1 fi From ec4b0da744862d6bd044387a84d21f791e6bd885 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 12:11:58 -0400 Subject: [PATCH 07/19] increase timeout --- .github/workflows/smoke-test-node.bash | 66 +++++++++++++------------- .github/workflows/testnode.bash | 4 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash index b9d242cd..70c26857 100755 --- a/.github/workflows/smoke-test-node.bash +++ b/.github/workflows/smoke-test-node.bash @@ -11,44 +11,44 @@ LATEST_CONFIRMATION_FETCHED=false SUCCEEDED=false while true; do -if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then -if ${GITHUB_WORKSPACE}/smoke-test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then -echo "Sending l2 transaction succeeded" -L2_TRANSACTION_SUCCEEDED=true -fi -fi - -if [ "$LATEST_CONFIRMATION_FETCHED" = false ]; then - rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` - error=` cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error"` - if [ "$error" == "" ]; then - echo "Lastest confirmation fetched" - LATEST_CONFIRMATION_FETCHED=true - fi -fi - - -if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$LASTEST_CONFIRMATION_FETCHED" = true ]; then -SUCCEEDED=true -break -fi - -# Check if the timeout (10 min) has been reached. -NOW=$(date +%s) -DIFF=$((NOW - START)) -if [ "$DIFF" -ge 600 ]; then -echo "Timed out" -break -fi - -sleep 10 + if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then + if ${GITHUB_WORKSPACE}/smoke-test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then + echo "Sending l2 transaction succeeded" + L2_TRANSACTION_SUCCEEDED=true + fi + fi + + if [ "$LATEST_CONFIRMATION_FETCHED" = false ]; then + rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` + error=` cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error"` + if [ "$error" == "" ]; then + echo "Lastest confirmation fetched" + LATEST_CONFIRMATION_FETCHED=true + fi + fi + + + if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$LASTEST_CONFIRMATION_FETCHED" = true ]; then + SUCCEEDED=true + break + fi + + # Check if the timeout (20 min) has been reached. + NOW=$(date +%s) + DIFF=$((NOW - START)) + if [ "$DIFF" -ge 1200 ]; then + echo "Timed out" + break + fi + + sleep 10 done docker compose stop if [ "$SUCCEEDED" = false ]; then -docker compose logs -exit 1 + docker compose logs + exit 1 fi exit 0 diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 41a87ce4..5d23ec93 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -33,10 +33,10 @@ while true; do break fi - # Check if the timeout (10 min) has been reached. + # Check if the timeout (20 min) has been reached. NOW=$(date +%s) DIFF=$((NOW - START)) - if [ "$DIFF" -ge 600 ]; then + if [ "$DIFF" -ge 1200 ]; then echo "Timed out" break fi From dd9713d4374e8bc7780e5c639c8d997597253859 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 12:55:58 -0400 Subject: [PATCH 08/19] fix typo --- .github/workflows/smoke-test-node.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash index 70c26857..233f418c 100755 --- a/.github/workflows/smoke-test-node.bash +++ b/.github/workflows/smoke-test-node.bash @@ -28,7 +28,7 @@ while true; do fi - if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$LASTEST_CONFIRMATION_FETCHED" = true ]; then + if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$LATEST_CONFIRMATION_FETCHED" = true ]; then SUCCEEDED=true break fi @@ -51,4 +51,6 @@ if [ "$SUCCEEDED" = false ]; then exit 1 fi +echo "Smoke test succeeded" + exit 0 From 7b572e83348df0f561141d08c37ba9047e5e7388 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 12:57:38 -0400 Subject: [PATCH 09/19] remove l3 because its broken --- .github/workflows/testnode.bash | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 5d23ec93..1a7793ce 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -6,11 +6,10 @@ cd ${GITHUB_WORKSPACE} # TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var -./test-node.bash --init-force --l3node --no-simple --detach +./test-node.bash --init-force --no-simple --detach START=$(date +%s) L2_TRANSACTION_SUCCEEDED=false -L3_TRANSACTION_SUCCEEDED=false SUCCEEDED=false while true; do @@ -21,14 +20,8 @@ while true; do fi fi - if [ "$L3_TRANSACTION_SUCCEEDED" = false ]; then - if ${GITHUB_WORKSPACE}/test-node.bash script send-l3 --ethamount 100 --to user_l3user --wait; then - echo "Sending l3 transaction succeeded" - L3_TRANSACTION_SUCCEEDED=true - fi - fi - if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$L3_TRANSACTION_SUCCEEDED" = true ]; then + if [ "$L2_TRANSACTION_SUCCEEDED" = true ]; then SUCCEEDED=true break fi From a1f92e0c2693732e38024493351a50742979ab98 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 14:43:52 -0400 Subject: [PATCH 10/19] update the version of nitro node --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 3e4db1d8..7e996475 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-cf4b74e-dev +NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.1.0-7d1d84c ESPRESSO_VERSION=ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 From 53ce4d6c87f83b2991fbec5e2a9b52582ed3ba86 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 15:04:44 -0400 Subject: [PATCH 11/19] add espresso --- .github/workflows/testnode.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 1a7793ce..2cc25afa 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -6,7 +6,7 @@ cd ${GITHUB_WORKSPACE} # TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var -./test-node.bash --init-force --no-simple --detach +./test-node.bash --init-force --espresso --no-simple --detach START=$(date +%s) L2_TRANSACTION_SUCCEEDED=false From 48f67b97bca57867a85581fb329d723a32d2965b Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 16:04:40 -0400 Subject: [PATCH 12/19] fix --- .github/workflows/ci.yml | 5 +++-- .github/workflows/testnode.bash | 11 +++++++++-- test-node.bash | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eed3ac76..96e21d2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- - - name: Startup Nitro testnode - run: ${{ github.workspace }}/.github/workflows/testnode.bash +# This is currently broken as L3 node support needs to be fixed +# - name: Startup Nitro testnode +# run: ${{ github.workspace }}/.github/workflows/testnode.bash diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 2cc25afa..53ab9acb 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -6,7 +6,7 @@ cd ${GITHUB_WORKSPACE} # TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var -./test-node.bash --init-force --espresso --no-simple --detach +./test-node.bash --init-force --l3node --no-simple --detach START=$(date +%s) L2_TRANSACTION_SUCCEEDED=false @@ -21,7 +21,14 @@ while true; do fi - if [ "$L2_TRANSACTION_SUCCEEDED" = true ]; then + if [ "$L3_TRANSACTION_SUCCEEDED" = false ]; then + if ${GITHUB_WORKSPACE}/test-node.bash script send-l3 --ethamount 100 --to user_l3user --wait; then + echo "Sending l3 transaction succeeded" + L3_TRANSACTION_SUCCEEDED=true + fi + fi + + if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$L3_TRANSACTION_SUCCEEDED" = true ]; then SUCCEEDED=true break fi diff --git a/test-node.bash b/test-node.bash index 7e996475..3e4db1d8 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.1.0-7d1d84c +NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-cf4b74e-dev ESPRESSO_VERSION=ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 From 0b87c88c26ee4f50632b0a4c9b9b87f7ec68afcd Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 16:06:07 -0400 Subject: [PATCH 13/19] lint --- .github/workflows/testnode.bash | 5 +++-- smoke-test-node.bash | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 53ab9acb..6edf6abf 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -10,6 +10,7 @@ cd ${GITHUB_WORKSPACE} START=$(date +%s) L2_TRANSACTION_SUCCEEDED=false +L3_TRANSACTION_SUCCEEDED=false SUCCEEDED=false while true; do @@ -33,10 +34,10 @@ while true; do break fi - # Check if the timeout (20 min) has been reached. + # Check if the timeout (10 min) has been reached. NOW=$(date +%s) DIFF=$((NOW - START)) - if [ "$DIFF" -ge 1200 ]; then + if [ "$DIFF" -ge 600 ]; then echo "Timed out" break fi diff --git a/smoke-test-node.bash b/smoke-test-node.bash index bedbeb30..0a4d2dc2 100755 --- a/smoke-test-node.bash +++ b/smoke-test-node.bash @@ -205,6 +205,3 @@ if $run; then docker compose up $UP_FLAG $NODES fi - - - From ed810d74ca2836a0ccf799f23445195e87324494 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 15 Aug 2024 16:08:35 -0400 Subject: [PATCH 14/19] fix typo --- .github/workflows/smoke-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index d890fd97..2f34d7de 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -10,7 +10,7 @@ on: - master - integration schedule: - # Run at the end of every day to make + # Run at the end of every day - cron: "0 0 * * *" From 3de33770b15297202355ee63cd4b02d21d3e225c Mon Sep 17 00:00:00 2001 From: sveitser Date: Fri, 16 Aug 2024 13:30:18 +0200 Subject: [PATCH 15/19] Use original test-node.bash script for smoke test --- .github/workflows/smoke-test-node.bash | 56 ------- .github/workflows/smoke-test.yml | 11 +- .github/workflows/testnode.bash | 5 +- smoke-test-node.bash | 207 ------------------------- smoke-test.bash | 21 +++ 5 files changed, 32 insertions(+), 268 deletions(-) delete mode 100755 .github/workflows/smoke-test-node.bash delete mode 100755 smoke-test-node.bash create mode 100755 smoke-test.bash diff --git a/.github/workflows/smoke-test-node.bash b/.github/workflows/smoke-test-node.bash deleted file mode 100755 index 233f418c..00000000 --- a/.github/workflows/smoke-test-node.bash +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# The script starts up the test node and waits until the timeout (10min) or -# until send-l2 succeeds and the latest confirmation is fetched. - -# Start the test node and get PID, to terminate it once send-l2 is done and the latest confirmation is fetched. -./smoke-test-node.bash --init --detach - -START=$(date +%s) -L2_TRANSACTION_SUCCEEDED=false -LATEST_CONFIRMATION_FETCHED=false -SUCCEEDED=false - -while true; do - if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then - if ${GITHUB_WORKSPACE}/smoke-test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then - echo "Sending l2 transaction succeeded" - L2_TRANSACTION_SUCCEEDED=true - fi - fi - - if [ "$LATEST_CONFIRMATION_FETCHED" = false ]; then - rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` - error=` cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)' | grep "error"` - if [ "$error" == "" ]; then - echo "Lastest confirmation fetched" - LATEST_CONFIRMATION_FETCHED=true - fi - fi - - - if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$LATEST_CONFIRMATION_FETCHED" = true ]; then - SUCCEEDED=true - break - fi - - # Check if the timeout (20 min) has been reached. - NOW=$(date +%s) - DIFF=$((NOW - START)) - if [ "$DIFF" -ge 1200 ]; then - echo "Timed out" - break - fi - - sleep 10 -done - -docker compose stop - -if [ "$SUCCEEDED" = false ]; then - docker compose logs - exit 1 -fi - -echo "Smoke test succeeded" - -exit 0 diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 2f34d7de..3762ab0a 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -13,9 +13,14 @@ on: # Run at the end of every day - cron: "0 0 * * *" +# Cancel in-progress jobs except for integration branch +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !contains(github.ref, 'integration/')}} + jobs: - build_and_run: + smoke_test: runs-on: ubuntu-24.04 steps: @@ -42,4 +47,6 @@ jobs: version: nightly - name: Start Smoke Test with Latest Espresso Image - run: ${{ github.workspace }}/.github/workflows/smoke-test-node.bash + run: | + ./smoke-test.bash + timeout-minutes: 30 diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 6edf6abf..0e57e13d 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -21,7 +21,6 @@ while true; do fi fi - if [ "$L3_TRANSACTION_SUCCEEDED" = false ]; then if ${GITHUB_WORKSPACE}/test-node.bash script send-l3 --ethamount 100 --to user_l3user --wait; then echo "Sending l3 transaction succeeded" @@ -45,10 +44,10 @@ while true; do sleep 10 done -docker compose stop +docker-compose stop if [ "$SUCCEEDED" = false ]; then - docker compose logs + docker-compose logs exit 1 fi diff --git a/smoke-test-node.bash b/smoke-test-node.bash deleted file mode 100755 index 0a4d2dc2..00000000 --- a/smoke-test-node.bash +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/env bash - -set -e - -NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-cf4b74e-dev -ESPRESSO_VERSION=ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration - -DEFAULT_NITRO_CONTRACTS_VERSION="develop" - -: ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION} -: ${TOKEN_BRIDGE_BRANCH:=$DEFAULT_TOKEN_BRIDGE_VERSION} -export NITRO_CONTRACTS_BRANCH -export TOKEN_BRIDGE_BRANCH - -echo "Using NITRO_CONTRACTS_BRANCH: $NITRO_CONTRACTS_BRANCH" -echo "Using TOKEN_BRIDGE_BRANCH: $TOKEN_BRIDGE_BRANCH" - -mydir=`dirname $0` -cd "$mydir" - -if [[ $# -gt 0 ]] && [[ $1 == "script" ]]; then - shift - docker compose run scripts "$@" - exit $? -fi - -num_volumes=`docker volume ls --filter label=com.docker.compose.project=nitro-testnode -q | wc -l` - -if [[ $num_volumes -eq 0 ]]; then - force_init=true -else - force_init=false -fi - -run=true -detach=false -force_build=false -validate=true -tokenbridge=true -lightClientAddr=0xb6eb235fa509e3206f959761d11e3777e16d0e98 -espresso=true -latest_espresso_image=true -batchposters=1 -devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 -l1chainid=1337 -while [[ $# -gt 0 ]]; do - case $1 in - --init) - if ! $force_init; then - read -p "are you sure? [y/n]" -n 1 response - if [[ $response == "y" ]] || [[ $response == "Y" ]]; then - force_init=true - echo - else - exit 0 - fi - fi - shift - ;; - --detach) - detach=true - shift - ;; - *) - echo Usage: $0 \[OPTIONS..] - echo $0 script [SCRIPT-ARGS] - echo - echo OPTIONS: - echo --init remove all data, rebuild, deploy new rollup - echo --detach detach from nodes after running them - echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help - exit 0 - esac -done - -if $force_init; then - force_build=true -fi - -NODES="sequencer" -INITIAL_SEQ_NODES="sequencer" -NODES="$NODES redis" - -if [ $batchposters -gt 0 ]; then - NODES="$NODES poster" -fi - -if [ $batchposters -gt 1 ]; then - NODES="$NODES poster_b" -fi - -if [ $batchposters -gt 2 ]; then - NODES="$NODES poster_c" -fi - -NODES="$NODES validator" - -if $force_build; then - INITIAL_SEQ_NODES="$INITIAL_SEQ_NODES espresso-dev-node" -else - NODES="$NODES espresso-dev-node" -fi - - -if $force_build; then - echo == Building.. - LOCAL_BUILD_NODES="scripts rollupcreator" - if $tokenbridge; then - LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" - fi - docker compose build --no-rm $LOCAL_BUILD_NODES -fi - -echo == Pulling the latest Espresso image -docker pull $ESPRESSO_VERSION -docker tag $ESPRESSO_VERSION nitro-node-dev-testnode - - -if $force_build; then - docker compose build --no-rm $NODES scripts -fi - -if $force_init; then - echo == Removing old data.. - docker compose down - leftoverContainers=`docker container ls -a --filter label=com.docker.compose.project=nitro-testnode -q | xargs echo` - if [ `echo $leftoverContainers | wc -w` -gt 0 ]; then - docker rm $leftoverContainers - fi - docker volume prune -f --filter label=com.docker.compose.project=nitro-testnode - leftoverVolumes=`docker volume ls --filter label=com.docker.compose.project=nitro-testnode -q | xargs echo` - if [ `echo $leftoverVolumes | wc -w` -gt 0 ]; then - docker volume rm $leftoverVolumes - fi - - echo == Generating l1 keys - docker compose run scripts write-accounts - docker compose run --entrypoint sh geth -c "echo passphrase > /datadir/passphrase" - docker compose run --entrypoint sh geth -c "chown -R 1000:1000 /keystore" - docker compose run --entrypoint sh geth -c "chown -R 1000:1000 /config" - - echo == Starting geth - docker compose up --wait geth - - echo == Funding validator, sequencer and l2owner - docker compose run scripts send-l1 --ethamount 1000 --to validator --wait - docker compose run scripts send-l1 --ethamount 1000 --to sequencer --wait - docker compose run scripts send-l1 --ethamount 1000 --to l2owner --wait - docker compose run scripts send-l1 --ethamount 10000 --to espresso-sequencer --wait - - echo == create l1 traffic - docker compose run scripts send-l1 --ethamount 1000 --to user_l1user --wait - docker compose run scripts send-l1 --ethamount 0.0001 --from user_l1user --to user_l1user_b --wait --delay 500 --times 1000000 > /dev/null & - - l2ownerAddress=`docker compose run scripts print-address --account l2owner | tail -n 1 | tr -d '\r\n'` - - echo == Writing l2 chain config - docker compose run scripts --l2owner $l2ownerAddress write-l2-chain-config --espresso $espresso - - sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'` - l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` - wasmroot=`docker compose run --entrypoint sh sequencer -c "cat /home/user/target/machines/latest/module-root.txt"` - - echo == Deploying L2 chain - docker compose run -e PARENT_CHAIN_RPC="http://geth:8545" -e DEPLOYER_PRIVKEY=$l2ownerKey -e PARENT_CHAIN_ID=$l1chainid -e CHILD_CHAIN_NAME="arb-dev-test" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=$wasmroot -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l2_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_chain_info.json" -e LIGHT_CLIENT_ADDR=$lightClientAddr rollupcreator create-rollup-testnode - docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" - - - echo == Writing configs - docker compose run scripts write-config --espresso $espresso --lightClientAddress $lightClientAddr - - echo == Initializing redis - docker compose up --wait redis - docker compose run scripts redis-init - - echo == Funding l2 funnel and dev key - docker compose up --wait $INITIAL_SEQ_NODES - docker compose run scripts bridge-funds --ethamount 100000 --wait - docker compose run scripts send-l2 --ethamount 10000 --to espresso-sequencer --wait - docker compose run scripts send-l2 --ethamount 100 --to l2owner --wait - - if $tokenbridge; then - echo == Deploying L1-L2 token bridge - sleep 10 # no idea why this sleep is needed but without it the deploy fails randomly - rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"` - l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` - docker compose run -e ROLLUP_OWNER_KEY=$l2ownerKey -e ROLLUP_ADDRESS=$rollupAddress -e PARENT_KEY=$devprivkey -e PARENT_RPC=http://geth:8545 -e CHILD_KEY=$devprivkey -e CHILD_RPC=http://sequencer:8547 tokenbridge deploy:local:token-bridge - docker compose run --entrypoint sh tokenbridge -c "cat network.json && cp network.json l1l2_network.json && cp network.json localNetwork.json" - echo - fi - - echo == Deploy CacheManager on L2 - docker compose run -e CHILD_CHAIN_RPC="http://sequencer:8547" -e CHAIN_OWNER_PRIVKEY=$l2ownerKey rollupcreator deploy-cachemanager-testnode -fi - -if $run; then - UP_FLAG="" - if $detach; then - UP_FLAG="--wait" - fi - - echo == Launching Sequencer - echo if things go wrong - use --init to create a new chain - echo - - docker compose up $UP_FLAG $NODES -fi diff --git a/smoke-test.bash b/smoke-test.bash new file mode 100755 index 00000000..5411af2c --- /dev/null +++ b/smoke-test.bash @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init --detach + +# Sending L2 transaction +./test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait + +rollupAddress=$(docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'") +while true; do + confirmed=$(cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)') + echo "Number of confirmed staking nodes: $confirmed" + if [ "$confirmed" -gt 0 ]; then + break + else + echo "Waiting for more confirmed nodes ..." + fi + sleep 5 +done + +echo "Smoke test succeeded" From b57c362540190123a3b6d0eb6e61dd1d77fab8fc Mon Sep 17 00:00:00 2001 From: sveitser Date: Fri, 16 Aug 2024 14:31:27 +0200 Subject: [PATCH 16/19] Run smoke test on every push --- .github/workflows/smoke-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 3762ab0a..a0c4f84e 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -6,9 +6,6 @@ on: merge_group: pull_request: push: - branches: - - master - - integration schedule: # Run at the end of every day - cron: "0 0 * * *" From 77e1daa69d19c088e7d668372120895899e16397 Mon Sep 17 00:00:00 2001 From: sveitser Date: Fri, 16 Aug 2024 14:58:25 +0200 Subject: [PATCH 17/19] CI: enable docker caching --- .github/workflows/smoke-test.yml | 35 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index a0c4f84e..bba9d710 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -26,22 +26,41 @@ jobs: with: submodules: recursive + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: driver-opts: network=host - - name: Cache Docker layers - uses: actions/cache@v3 + # Explicitly building the docker images because it's not clear how we can + # use the github acion (gha) cache if we let docker compose build the images. + - uses: docker/build-push-action@v5 with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} - restore-keys: ${{ runner.os }}-buildx- + context: ./rollupcreator + cache-from: type=gha + cache-to: type=gha,mode=max + # Use default branch from test-node.bash + build-args: | + NITRO_CONTRACTS_BRANCH=develop - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + - uses: docker/build-push-action@v5 with: - version: nightly + context: ./scripts + cache-from: type=gha + cache-to: type=gha,mode=max + + - uses: docker/build-push-action@v5 + with: + context: ./tokenbridge + cache-from: type=gha + cache-to: type=gha,mode=max + # Use default branch from test-node.bash + build-args: | + TOKEN_BRIDGE_BRANCH=v1.2.2 - name: Start Smoke Test with Latest Espresso Image run: | From fb0f1771852eaa1aaab2491196f618ed01db4593 Mon Sep 17 00:00:00 2001 From: sveitser Date: Fri, 16 Aug 2024 15:51:06 +0200 Subject: [PATCH 18/19] Don't run CI twice on PRs --- .github/workflows/smoke-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index bba9d710..9f4b74f6 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -4,7 +4,6 @@ run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }} on: workflow_dispatch: merge_group: - pull_request: push: schedule: # Run at the end of every day From f19d41453594c4c2becc0aa1713fa20c81c4556d Mon Sep 17 00:00:00 2001 From: sveitser Date: Fri, 16 Aug 2024 16:38:35 +0200 Subject: [PATCH 19/19] Revert upstream file --- .github/workflows/ci.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96e21d2a..a78e451c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,12 @@ on: push: branches: - master - - integration - + - develop + jobs: build_and_run: - runs-on: ubuntu-24.04 + runs-on: ubuntu-8 steps: - name: Checkout @@ -32,8 +32,6 @@ jobs: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} restore-keys: ${{ runner.os }}-buildx- - -# This is currently broken as L3 node support needs to be fixed -# - name: Startup Nitro testnode -# run: ${{ github.workspace }}/.github/workflows/testnode.bash - + + - name: Startup Nitro testnode + run: ${{ github.workspace }}/.github/workflows/testnode.bash