From 6dd7c82621fbce00aefca610454e0fe3561824b0 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Fri, 2 Feb 2024 10:19:37 -0700 Subject: [PATCH 01/62] accounts documentation --- scripts/accounts.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/accounts.ts b/scripts/accounts.ts index 73de095a..20c1cbbe 100644 --- a/scripts/accounts.ts +++ b/scripts/accounts.ts @@ -85,10 +85,11 @@ export function namedAddress( export const namedAccountHelpString = "Valid account names:\n" + - " funnel | sequencer | validator - known keys\n" + - " user_[Alphanumeric] - key will be generated from username\n" + - " threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" + - " key_0x[full private key] - user with specified private key\n" + + " funnel | sequencer | validator | l2owner - known keys used by l2\n" + + " l3owner | l3sequencer - known keys used by l3\n" + + " user_[Alphanumeric] - key will be generated from username\n" + + " threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" + + " key_0x[full private key] - user with specified private key\n" + "\n" + "Valid addresses: any account name, or\n" + " address_0x[full eth address]\n" + @@ -123,7 +124,7 @@ export const printPrivateKeyCommand = { builder: { account: { string: true, - describe: "address (see general help)", + describe: "account (see general help)", default: "funnel", }, }, From 4acf14304d740023593de445d10a8c165b6baffc Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 5 Feb 2024 23:17:22 +0900 Subject: [PATCH 02/62] perf: remove chrome --- tokenbridge/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokenbridge/Dockerfile b/tokenbridge/Dockerfile index 199534c3..1599c0c9 100644 --- a/tokenbridge/Dockerfile +++ b/tokenbridge/Dockerfile @@ -1,6 +1,6 @@ FROM node:16-bullseye-slim RUN apt-get update && \ - apt-get install -y git docker.io python3 chromium build-essential + apt-get install -y git docker.io python3 build-essential WORKDIR /workspace RUN git clone -b reg-weth-gw https://github.com/OffchainLabs/token-bridge-contracts.git ./ RUN yarn install From 65c135a79ce5c68e76f85a6acf4f2ce56830552b Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 6 Feb 2024 00:35:13 +0900 Subject: [PATCH 03/62] chore: switch token-bridge-contracts main --- tokenbridge/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokenbridge/Dockerfile b/tokenbridge/Dockerfile index 1599c0c9..344e537d 100644 --- a/tokenbridge/Dockerfile +++ b/tokenbridge/Dockerfile @@ -2,7 +2,7 @@ FROM node:16-bullseye-slim RUN apt-get update && \ apt-get install -y git docker.io python3 build-essential WORKDIR /workspace -RUN git clone -b reg-weth-gw https://github.com/OffchainLabs/token-bridge-contracts.git ./ +RUN git clone https://github.com/OffchainLabs/token-bridge-contracts.git ./ RUN yarn install RUN yarn build ENTRYPOINT ["yarn"] From ed8331d6f1dad954f19ad9818b10333553e46609 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 6 Feb 2024 02:44:18 +0900 Subject: [PATCH 04/62] perf: use slim image --- scripts/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index e9b91b86..c5b7050c 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16 +FROM node:16-bullseye-slim WORKDIR /workspace COPY ./package.json ./yarn.lock ./ RUN yarn From 70066a861681f8a2a65fbc1adf54bb5b556cff77 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 6 Feb 2024 14:48:25 +0000 Subject: [PATCH 05/62] chore: add missing help parameters --- test-node.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test-node.bash b/test-node.bash index 4a778d27..a48c61ff 100755 --- a/test-node.bash +++ b/test-node.bash @@ -164,6 +164,7 @@ while [[ $# -gt 0 ]]; do echo --init remove all data, rebuild, deploy new rollup echo --pos l1 is a proof-of-stake chain \(using prysm for consensus\) echo --validate heavy computation, validating all blocks in WASM + echo --l3-node deploys an L3 node on top of the L2 echo --l3-fee-token L3 chain is set up to use custom fee token. Only valid if also '--l3node' is provided echo --l3-token-bridge Deploy L2-L3 token bridge. Only valid if also '--l3node' is provided echo --batchposters batch posters [0-3] @@ -171,6 +172,7 @@ while [[ $# -gt 0 ]]; do echo --detach detach from nodes after running them echo --blockscout build or launch blockscout echo --simple run a simple configuration. one node as sequencer/batch-poster/staker \(default unless using --dev\) + echo --tokenbridge deploy L1-L2 token bridge. echo --no-tokenbridge don\'t build or launch tokenbridge echo --no-run does not launch nodes \(useful with build or init\) echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer From 8335e048adf46c80aa37c0a1394e3fc57a2601e7 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Fri, 9 Feb 2024 17:03:28 +0100 Subject: [PATCH 06/62] Add CI for testnode that starts up nitro test node and rans l2 transactions --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++ .github/workflows/testnode.bash | 12 +++++++++++ test-node.bash | 9 ++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/testnode.bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..ac76fc5d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI +run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }} + +on: + workflow_dispatch: + merge_group: + pull_request: + push: + branches: + - master + - develop + + +jobs: + build_and_run: + runs-on: ubuntu-8 + + 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: Startup Nitro testnode + run: ${{ github.workspace }}/.github/workflows/testnode.sh diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash new file mode 100644 index 00000000..7fa18901 --- /dev/null +++ b/.github/workflows/testnode.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# The script starts up the test node (with timeout 1 minute), with option to +# run l2 transactions to make sure node is working + +timeout 60 ./nitro-testnode/test-node.bash --init --dev || exit_status=$? + +if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then + echo "Testnode failed." + exit $exit_status +fi + +echo "Testnode succeeded." diff --git a/test-node.bash b/test-node.bash index c020d036..a7cbc843 100755 --- a/test-node.bash +++ b/test-node.bash @@ -43,6 +43,7 @@ dev_build_blockscout=false batchposters=1 devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 l1chainid=1337 +runL2Txs=false while [[ $# -gt 0 ]]; do case $1 in --init) @@ -117,6 +118,10 @@ while [[ $# -gt 0 ]]; do l3node=true shift ;; + --run-l2-txs) + runL2Txs=true + shift + ;; --redundantsequencers) redundantsequencers=$2 if ! [[ $redundantsequencers =~ [0-3] ]] ; then @@ -322,6 +327,10 @@ if $force_init; then echo fi + if $runL2Txs; then + docker-compose run scripts send-l2 --ethamount 100 --to user_l2user --wait + fi + if $l3node; then echo == Funding l3 users docker-compose run scripts send-l2 --ethamount 1000 --to l3owner --wait From 5219ee2f6e1edad4409df9c6e2ed1ccea305e5d0 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Fri, 9 Feb 2024 17:12:21 +0100 Subject: [PATCH 07/62] Fix typo --- .github/workflows/ci.yml | 2 +- .github/workflows/testnode.bash | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 .github/workflows/testnode.bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac76fc5d..a78e451c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,4 +34,4 @@ jobs: restore-keys: ${{ runner.os }}-buildx- - name: Startup Nitro testnode - run: ${{ github.workspace }}/.github/workflows/testnode.sh + run: ${{ github.workspace }}/.github/workflows/testnode.bash diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash old mode 100644 new mode 100755 From 52376108db3b8433b692f9d96a99dd80c3a50b7a Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Fri, 9 Feb 2024 17:15:31 +0100 Subject: [PATCH 08/62] Fix script path in testnode.bash --- .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 7fa18901..742b30f1 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -2,7 +2,7 @@ # The script starts up the test node (with timeout 1 minute), with option to # run l2 transactions to make sure node is working -timeout 60 ./nitro-testnode/test-node.bash --init --dev || exit_status=$? +timeout 60 ${{ github.workspace }}/nitro-testnode/test-node.bash --init --dev || exit_status=$? if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then echo "Testnode failed." From d62114ce0aec72982c744ee7d0167302d581a083 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 15 Feb 2024 11:48:52 -0600 Subject: [PATCH 09/62] Add beacon client URL --- scripts/config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/config.ts b/scripts/config.ts index 76a51aa3..7454773b 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -158,6 +158,9 @@ function writeConfigs(argv: any) { "connection": { "url": argv.l1url, }, + "blob-client": { + "beacon-url": "http://prysm_beacon_chain:3500" + }, }, "chain": { "id": 412346, From a22f63a4f03687f708696f6250cfc1ef5d2d914d Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 15 Feb 2024 16:19:56 -0600 Subject: [PATCH 10/62] Disable blob reader for now --- scripts/config.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index 7454773b..23ecff4f 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -158,9 +158,6 @@ function writeConfigs(argv: any) { "connection": { "url": argv.l1url, }, - "blob-client": { - "beacon-url": "http://prysm_beacon_chain:3500" - }, }, "chain": { "id": 412346, @@ -184,7 +181,8 @@ function writeConfigs(argv: any) { }, "sequencer": false, "dangerous": { - "no-sequencer-coordinator": false + "no-sequencer-coordinator": false, + "disable-blob-reader": true, }, "delayed-sequencer": { "enable": false From ec4fce0ecaea7d7611c06fcd286a1d01859f2e2b Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Wed, 21 Feb 2024 11:10:13 +0100 Subject: [PATCH 11/62] Drop send-l2-tx flag --- .github/workflows/testnode.bash | 3 ++- test-node.bash | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 742b30f1..83f1d9cb 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -2,7 +2,8 @@ # The script starts up the test node (with timeout 1 minute), with option to # run l2 transactions to make sure node is working -timeout 60 ${{ github.workspace }}/nitro-testnode/test-node.bash --init --dev || exit_status=$? +timeout 60 ${{ github.workspace }}/nitro-testnode/test-node.bash --init --dev --detach || exit_status=$? +${{ github.workspace }}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then echo "Testnode failed." diff --git a/test-node.bash b/test-node.bash index b09eb6e7..4a778d27 100755 --- a/test-node.bash +++ b/test-node.bash @@ -38,7 +38,6 @@ l3_token_bridge=false batchposters=1 devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 l1chainid=1337 -runL2Txs=false simple=true while [[ $# -gt 0 ]]; do case $1 in @@ -121,8 +120,6 @@ while [[ $# -gt 0 ]]; do l3node=true shift ;; - --run-l2-txs) - runL2Txs=true --l3-fee-token) if ! $l3node; then echo "Error: --l3-fee-token requires --l3node to be provided." @@ -372,10 +369,6 @@ if $force_init; then echo fi - if $runL2Txs; then - docker-compose run scripts send-l2 --ethamount 100 --to user_l2user --wait - fi - if $l3node; then echo == Funding l3 users docker compose run scripts send-l2 --ethamount 1000 --to l3owner --wait From 47ce5d22b48a760ac84e558202bce905aad9b953 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Wed, 21 Feb 2024 11:26:08 +0100 Subject: [PATCH 12/62] replace github.workspace with GITHUB_WORKSPACE --- .github/workflows/testnode.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 83f1d9cb..1d6dbd2f 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -2,8 +2,9 @@ # The script starts up the test node (with timeout 1 minute), with option to # run l2 transactions to make sure node is working -timeout 60 ${{ github.workspace }}/nitro-testnode/test-node.bash --init --dev --detach || exit_status=$? -${{ github.workspace }}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait +timeout 60 ${GITHUB_WORKSPACE}/nitro-testnode/test-node.bash --init --dev --detach || exit_status=$? +sleep 3s +${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then echo "Testnode failed." From eb8e05d22d2a37a807570394f9976574034ec313 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Wed, 21 Feb 2024 11:51:14 +0100 Subject: [PATCH 13/62] Fix script path --- .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 1d6dbd2f..50d08ab0 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -2,7 +2,7 @@ # The script starts up the test node (with timeout 1 minute), with option to # run l2 transactions to make sure node is working -timeout 60 ${GITHUB_WORKSPACE}/nitro-testnode/test-node.bash --init --dev --detach || exit_status=$? +timeout 60 ${GITHUB_WORKSPACE}/test-node.bash --init --dev --detach || exit_status=$? sleep 3s ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait From 3cbcbf225d33f077250d099e8771a51a16b9fe3e Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Thu, 22 Feb 2024 12:28:01 +0100 Subject: [PATCH 14/62] wait for 3min before trying to send l2 transaction --- .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 50d08ab0..c7154c15 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -3,7 +3,7 @@ # run l2 transactions to make sure node is working timeout 60 ${GITHUB_WORKSPACE}/test-node.bash --init --dev --detach || exit_status=$? -sleep 3s +sleep 3m ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then From 3ed91b596769f9f8cfae3a9535cb8e0ad95385d2 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Thu, 22 Feb 2024 12:50:48 +0100 Subject: [PATCH 15/62] Wait 5min until sending l2 transactions --- .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 c7154c15..ff606487 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -3,7 +3,7 @@ # run l2 transactions to make sure node is working timeout 60 ${GITHUB_WORKSPACE}/test-node.bash --init --dev --detach || exit_status=$? -sleep 3m +sleep 5m ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then From 03e24b2aa7c6a5715f1201793cd88de05a9cd635 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Thu, 22 Feb 2024 17:20:01 +0100 Subject: [PATCH 16/62] Increase wait time --- .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 ff606487..21a431d4 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -3,7 +3,7 @@ # run l2 transactions to make sure node is working timeout 60 ${GITHUB_WORKSPACE}/test-node.bash --init --dev --detach || exit_status=$? -sleep 5m +sleep 15m ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then From ff7ff3ac451f966e78e4df45e665bb7bd52b2861 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Fri, 23 Feb 2024 16:09:12 +0100 Subject: [PATCH 17/62] Run testnode using latest release (without --dev) --- .github/workflows/testnode.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 21a431d4..6918d403 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -2,9 +2,9 @@ # The script starts up the test node (with timeout 1 minute), with option to # run l2 transactions to make sure node is working -timeout 60 ${GITHUB_WORKSPACE}/test-node.bash --init --dev --detach || exit_status=$? -sleep 15m -${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait +timeout 10m ${GITHUB_WORKSPACE}/test-node.bash --init --detach +sleep 10m +${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait || exit_status=$? if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then echo "Testnode failed." From 74e07df5ad1291bfe079f0975ffb112096b93695 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Fri, 23 Feb 2024 16:34:34 +0100 Subject: [PATCH 18/62] Increase timeout --- .github/workflows/testnode.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 6918d403..64fb160f 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -2,8 +2,8 @@ # The script starts up the test node (with timeout 1 minute), with option to # run l2 transactions to make sure node is working -timeout 10m ${GITHUB_WORKSPACE}/test-node.bash --init --detach -sleep 10m +timeout 20m ${GITHUB_WORKSPACE}/test-node.bash --init --detach +sleep 20m ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait || exit_status=$? if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then From b9588a10c34ee7c358a3025f79573dd8df6dbaf6 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Mon, 26 Feb 2024 14:22:52 +0100 Subject: [PATCH 19/62] Poll until timeout or until send-l2 succeeds --- .github/workflows/testnode.bash | 46 ++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 64fb160f..258a47c6 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -1,14 +1,40 @@ -#!/usr/bin/env bash -# The script starts up the test node (with timeout 1 minute), with option to -# run l2 transactions to make sure node is working +#!/bin/bash +# The script starts up the test node and waits until the timeout (10min) or +# until send-l2 succeeds. -timeout 20m ${GITHUB_WORKSPACE}/test-node.bash --init --detach -sleep 20m -${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait || exit_status=$? +# Start the test node and get PID, to terminate it once send-l2 is done. +${GITHUB_WORKSPACE}/test-node.bash --init > output.log 2>&1 & +PID=$! -if [ -n "$exit_status" ] && [ $exit_status -ne 0 ] && [ $exit_status -ne 124 ]; then - echo "Testnode failed." - exit $exit_status +sleep 5m + +START=$(date +%s) +SUCCEDED=0 + +while true; do + if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then + echo "Sending l2 transaction succeeded" + SUCCEDED=1 + 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 + +# Shut down the test node and wait for it to terminate. +kill $PID +wait $PID + +if [ "$SUCCEDED" -eq 0 ]; then + exit 1 fi -echo "Testnode succeeded." +exit 0 From 32c5f7faa8cf70671b7a148c551c6f7592fb9911 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 20 Mar 2024 11:25:57 +0100 Subject: [PATCH 20/62] Add rollupcreator container --- docker-compose.yaml | 12 ++++++++++++ rollupcreator/Dockerfile | 8 ++++++++ test-node.bash | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 rollupcreator/Dockerfile diff --git a/docker-compose.yaml b/docker-compose.yaml index b84101e1..6c6d2712 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -161,6 +161,7 @@ services: - "l1keystore:/home/user/l1keystore" - "config:/config" - "tokenbridge-data:/tokenbridge-data" + - "rollupcreator-data:/rollupcreator-data" command: --conf.file /config/sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain * depends_on: - geth @@ -336,6 +337,16 @@ services: - "tokenbridge-data:/workspace" - /var/run/docker.sock:/var/run/docker.sock + rollupcreator: + depends_on: + - geth + - sequencer + pid: host + build: rollupcreator/ + volumes: + - "rollupcreator-data:/workspace" + - /var/run/docker.sock:/var/run/docker.sock + volumes: l1data: consensus: @@ -352,3 +363,4 @@ volumes: config: postgres-data: tokenbridge-data: + rollupcreator-data: diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile new file mode 100644 index 00000000..07f59469 --- /dev/null +++ b/rollupcreator/Dockerfile @@ -0,0 +1,8 @@ +FROM node:16-bullseye-slim +RUN apt-get update && \ + apt-get install -y git docker.io python3 build-essential +WORKDIR /workspace +RUN git clone https://github.com/OffchainLabs/nitro-contracts.git ./ +RUN yarn install +RUN yarn build +ENTRYPOINT ["yarn"] diff --git a/test-node.bash b/test-node.bash index a48c61ff..599ca286 100755 --- a/test-node.bash +++ b/test-node.bash @@ -198,7 +198,7 @@ if $dev_build_blockscout; then fi fi -NODES="sequencer" +NODES="sequencer rollupcreator" INITIAL_SEQ_NODES="sequencer" if ! $simple; then From d269f8c03ec57fc2fef23531a9473967d9005501 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 21 Mar 2024 13:57:30 +0100 Subject: [PATCH 21/62] Update Dockerfile --- rollupcreator/Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index 07f59469..8a58ec3b 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -1,8 +1,12 @@ FROM node:16-bullseye-slim RUN apt-get update && \ - apt-get install -y git docker.io python3 build-essential + apt-get install -y git docker.io python3 build-essential curl WORKDIR /workspace -RUN git clone https://github.com/OffchainLabs/nitro-contracts.git ./ +RUN git clone -b testnode-deploy https://github.com/OffchainLabs/nitro-contracts.git ./ +RUN curl -L https://foundry.paradigm.xyz | bash +ENV PATH="${PATH}:/root/.foundry/bin" +RUN foundryup +RUN touch scripts/config.ts RUN yarn install -RUN yarn build +RUN yarn build:all ENTRYPOINT ["yarn"] From bf17161fee94ca48af8fe23e493985c74edb3148 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 21 Mar 2024 13:57:59 +0100 Subject: [PATCH 22/62] Draft rollup creation call --- test-node.bash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index 599ca286..05640a06 100755 --- a/test-node.bash +++ b/test-node.bash @@ -340,8 +340,12 @@ if $force_init; then sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'` l2ownerAddress=`docker compose run scripts print-address --account l2owner | 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 --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://geth:8546 --l1keystore /home/user/l1keystore --sequencerAddress $sequenceraddress --ownerAddress $l2ownerAddress --l1DeployAccount $l2ownerAddress --l1deployment /config/deployment.json --authorizevalidators 10 --wasmrootpath /home/user/target/machines --l1chainid=$l1chainid --l2chainconfig /config/l2_chain_config.json --l2chainname arb-dev-test --l2chaininfo /config/deployed_chain_info.json + sleep 20 + docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey rollupcreator deploy-factory --network testnode_l1 + #docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=$maxDataSize -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x8569CADe473FD633310d7899c0F5025e1F21f664 rollupcreator deploy-eth-rollup --network testnode_l1 + #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://geth:8546 --l1keystore /home/user/l1keystore --sequencerAddress $sequenceraddress --ownerAddress $l2ownerAddress --l1DeployAccount $l2ownerAddress --l1deployment /config/deployment.json --authorizevalidators 10 --wasmrootpath /home/user/target/machines --l1chainid=$l1chainid --l2chainconfig /config/l2_chain_config.json --l2chainname arb-dev-test --l2chaininfo /config/deployed_chain_info.json docker compose run --entrypoint sh sequencer -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" if $simple; then @@ -365,7 +369,6 @@ if $force_init; 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 From ea799293b93a8d5885886df83a4d85367c18ff21 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 26 Mar 2024 13:12:45 +0100 Subject: [PATCH 23/62] Update create rollup call --- test-node.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index 05640a06..27826fff 100755 --- a/test-node.bash +++ b/test-node.bash @@ -342,8 +342,13 @@ if $force_init; then l2ownerAddress=`docker compose run scripts print-address --account l2owner | tail -n 1 | tr -d '\r\n'` l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` - sleep 20 - docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey rollupcreator deploy-factory --network testnode_l1 + echo == Deploying + docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e PARENT_CHAIN_RPC="http://geth:8545" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid rollupcreator create-rollup-testnode + # docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e MAX_DATA_SIZE=117964 rollupcreator deploy-factory --network testnode_l1 + # docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=117964 -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x82A3c114b40ecF1FC34745400A1B9B9115c33d31 rollupcreator deploy-eth-rollup --network testnode_l1 + echo == Deployment done + #docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e MAX_DATA_SIZE=$maxDataSize -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x8569CADe473FD633310d7899c0F5025e1F21f664 rollupcreator deploy-eth-rollup --network testnode_l1 + #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://getrollupcreator deploy-factory --network testnode_l1 #docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=$maxDataSize -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x8569CADe473FD633310d7899c0F5025e1F21f664 rollupcreator deploy-eth-rollup --network testnode_l1 #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://geth:8546 --l1keystore /home/user/l1keystore --sequencerAddress $sequenceraddress --ownerAddress $l2ownerAddress --l1DeployAccount $l2ownerAddress --l1deployment /config/deployment.json --authorizevalidators 10 --wasmrootpath /home/user/target/machines --l1chainid=$l1chainid --l2chainconfig /config/l2_chain_config.json --l2chainname arb-dev-test --l2chaininfo /config/deployed_chain_info.json docker compose run --entrypoint sh sequencer -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" From 8885c423f9789606e40b1b3ec7bd883c096b2e7a Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 27 Mar 2024 11:27:52 +0100 Subject: [PATCH 24/62] Update rollupcreator config --- docker-compose.yaml | 1 + rollupcreator/Dockerfile | 2 +- test-node.bash | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 6c6d2712..85080fa8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -344,6 +344,7 @@ services: pid: host build: rollupcreator/ volumes: + - "config:/config" - "rollupcreator-data:/workspace" - /var/run/docker.sock:/var/run/docker.sock diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index 8a58ec3b..a1764f87 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -1,6 +1,6 @@ FROM node:16-bullseye-slim RUN apt-get update && \ - apt-get install -y git docker.io python3 build-essential curl + apt-get install -y git docker.io python3 build-essential curl jq WORKDIR /workspace RUN git clone -b testnode-deploy https://github.com/OffchainLabs/nitro-contracts.git ./ RUN curl -L https://foundry.paradigm.xyz | bash diff --git a/test-node.bash b/test-node.bash index 27826fff..f8fb63fd 100755 --- a/test-node.bash +++ b/test-node.bash @@ -343,7 +343,7 @@ if $force_init; then l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` echo == Deploying - docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e PARENT_CHAIN_RPC="http://geth:8545" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid rollupcreator create-rollup-testnode + docker compose run -e PARENT_CHAIN_RPC="http://geth:8545" -e DEPLOYER_PRIVKEY=$l2ownerKey -e L1_CHAIN_ID=$l1chainid -e CHILD_CHAIN_NAME="arb-dev-test" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -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" rollupcreator create-rollup-testnode # docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e MAX_DATA_SIZE=117964 rollupcreator deploy-factory --network testnode_l1 # docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=117964 -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x82A3c114b40ecF1FC34745400A1B9B9115c33d31 rollupcreator deploy-eth-rollup --network testnode_l1 echo == Deployment done @@ -351,7 +351,7 @@ if $force_init; then #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://getrollupcreator deploy-factory --network testnode_l1 #docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=$maxDataSize -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x8569CADe473FD633310d7899c0F5025e1F21f664 rollupcreator deploy-eth-rollup --network testnode_l1 #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://geth:8546 --l1keystore /home/user/l1keystore --sequencerAddress $sequenceraddress --ownerAddress $l2ownerAddress --l1DeployAccount $l2ownerAddress --l1deployment /config/deployment.json --authorizevalidators 10 --wasmrootpath /home/user/target/machines --l1chainid=$l1chainid --l2chainconfig /config/l2_chain_config.json --l2chainname arb-dev-test --l2chaininfo /config/deployed_chain_info.json - docker compose run --entrypoint sh sequencer -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" + docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" if $simple; then echo == Writing configs From 999eb3885da7d9181ff15e0214afaa6fc3bc554a Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 27 Mar 2024 14:31:10 +0100 Subject: [PATCH 25/62] Fix command --- test-node.bash | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test-node.bash b/test-node.bash index f8fb63fd..2af6a4a4 100755 --- a/test-node.bash +++ b/test-node.bash @@ -198,7 +198,7 @@ if $dev_build_blockscout; then fi fi -NODES="sequencer rollupcreator" +NODES="sequencer" INITIAL_SEQ_NODES="sequencer" if ! $simple; then @@ -255,7 +255,7 @@ if $force_build; then docker build blockscout -t blockscout -f blockscout/docker/Dockerfile fi fi - LOCAL_BUILD_NODES=scripts + LOCAL_BUILD_NODES="scripts rollupcreator" if $tokenbridge || $l3_token_bridge; then LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" fi @@ -342,15 +342,8 @@ if $force_init; then l2ownerAddress=`docker compose run scripts print-address --account l2owner | tail -n 1 | tr -d '\r\n'` l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` - echo == Deploying - docker compose run -e PARENT_CHAIN_RPC="http://geth:8545" -e DEPLOYER_PRIVKEY=$l2ownerKey -e L1_CHAIN_ID=$l1chainid -e CHILD_CHAIN_NAME="arb-dev-test" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -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" rollupcreator create-rollup-testnode - # docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e MAX_DATA_SIZE=117964 rollupcreator deploy-factory --network testnode_l1 - # docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=117964 -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x82A3c114b40ecF1FC34745400A1B9B9115c33d31 rollupcreator deploy-eth-rollup --network testnode_l1 - echo == Deployment done - #docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e MAX_DATA_SIZE=$maxDataSize -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x8569CADe473FD633310d7899c0F5025e1F21f664 rollupcreator deploy-eth-rollup --network testnode_l1 - #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://getrollupcreator deploy-factory --network testnode_l1 - #docker compose run -e OWNER_ADDRESS=$l2ownerAddress -e MAX_DATA_SIZE=$maxDataSize -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/deployment.json" -e L1_CHAIN_ID=$l1chainid -e DEPLOYER_PRIVKEY=$l2ownerKey -e ROLLUP_CREATOR_ADDRESS=0x8569CADe473FD633310d7899c0F5025e1F21f664 rollupcreator deploy-eth-rollup --network testnode_l1 - #docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://geth:8546 --l1keystore /home/user/l1keystore --sequencerAddress $sequenceraddress --ownerAddress $l2ownerAddress --l1DeployAccount $l2ownerAddress --l1deployment /config/deployment.json --authorizevalidators 10 --wasmrootpath /home/user/target/machines --l1chainid=$l1chainid --l2chainconfig /config/l2_chain_config.json --l2chainname arb-dev-test --l2chaininfo /config/deployed_chain_info.json + 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=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -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" rollupcreator create-rollup-testnode docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" if $simple; then From c3d3d6401e95cb1346edf49de92fd10e7718adaf Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 27 Mar 2024 16:46:37 +0100 Subject: [PATCH 26/62] Adjust l3node creation command --- test-node.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index 2af6a4a4..369d3dad 100755 --- a/test-node.bash +++ b/test-node.bash @@ -402,8 +402,9 @@ if $force_init; then l3owneraddress=`docker compose run scripts print-address --account l3owner | tail -n 1 | tr -d '\r\n'` l3ownerkey=`docker compose run scripts print-private-key --account l3owner | tail -n 1 | tr -d '\r\n'` l3sequenceraddress=`docker compose run scripts print-address --account l3sequencer | tail -n 1 | tr -d '\r\n'` - docker compose run --entrypoint /usr/local/bin/deploy sequencer --l1conn ws://sequencer:8548 --l1keystore /home/user/l1keystore --sequencerAddress $l3sequenceraddress --ownerAddress $l3owneraddress --l1DeployAccount $l3owneraddress --l1deployment /config/l3deployment.json --authorizevalidators 10 --wasmrootpath /home/user/target/machines --l1chainid=412346 --l2chainconfig /config/l3_chain_config.json --l2chainname orbit-dev-test --l2chaininfo /config/deployed_l3_chain_info.json --maxDataSize 104857 $EXTRA_L3_DEPLOY_FLAG - docker compose run --entrypoint sh sequencer -c "jq [.[]] /config/deployed_l3_chain_info.json > /config/l3_chain_info.json" + + docker compose run -e DEPLOYER_PRIVKEY=$l3ownerkey -e PARENT_CHAIN_RPC="http://sequencer:8547" -e PARENT_CHAIN_ID=412346 -e CHILD_CHAIN_NAME="orbit-dev-test" -e MAX_DATA_SIZE=104857 -e OWNER_ADDRESS=$l3owneraddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$l3sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l3_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/l3deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_l3_chain_info.json" rollupcreator create-rollup-testnode + docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_l3_chain_info.json > /config/l3_chain_info.json" echo == Funding l3 funnel and dev key docker compose up --wait l3node sequencer From 7ea4b74d895b29a3f85f3c8a34a126ce07103a6a Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 12:31:25 +0100 Subject: [PATCH 27/62] Fund deployers with fee token --- scripts/ethcommands.ts | 32 ++++++++++++++++++++++++++++++++ scripts/index.ts | 2 ++ test-node.bash | 1 + 3 files changed, 35 insertions(+) diff --git a/scripts/ethcommands.ts b/scripts/ethcommands.ts index 00fdbb15..82eeadbc 100644 --- a/scripts/ethcommands.ts +++ b/scripts/ethcommands.ts @@ -279,6 +279,38 @@ export const createERC20Command = { }, }; +export const transferERC20Command = { + command: "transfer-erc20", + describe: "transfers ERC20 token", + builder: { + token: { + string: true, + describe: "token address", + }, + amount: { + string: true, + describe: "amount to transfer", + }, + from: { + string: true, + describe: "account (see general help)", + }, + to: { + string: true, + describe: "address (see general help)", + }, + }, + handler: async (argv: any) => { + console.log("transfer-erc20"); + + argv.provider = new ethers.providers.WebSocketProvider(argv.l2url); + const account = namedAccount(argv.from).connect(argv.provider); + const tokenContract = new ethers.Contract(argv.token, ERC20.abi, account); + const decimals = await tokenContract.decimals(); + await(await tokenContract.transfer(namedAccount(argv.to).address, ethers.utils.parseUnits(argv.amount, decimals))).wait(); + argv.provider.destroy(); + }, +}; export const sendL1Command = { command: "send-l1", diff --git a/scripts/index.ts b/scripts/index.ts index 9f25c6e2..2fd189f6 100644 --- a/scripts/index.ts +++ b/scripts/index.ts @@ -14,6 +14,7 @@ import { bridgeNativeTokenToL3Command, bridgeToL3Command, createERC20Command, + transferERC20Command, sendL1Command, sendL2Command, sendL3Command, @@ -35,6 +36,7 @@ async function main() { .command(bridgeToL3Command) .command(bridgeNativeTokenToL3Command) .command(createERC20Command) + .command(transferERC20Command) .command(sendL1Command) .command(sendL2Command) .command(sendL3Command) diff --git a/test-node.bash b/test-node.bash index 369d3dad..19232bab 100755 --- a/test-node.bash +++ b/test-node.bash @@ -395,6 +395,7 @@ if $force_init; then if $l3_custom_fee_token; then echo == Deploying custom fee token nativeTokenAddress=`docker compose run scripts create-erc20 --deployer user_fee_token_deployer --mintTo user_token_bridge_deployer --bridgeable $tokenbridge | tail -n 1 | awk '{ print $NF }'` + docker compose run scripts transfer-erc20 --token $nativeTokenAddress --amount 100 --from user_token_bridge_deployer --to l3owner EXTRA_L3_DEPLOY_FLAG="--nativeTokenAddress $nativeTokenAddress" fi From de506e168050693ddc1e60e8747bf7caa74c1344 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 12:38:51 +0100 Subject: [PATCH 28/62] Properly provide fee token arg --- test-node.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index 19232bab..fcb567a8 100755 --- a/test-node.bash +++ b/test-node.bash @@ -396,7 +396,7 @@ if $force_init; then echo == Deploying custom fee token nativeTokenAddress=`docker compose run scripts create-erc20 --deployer user_fee_token_deployer --mintTo user_token_bridge_deployer --bridgeable $tokenbridge | tail -n 1 | awk '{ print $NF }'` docker compose run scripts transfer-erc20 --token $nativeTokenAddress --amount 100 --from user_token_bridge_deployer --to l3owner - EXTRA_L3_DEPLOY_FLAG="--nativeTokenAddress $nativeTokenAddress" + EXTRA_L3_DEPLOY_FLAG="-e FEE_TOKEN_ADDRESS=$nativeTokenAddress" fi echo == Deploying L3 @@ -404,7 +404,7 @@ if $force_init; then l3ownerkey=`docker compose run scripts print-private-key --account l3owner | tail -n 1 | tr -d '\r\n'` l3sequenceraddress=`docker compose run scripts print-address --account l3sequencer | tail -n 1 | tr -d '\r\n'` - docker compose run -e DEPLOYER_PRIVKEY=$l3ownerkey -e PARENT_CHAIN_RPC="http://sequencer:8547" -e PARENT_CHAIN_ID=412346 -e CHILD_CHAIN_NAME="orbit-dev-test" -e MAX_DATA_SIZE=104857 -e OWNER_ADDRESS=$l3owneraddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$l3sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l3_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/l3deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_l3_chain_info.json" rollupcreator create-rollup-testnode + docker compose run -e DEPLOYER_PRIVKEY=$l3ownerkey -e PARENT_CHAIN_RPC="http://sequencer:8547" -e PARENT_CHAIN_ID=412346 -e CHILD_CHAIN_NAME="orbit-dev-test" -e MAX_DATA_SIZE=104857 -e OWNER_ADDRESS=$l3owneraddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$l3sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l3_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/l3deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_l3_chain_info.json" $EXTRA_L3_DEPLOY_FLAG rollupcreator create-rollup-testnode docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_l3_chain_info.json > /config/l3_chain_info.json" echo == Funding l3 funnel and dev key From 3b3ce1a0e417cf7606aedbc7f4132650930a80cc Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 13:14:08 +0100 Subject: [PATCH 29/62] Use latest wasmroot --- test-node.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index fcb567a8..f105842f 100755 --- a/test-node.bash +++ b/test-node.bash @@ -341,9 +341,10 @@ if $force_init; then sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'` l2ownerAddress=`docker compose run scripts print-address --account l2owner | 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=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -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" rollupcreator create-rollup-testnode + 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" rollupcreator create-rollup-testnode docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json" if $simple; then @@ -404,7 +405,7 @@ if $force_init; then l3ownerkey=`docker compose run scripts print-private-key --account l3owner | tail -n 1 | tr -d '\r\n'` l3sequenceraddress=`docker compose run scripts print-address --account l3sequencer | tail -n 1 | tr -d '\r\n'` - docker compose run -e DEPLOYER_PRIVKEY=$l3ownerkey -e PARENT_CHAIN_RPC="http://sequencer:8547" -e PARENT_CHAIN_ID=412346 -e CHILD_CHAIN_NAME="orbit-dev-test" -e MAX_DATA_SIZE=104857 -e OWNER_ADDRESS=$l3owneraddress -e WASM_MODULE_ROOT=0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a -e SEQUENCER_ADDRESS=$l3sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l3_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/l3deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_l3_chain_info.json" $EXTRA_L3_DEPLOY_FLAG rollupcreator create-rollup-testnode + docker compose run -e DEPLOYER_PRIVKEY=$l3ownerkey -e PARENT_CHAIN_RPC="http://sequencer:8547" -e PARENT_CHAIN_ID=412346 -e CHILD_CHAIN_NAME="orbit-dev-test" -e MAX_DATA_SIZE=104857 -e OWNER_ADDRESS=$l3owneraddress -e WASM_MODULE_ROOT=$wasmroot -e SEQUENCER_ADDRESS=$l3sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l3_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/l3deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_l3_chain_info.json" $EXTRA_L3_DEPLOY_FLAG rollupcreator create-rollup-testnode docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_l3_chain_info.json > /config/l3_chain_info.json" echo == Funding l3 funnel and dev key From 6f70432afcd58df6343b4daf6c5399f54a09ffe2 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 14:06:08 +0100 Subject: [PATCH 30/62] Make nitro-contracts branch configurable --- docker-compose.yaml | 5 ++++- rollupcreator/Dockerfile | 3 ++- test-node.bash | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 85080fa8..2eb00ace 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -342,7 +342,10 @@ services: - geth - sequencer pid: host - build: rollupcreator/ + build: + context: rollupcreator/ + args: + NITRO_CONTRACTS_BRANCH: ${NITRO_CONTRACTS_BRANCH:-main} volumes: - "config:/config" - "rollupcreator-data:/workspace" diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index a1764f87..51f012e8 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -1,8 +1,9 @@ FROM node:16-bullseye-slim +ARG NITRO_CONTRACTS_BRANCH=main RUN apt-get update && \ apt-get install -y git docker.io python3 build-essential curl jq WORKDIR /workspace -RUN git clone -b testnode-deploy https://github.com/OffchainLabs/nitro-contracts.git ./ +RUN git clone -b ${NITRO_CONTRACTS_BRANCH} https://github.com/OffchainLabs/nitro-contracts.git ./ RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="${PATH}:/root/.foundry/bin" RUN foundryup diff --git a/test-node.bash b/test-node.bash index f105842f..ad2737cf 100755 --- a/test-node.bash +++ b/test-node.bash @@ -255,6 +255,10 @@ if $force_build; then docker build blockscout -t blockscout -f blockscout/docker/Dockerfile fi fi + + NITRO_CONTRACTS_BRANCH="testnode-deploy" + export NITRO_CONTRACTS_BRANCH + LOCAL_BUILD_NODES="scripts rollupcreator" if $tokenbridge || $l3_token_bridge; then LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" From 8246819e19251255f9698b0f9e8878d1b791e2c2 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 18:03:07 +0100 Subject: [PATCH 31/62] Temp change for test --- scripts/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config.ts b/scripts/config.ts index 23ecff4f..2efba172 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -182,7 +182,7 @@ function writeConfigs(argv: any) { "sequencer": false, "dangerous": { "no-sequencer-coordinator": false, - "disable-blob-reader": true, + // "disable-blob-reader": true, }, "delayed-sequencer": { "enable": false From 00862c2b157a617c238bd0669055ae79fe991030 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 18:20:20 +0100 Subject: [PATCH 32/62] Add option to customize token bridge branch --- docker-compose.yaml | 5 ++++- tokenbridge/Dockerfile | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 2eb00ace..27b61677 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -329,7 +329,10 @@ services: - geth - sequencer pid: host - build: tokenbridge/ + build: + context: tokenbridge/ + args: + TOKEN_BRIDGE_BRANCH: ${TOKEN_BRIDGE_BRANCH:-main} environment: - ARB_URL=http://sequencer:8547 - ETH_URL=http://geth:8545 diff --git a/tokenbridge/Dockerfile b/tokenbridge/Dockerfile index 344e537d..ed53eae2 100644 --- a/tokenbridge/Dockerfile +++ b/tokenbridge/Dockerfile @@ -1,8 +1,9 @@ FROM node:16-bullseye-slim +ARG TOKEN_BRIDGE_BRANCH=main RUN apt-get update && \ apt-get install -y git docker.io python3 build-essential WORKDIR /workspace -RUN git clone https://github.com/OffchainLabs/token-bridge-contracts.git ./ +RUN git clone -b ${TOKEN_BRIDGE_BRANCH} https://github.com/OffchainLabs/token-bridge-contracts.git ./ RUN yarn install RUN yarn build ENTRYPOINT ["yarn"] From 4197b54121141715155bc0a2c39caf4be5ec3516 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 28 Mar 2024 18:59:25 +0100 Subject: [PATCH 33/62] Unused --- docker-compose.yaml | 3 --- test-node.bash | 3 --- 2 files changed, 6 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 27b61677..a93662e7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -161,7 +161,6 @@ services: - "l1keystore:/home/user/l1keystore" - "config:/config" - "tokenbridge-data:/tokenbridge-data" - - "rollupcreator-data:/rollupcreator-data" command: --conf.file /config/sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain * depends_on: - geth @@ -351,7 +350,6 @@ services: NITRO_CONTRACTS_BRANCH: ${NITRO_CONTRACTS_BRANCH:-main} volumes: - "config:/config" - - "rollupcreator-data:/workspace" - /var/run/docker.sock:/var/run/docker.sock volumes: @@ -370,4 +368,3 @@ volumes: config: postgres-data: tokenbridge-data: - rollupcreator-data: diff --git a/test-node.bash b/test-node.bash index ad2737cf..89b3b857 100755 --- a/test-node.bash +++ b/test-node.bash @@ -256,9 +256,6 @@ if $force_build; then fi fi - NITRO_CONTRACTS_BRANCH="testnode-deploy" - export NITRO_CONTRACTS_BRANCH - LOCAL_BUILD_NODES="scripts rollupcreator" if $tokenbridge || $l3_token_bridge; then LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" From f82e25c80ad947b616c9db8e9df689e4a1c83cb3 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Thu, 18 Apr 2024 21:30:51 -0300 Subject: [PATCH 34/62] fix relay service --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index b84101e1..ee8eb4b9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -320,8 +320,8 @@ services: image: nitro-node-dev-testnode ports: - "127.0.0.1:9652:9652" - entrypoint: bin/relay - command: --node.feed.output.port 9652 --node.feed.input.url ws://sequencer:9652 + entrypoint: /usr/local/bin/relay + command: --chain.id 412346 --node.feed.input.url ws://sequencer:9642 --node.feed.output.port 9652 tokenbridge: depends_on: From 6172c4d43032ed63cef53e10f51fc74fc45b58fa Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Fri, 19 Apr 2024 15:55:24 -0600 Subject: [PATCH 35/62] update nitro version --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index a48c61ff..440aea7f 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v2.2.2-8f33fea-dev +NITRO_NODE_VERSION=offchainlabs/nitro-node:v2.3.3-6a1c1a7-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 mydir=`dirname $0` From a2bad35144d935cf1406572c7ef8050076070c70 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Fri, 19 Apr 2024 15:55:48 -0600 Subject: [PATCH 36/62] add init-force option that isn't interactive --- test-node.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test-node.bash b/test-node.bash index 440aea7f..1e8506a6 100755 --- a/test-node.bash +++ b/test-node.bash @@ -54,6 +54,10 @@ while [[ $# -gt 0 ]]; do fi shift ;; + --init-force) + force_init=true + shift + ;; --dev) simple=false shift From b493760ae38f5fb38e0392638877be04b5f24a5c Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Fri, 19 Apr 2024 15:56:36 -0600 Subject: [PATCH 37/62] fix ci script --- .github/workflows/testnode.bash | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 258a47c6..29525cb0 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -3,10 +3,9 @@ # until send-l2 succeeds. # Start the test node and get PID, to terminate it once send-l2 is done. -${GITHUB_WORKSPACE}/test-node.bash --init > output.log 2>&1 & -PID=$! +cd ${GITHUB_WORKSPACE} -sleep 5m +./test-node.bash --init-force --detach START=$(date +%s) SUCCEDED=0 @@ -29,11 +28,10 @@ while true; do sleep 10 done -# Shut down the test node and wait for it to terminate. -kill $PID -wait $PID +docker-compose stop if [ "$SUCCEDED" -eq 0 ]; then + docker-compose logs exit 1 fi From c258219d9db16f52639d2ae19d5f6f66e690e5a1 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 23 Apr 2024 11:15:42 +0200 Subject: [PATCH 38/62] Separate checkout step --- rollupcreator/Dockerfile | 3 ++- tokenbridge/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index 51f012e8..17b065a9 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -3,7 +3,8 @@ ARG NITRO_CONTRACTS_BRANCH=main RUN apt-get update && \ apt-get install -y git docker.io python3 build-essential curl jq WORKDIR /workspace -RUN git clone -b ${NITRO_CONTRACTS_BRANCH} https://github.com/OffchainLabs/nitro-contracts.git ./ +RUN git clone --no-checkout https://github.com/OffchainLabs/nitro-contracts.git ./ +RUN git checkout ${NITRO_CONTRACTS_BRANCH} RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="${PATH}:/root/.foundry/bin" RUN foundryup diff --git a/tokenbridge/Dockerfile b/tokenbridge/Dockerfile index ed53eae2..3d8cbacb 100644 --- a/tokenbridge/Dockerfile +++ b/tokenbridge/Dockerfile @@ -3,7 +3,8 @@ ARG TOKEN_BRIDGE_BRANCH=main RUN apt-get update && \ apt-get install -y git docker.io python3 build-essential WORKDIR /workspace -RUN git clone -b ${TOKEN_BRIDGE_BRANCH} https://github.com/OffchainLabs/token-bridge-contracts.git ./ +RUN git clone --no-checkout https://github.com/OffchainLabs/token-bridge-contracts.git ./ +RUN git checkout ${TOKEN_BRIDGE_BRANCH} RUN yarn install RUN yarn build ENTRYPOINT ["yarn"] From fb6eac390df36ff432051019197f32cc2b303865 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 23 Apr 2024 11:34:14 +0200 Subject: [PATCH 39/62] Disable blobs --- scripts/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config.ts b/scripts/config.ts index 2efba172..23ecff4f 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -182,7 +182,7 @@ function writeConfigs(argv: any) { "sequencer": false, "dangerous": { "no-sequencer-coordinator": false, - // "disable-blob-reader": true, + "disable-blob-reader": true, }, "delayed-sequencer": { "enable": false From 2d516bcf547eb762d916bc724cb5c838cf6c8ffd Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 23 Apr 2024 12:50:48 +0200 Subject: [PATCH 40/62] Temporary use custom nitro-contracts branch 'e2e-to-ci' 'e2e-to-ci' implements support for testnode to use custom nitro-contracts branches Once 'e2e-to-ci' is in master, 'NITRO_CONTRACTS_BRANCH' env var can be removed from CI --- .github/workflows/testnode.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 29525cb0..1ebfd6af 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -5,7 +5,8 @@ # Start the test node and get PID, to terminate it once send-l2 is done. cd ${GITHUB_WORKSPACE} -./test-node.bash --init-force --detach +# TODO once e2e-to-ci is merged into master, remove the NITRO_CONTRACTS_BRANCH env var +NITRO_CONTRACTS_BRANCH=e2e-to-ci ./test-node.bash --init-force --detach START=$(date +%s) SUCCEDED=0 From 8f9881cadad437a4c52e6fe839907e81ab15271a Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 23 Apr 2024 13:19:50 +0200 Subject: [PATCH 41/62] Use nitro-contract's develop temporary --- .github/workflows/testnode.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index 1ebfd6af..9ce69348 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -5,8 +5,8 @@ # Start the test node and get PID, to terminate it once send-l2 is done. cd ${GITHUB_WORKSPACE} -# TODO once e2e-to-ci is merged into master, remove the NITRO_CONTRACTS_BRANCH env var -NITRO_CONTRACTS_BRANCH=e2e-to-ci ./test-node.bash --init-force --detach +# TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var +NITRO_CONTRACTS_BRANCH=develop ./test-node.bash --init-force --detach START=$(date +%s) SUCCEDED=0 From 138c4d1ff38b46a52ce3d2c32cfc1e1c7c50a120 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Thu, 25 Apr 2024 11:50:08 -0300 Subject: [PATCH 42/62] enable poster's output feed --- docker-compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index ee8eb4b9..f72973d2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -229,11 +229,12 @@ services: ports: - "127.0.0.1:8147:8547" - "127.0.0.1:8148:8548" + - "127.0.0.1:9800:9800" volumes: - "poster-data:/home/user/.arbitrum/local/nitro" - "l1keystore:/home/user/l1keystore" - "config:/config" - command: --conf.file /config/poster_config.json + command: --conf.file /config/poster_config.json --node.feed.output.enable --node.feed.output.port 9800 depends_on: - geth - redis From 04ada288994aed98abbbdb9fe9c60b5493e77c96 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 26 Apr 2024 14:33:23 +0200 Subject: [PATCH 43/62] Set default contracts versions in the test-node.bash --- docker-compose.yaml | 4 ++-- test-node.bash | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index a93662e7..3d4ad9b9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -331,7 +331,7 @@ services: build: context: tokenbridge/ args: - TOKEN_BRIDGE_BRANCH: ${TOKEN_BRIDGE_BRANCH:-main} + TOKEN_BRIDGE_BRANCH: ${TOKEN_BRIDGE_BRANCH:-} environment: - ARB_URL=http://sequencer:8547 - ETH_URL=http://geth:8545 @@ -347,7 +347,7 @@ services: build: context: rollupcreator/ args: - NITRO_CONTRACTS_BRANCH: ${NITRO_CONTRACTS_BRANCH:-main} + NITRO_CONTRACTS_BRANCH: ${NITRO_CONTRACTS_BRANCH:-} volumes: - "config:/config" - /var/run/docker.sock:/var/run/docker.sock diff --git a/test-node.bash b/test-node.bash index 79fd3006..8776d451 100755 --- a/test-node.bash +++ b/test-node.bash @@ -5,6 +5,20 @@ set -e NITRO_NODE_VERSION=offchainlabs/nitro-node:v2.3.3-6a1c1a7-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 +# This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. +# Once v1.2.2 is released, we can switch to that version. +DEFAULT_NITRO_CONTRACTS_VERSION="2e8eeb9f28104465de0557851aa7607b037cafcf" +DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.1" + +# Set default versions if not overriden by provided env vars +: ${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" From 5efefbedde2febc602c89dedeb71cfb601f285a1 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 26 Apr 2024 14:58:25 +0200 Subject: [PATCH 44/62] Use default version --- .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 9ce69348..b6d1f596 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 -NITRO_CONTRACTS_BRANCH=develop ./test-node.bash --init-force --detach +./test-node.bash --init-force --detach START=$(date +%s) SUCCEDED=0 From c88e2ed9fce3ef1c4baf814f1c95ca7ad44bf55c Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 6 May 2024 19:20:47 -0600 Subject: [PATCH 45/62] update blockscout pin --- blockscout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockscout b/blockscout index c8db5b1b..8419b9c5 160000 --- a/blockscout +++ b/blockscout @@ -1 +1 @@ -Subproject commit c8db5b1bb99b31f7348e6f760ba6dd22643c725a +Subproject commit 8419b9c5a47ec165c8892fa8ba48689fc0b163af From b42aae0ae353039edc8dd531556394b5d94270a7 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 8 May 2024 15:12:39 +0200 Subject: [PATCH 46/62] Bump default nitro-contracts version to include fix for a blocker Fix: https://github.com/OffchainLabs/nitro-contracts/commit/a00d2faac01e050339ff7b0ac5bc91df06e8dbff --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 8776d451..0b5f3d85 100755 --- a/test-node.bash +++ b/test-node.bash @@ -7,7 +7,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 # This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. # Once v1.2.2 is released, we can switch to that version. -DEFAULT_NITRO_CONTRACTS_VERSION="2e8eeb9f28104465de0557851aa7607b037cafcf" +DEFAULT_NITRO_CONTRACTS_VERSION="a00d2faac01e050339ff7b0ac5bc91df06e8dbff" DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.1" # Set default versions if not overriden by provided env vars From 74bbb975bb29bbc1ec6c79dc3545977e113e9183 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Thu, 23 May 2024 18:51:54 -0300 Subject: [PATCH 47/62] Revert "enable poster's output feed" This reverts commit 138c4d1ff38b46a52ce3d2c32cfc1e1c7c50a120. --- docker-compose.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f72973d2..ee8eb4b9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -229,12 +229,11 @@ services: ports: - "127.0.0.1:8147:8547" - "127.0.0.1:8148:8548" - - "127.0.0.1:9800:9800" volumes: - "poster-data:/home/user/.arbitrum/local/nitro" - "l1keystore:/home/user/l1keystore" - "config:/config" - command: --conf.file /config/poster_config.json --node.feed.output.enable --node.feed.output.port 9800 + command: --conf.file /config/poster_config.json depends_on: - geth - redis From b97efc43c62588ea6430627f033700554f4fbe23 Mon Sep 17 00:00:00 2001 From: ariskk Date: Mon, 27 May 2024 12:47:57 +0100 Subject: [PATCH 48/62] Fix typo in --l3node flag in test-node.bash options --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 0b5f3d85..3f0e4ae6 100755 --- a/test-node.bash +++ b/test-node.bash @@ -182,7 +182,7 @@ while [[ $# -gt 0 ]]; do echo --init remove all data, rebuild, deploy new rollup echo --pos l1 is a proof-of-stake chain \(using prysm for consensus\) echo --validate heavy computation, validating all blocks in WASM - echo --l3-node deploys an L3 node on top of the L2 + echo --l3node deploys an L3 node on top of the L2 echo --l3-fee-token L3 chain is set up to use custom fee token. Only valid if also '--l3node' is provided echo --l3-token-bridge Deploy L2-L3 token bridge. Only valid if also '--l3node' is provided echo --batchposters batch posters [0-3] From 1f83198a8f8b7cdebbd99421c0a1626bb7e9b712 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 10 Jun 2024 11:24:33 -0600 Subject: [PATCH 49/62] use nitro 3.0 and arbos v30 --- scripts/config.ts | 4 ++-- test-node.bash | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index 23ecff4f..3fd49ef5 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -344,7 +344,7 @@ function writeL2ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 11, + "InitialArbOSVersion": 30, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } @@ -377,7 +377,7 @@ function writeL3ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 11, + "InitialArbOSVersion": 30, "InitialChainOwner": "0x0000000000000000000000000000000000000000", "GenesisBlockNum": 0 } diff --git a/test-node.bash b/test-node.bash index 0b5f3d85..50041423 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v2.3.3-6a1c1a7-dev +NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.0-e6f81cb-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 # This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. From 014b44e0bfe35d9ead344254fe64ba1ddf66613c Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 10 Jun 2024 11:36:21 -0600 Subject: [PATCH 50/62] update readme for by-default stylus --- README.md | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 45665ca8..e8c3983d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Nitro Testnode -Nitro-testnode brings up a full environment for local nitro testing (with or without Stylus support) including a dev-mode geth L1, and multiple instances with different roles. +Nitro-testnode brings up a full environment for local nitro testing (with Stylus support) including a dev-mode geth L1, and multiple instances with different roles. ### Requirements @@ -11,8 +11,6 @@ All must be installed in PATH. ## Using latest nitro release (recommended) -### Without Stylus support - Check out the release branch of the repository. > Notice: release branch may be force-pushed at any time. @@ -29,30 +27,12 @@ Initialize the node ``` To see more options, use `--help`. -### With Stylus support - -Check out the stylus branch of the repository. -> Notice: stylus branch may be force-pushed at any time. - -```bash -git clone -b stylus --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git -cd nitro-testnode -``` - -Initialize the node - -```bash -./test-node.bash --init -``` -To see more options, use `--help`. - ## Using current nitro code (local compilation) -Check out the nitro or stylus repository. Use the test-node submodule of nitro repository. +Check out the nitro repository. Use the test-node submodule of nitro repository. > Notice: testnode may not always be up-to-date with config options of current nitro node, and is not considered stable when operated in that way. -### Without Stylus support ```bash git clone --recurse-submodules https://github.com/OffchainLabs/nitro.git cd nitro/nitro-testnode @@ -64,18 +44,6 @@ Initialize the node in dev-mode (this will build the docker images from source) ``` To see more options, use `--help`. -### With Stylus support -```bash -git clone --recurse-submodules https://github.com/OffchainLabs/stylus.git -cd stylus/nitro-testnode -``` - -Initialize the node in dev-mode (this will build the docker images from source) -```bash -./test-node.bash --init --dev -``` -To see more options, use `--help`. - ## Further information ### Working with docker containers From dec82b6c9f4b64e0e2414c55e202b4e9ce849440 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 10 Jun 2024 15:45:57 -0600 Subject: [PATCH 51/62] docker-compose: use nitro entrypoint fort testnode we don't need the split-val entry --- docker-compose.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 12895609..f889cb11 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -152,6 +152,7 @@ services: sequencer: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8547:8547" - "127.0.0.1:8548:8548" @@ -168,6 +169,7 @@ services: sequencer_b: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8647:8547" - "127.0.0.1:8648:8548" @@ -182,6 +184,7 @@ services: sequencer_c: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8747:8547" - "127.0.0.1:8748:8548" @@ -196,6 +199,7 @@ services: sequencer_d: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8847:8547" - "127.0.0.1:8848:8548" @@ -210,6 +214,7 @@ services: staker-unsafe: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8047:8547" - "127.0.0.1:8048:8548" @@ -226,6 +231,7 @@ services: poster: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8147:8547" - "127.0.0.1:8148:8548" @@ -241,6 +247,7 @@ services: poster_b: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:9147:8547" - "127.0.0.1:9148:8548" @@ -256,6 +263,7 @@ services: poster_c: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:9247:8547" - "127.0.0.1:9248:8548" @@ -271,6 +279,7 @@ services: validator: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8247:8547" - "127.0.0.1:8248:8548" @@ -286,6 +295,7 @@ services: l3node: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:3347:3347" - "127.0.0.1:3348:3348" @@ -301,6 +311,7 @@ services: validation_node: pid: host # allow debugging image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:8949:8549" volumes: @@ -318,6 +329,7 @@ services: relay: pid: host image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:9652:9652" entrypoint: /usr/local/bin/relay From 22ecaea53ba2b37536f880269a7ae846d0fba3d2 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 10 Jun 2024 16:31:26 -0600 Subject: [PATCH 52/62] fix docker-compose --- docker-compose.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f889cb11..e21e1cf6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -317,7 +317,6 @@ services: volumes: - "config:/config" command: --conf.file /config/validation_node_config.json - entrypoint: /usr/local/bin/nitro-val scripts: build: scripts/ @@ -332,7 +331,6 @@ services: entrypoint: /usr/local/bin/nitro ports: - "127.0.0.1:9652:9652" - entrypoint: /usr/local/bin/relay command: --chain.id 412346 --node.feed.input.url ws://sequencer:9642 --node.feed.output.port 9652 tokenbridge: From ff0e517d4d9a7b6800c8c2a9e5a2b388667d8335 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Fri, 14 Jun 2024 08:57:55 -0600 Subject: [PATCH 53/62] return to nitro 2.3.3 --- scripts/config.ts | 4 ++-- test-node.bash | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index 3fd49ef5..d9d895c7 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -344,7 +344,7 @@ function writeL2ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 30, + "InitialArbOSVersion": 20, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } @@ -377,7 +377,7 @@ function writeL3ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 30, + "InitialArbOSVersion": 20, "InitialChainOwner": "0x0000000000000000000000000000000000000000", "GenesisBlockNum": 0 } diff --git a/test-node.bash b/test-node.bash index 89d18ddc..3f0e4ae6 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.0-e6f81cb-dev +NITRO_NODE_VERSION=offchainlabs/nitro-node:v2.3.3-6a1c1a7-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 # This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. From 962d6c048ebdbd92a7b9aaf5c798307d565ace54 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Mon, 17 Jun 2024 14:24:43 +0200 Subject: [PATCH 54/62] Deploy CacheManager on L2 --- test-node.bash | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test-node.bash b/test-node.bash index 3f0e4ae6..43ae9fab 100755 --- a/test-node.bash +++ b/test-node.bash @@ -354,11 +354,12 @@ if $force_init; then 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 write-l2-chain-config + docker compose run scripts --l2owner $l2ownerAddress write-l2-chain-config sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'` - l2ownerAddress=`docker compose run scripts print-address --account l2owner | 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"` @@ -381,7 +382,7 @@ if $force_init; then 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 bridge-funds --ethamount 1000 --wait --from "key_0x$devprivkey" + docker compose run scripts send-l2 --ethamount 100 --to l2owner --wait if $tokenbridge; then echo == Deploying L1-L2 token bridge @@ -392,6 +393,10 @@ if $force_init; then 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 + + if $l3node; then echo == Funding l3 users docker compose run scripts send-l2 --ethamount 1000 --to l3owner --wait From a294ad319cde1f250d5fc6b9eb85daafca30530c Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 17 Jun 2024 08:59:48 -0600 Subject: [PATCH 55/62] re-enable stylus on 3.0.1-rc.2 --- scripts/config.ts | 4 ++-- test-node.bash | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index d9d895c7..3fd49ef5 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -344,7 +344,7 @@ function writeL2ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 20, + "InitialArbOSVersion": 30, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } @@ -377,7 +377,7 @@ function writeL3ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 20, + "InitialArbOSVersion": 30, "InitialChainOwner": "0x0000000000000000000000000000000000000000", "GenesisBlockNum": 0 } diff --git a/test-node.bash b/test-node.bash index 3f0e4ae6..8958bb4d 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v2.3.3-6a1c1a7-dev +NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-rc.2-cf4b74e-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 # This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. From 365e01e9ab5940583e5c26f4f73399dddcc2cf83 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 17 Jun 2024 09:21:52 -0600 Subject: [PATCH 56/62] fix wrongfully changed entry-points --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index e21e1cf6..0287f4be 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -311,7 +311,7 @@ services: validation_node: pid: host # allow debugging image: nitro-node-dev-testnode - entrypoint: /usr/local/bin/nitro + entrypoint: /usr/local/bin/nitro-val ports: - "127.0.0.1:8949:8549" volumes: @@ -328,7 +328,7 @@ services: relay: pid: host image: nitro-node-dev-testnode - entrypoint: /usr/local/bin/nitro + entrypoint: /usr/local/bin/relay ports: - "127.0.0.1:9652:9652" command: --chain.id 412346 --node.feed.input.url ws://sequencer:9642 --node.feed.output.port 9652 From d389fbcca42429ea4e8204c1c65b2e8a48013b32 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Mon, 17 Jun 2024 10:38:31 -0600 Subject: [PATCH 57/62] nitro 3.0.1 released --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 8958bb4d..2ad9109f 100755 --- a/test-node.bash +++ b/test-node.bash @@ -2,7 +2,7 @@ set -e -NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-rc.2-cf4b74e-dev +NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-cf4b74e-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 # This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. From caa897c8a77bb9a4ac3b2330c6c28bd5b66a5a45 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 18 Jun 2024 09:29:10 +0200 Subject: [PATCH 58/62] Deploy CacheManager to L3 --- scripts/config.ts | 2 +- test-node.bash | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index 3fd49ef5..eefcdd29 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -378,7 +378,7 @@ function writeL3ChainConfig(argv: any) { "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, "InitialArbOSVersion": 30, - "InitialChainOwner": "0x0000000000000000000000000000000000000000", + "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } } diff --git a/test-node.bash b/test-node.bash index 1f870b70..cda10490 100755 --- a/test-node.bash +++ b/test-node.bash @@ -415,7 +415,9 @@ if $force_init; then docker compose run scripts send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_fee_token_deployer --wait --delay 500 --times 1000000 > /dev/null & echo == Writing l3 chain config - docker compose run scripts write-l3-chain-config + l3owneraddress=`docker compose run scripts print-address --account l3owner | tail -n 1 | tr -d '\r\n'` + echo l3owneraddress $l3owneraddress + docker compose run scripts --l2owner $l3owneraddress write-l3-chain-config if $l3_custom_fee_token; then echo == Deploying custom fee token @@ -425,7 +427,6 @@ if $force_init; then fi echo == Deploying L3 - l3owneraddress=`docker compose run scripts print-address --account l3owner | tail -n 1 | tr -d '\r\n'` l3ownerkey=`docker compose run scripts print-private-key --account l3owner | tail -n 1 | tr -d '\r\n'` l3sequenceraddress=`docker compose run scripts print-address --account l3sequencer | tail -n 1 | tr -d '\r\n'` @@ -457,8 +458,12 @@ if $force_init; then docker compose run scripts send-l3 --ethamount 500 --from user_token_bridge_deployer --to "key_0x$devprivkey" --wait else docker compose run scripts bridge-to-l3 --ethamount 50000 --wait - docker compose run scripts bridge-to-l3 --ethamount 500 --wait --from "key_0x$devprivkey" fi + docker compose run scripts send-l3 --ethamount 100 --to l3owner --wait + + + echo == Deploy CacheManager on L3 + docker compose run -e CHILD_CHAIN_RPC="http://l3node:3347" -e CHAIN_OWNER_PRIVKEY=$l3ownerkey rollupcreator deploy-cachemanager-testnode fi fi From 703bf6abce790a3f538f8ea970d5aea0a9a813b6 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 18 Jun 2024 09:37:01 +0200 Subject: [PATCH 59/62] Bump nitro-contracts to support CacheManager deployment --- test-node.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index cda10490..d18a5c33 100755 --- a/test-node.bash +++ b/test-node.bash @@ -5,9 +5,9 @@ set -e NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.0.1-cf4b74e-dev BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.0.0-c8db5b1 -# This commit matches the v1.2.1 contracts, with additional fixes for rollup deployment script. +# This commit matches the v1.2.1 contracts, with additional support for CacheManger deployment. # Once v1.2.2 is released, we can switch to that version. -DEFAULT_NITRO_CONTRACTS_VERSION="a00d2faac01e050339ff7b0ac5bc91df06e8dbff" +DEFAULT_NITRO_CONTRACTS_VERSION="867663657b98a66b60ff244e46226e0cb368ab94" DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.1" # Set default versions if not overriden by provided env vars From f223401855a3a047aee3a5ba4cc95a125b360a92 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 18 Jun 2024 09:41:29 +0200 Subject: [PATCH 60/62] Format --- test-node.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index d18a5c33..dd112c95 100755 --- a/test-node.bash +++ b/test-node.bash @@ -461,7 +461,6 @@ if $force_init; then fi docker compose run scripts send-l3 --ethamount 100 --to l3owner --wait - echo == Deploy CacheManager on L3 docker compose run -e CHILD_CHAIN_RPC="http://l3node:3347" -e CHAIN_OWNER_PRIVKEY=$l3ownerkey rollupcreator deploy-cachemanager-testnode From 89b4cbc8d52616a86f82d66f5ee4947a7ea21bcd Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Fri, 21 Jun 2024 15:07:55 -0300 Subject: [PATCH 61/62] Removes deprecated version field from docker-compose --- docker-compose.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0287f4be..81deb6d1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: blockscout: depends_on: From 9d527abe7c8215cee1308730d3cd8a05997ed223 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Fri, 21 Jun 2024 15:36:20 -0300 Subject: [PATCH 62/62] Runs CI with l3node and no-simple --- .github/workflows/testnode.bash | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash index b6d1f596..0e57e13d 100755 --- a/.github/workflows/testnode.bash +++ b/.github/workflows/testnode.bash @@ -1,20 +1,35 @@ #!/bin/bash -# The script starts up the test node and waits until the timeout (10min) or +# 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} # TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var -./test-node.bash --init-force --detach +./test-node.bash --init-force --l3node --no-simple --detach START=$(date +%s) -SUCCEDED=0 +L2_TRANSACTION_SUCCEEDED=false +L3_TRANSACTION_SUCCEEDED=false +SUCCEEDED=false while true; do - if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then - echo "Sending l2 transaction succeeded" - SUCCEDED=1 + if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then + if ${GITHUB_WORKSPACE}/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 [ "$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 @@ -31,7 +46,7 @@ done docker-compose stop -if [ "$SUCCEDED" -eq 0 ]; then +if [ "$SUCCEEDED" = false ]; then docker-compose logs exit 1 fi