From cab5714f9ae0993e92f2e3b7f120c5e55404181d Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:12:14 -0500 Subject: [PATCH 1/8] fix null string weth address caused by token bridge sdk dep bump --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 88274640..bc202914 100755 --- a/test-node.bash +++ b/test-node.bash @@ -645,7 +645,7 @@ if $force_init; then if $tokenbridge; then # we deployed an L1 L2 token bridge # we need to pull out the L2 WETH address and pass it as an override to the L2 L3 token bridge deployment - l2Weth=`docker compose run --entrypoint sh tokenbridge -c "cat l1l2_network.json" | jq -r '.l2Network.tokenBridge.l2Weth'` + l2Weth=`docker compose run --entrypoint sh tokenbridge -c "cat l1l2_network.json" | jq -r '.l2Network.tokenBridge.childWeth'` fi docker compose run -e PARENT_WETH_OVERRIDE=$l2Weth -e ROLLUP_OWNER_KEY=$l3ownerkey -e ROLLUP_ADDRESS=$rollupAddress -e PARENT_RPC=http://sequencer:8547 -e PARENT_KEY=$deployer_key -e CHILD_RPC=http://l3node:3347 -e CHILD_KEY=$deployer_key tokenbridge deploy:local:token-bridge docker compose run --entrypoint sh tokenbridge -c "cat network.json && cp network.json l2l3_network.json" From 39869a1f535c717cff34387b78edda43cc98d054 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:24:21 -0500 Subject: [PATCH 2/8] update default token bridge version --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index bc202914..2e5ffb8d 100755 --- a/test-node.bash +++ b/test-node.bash @@ -9,7 +9,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8 # 1. authorizing validator signer key since validator wallet is buggy # - gas estimation sent from 0x0000 lead to balance and permission error DEFAULT_NITRO_CONTRACTS_VERSION="v3.1.0" -DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.2" +DEFAULT_TOKEN_BRIDGE_VERSION="bf88aa953ecee3dce4008c49d2e9d6f2f07e1cc0" # todo: replace with a tag when available # Set default versions if not overriden by provided env vars : ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION} From dc28df9ea6af9051dc438066137bdc3db62e1a37 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Thu, 31 Jul 2025 14:20:09 -0600 Subject: [PATCH 3/8] fix token transfer script --- scripts/ethcommands.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ethcommands.ts b/scripts/ethcommands.ts index bf54d384..d042532a 100644 --- a/scripts/ethcommands.ts +++ b/scripts/ethcommands.ts @@ -411,8 +411,8 @@ export const createERC20Command = { .toString() ); - const l1GatewayRouter = new ethers.Contract(l1l2tokenbridge.l2Network.tokenBridge.l1GatewayRouter, L1GatewayRouter.abi, deployerWallet); - await (await token.functions.approve(l1l2tokenbridge.l2Network.tokenBridge.l1ERC20Gateway, ethers.constants.MaxUint256)).wait(); + const l1GatewayRouter = new ethers.Contract(l1l2tokenbridge.l2Network.tokenBridge.parentGatewayRouter, L1GatewayRouter.abi, deployerWallet); + await (await token.functions.approve(l1l2tokenbridge.l2Network.tokenBridge.parentErc20Gateway, ethers.constants.MaxUint256)).wait(); const supply = await token.totalSupply(); // transfer 90% of supply to l2 const transferAmount = supply.mul(9).div(10); From fed1d70e7b8505164c1471d70c79d83a1f734d8e Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 5 Aug 2025 15:47:27 +0100 Subject: [PATCH 4/8] Update token-bridge-contracts tag --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 2e5ffb8d..735f2f87 100755 --- a/test-node.bash +++ b/test-node.bash @@ -9,7 +9,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8 # 1. authorizing validator signer key since validator wallet is buggy # - gas estimation sent from 0x0000 lead to balance and permission error DEFAULT_NITRO_CONTRACTS_VERSION="v3.1.0" -DEFAULT_TOKEN_BRIDGE_VERSION="bf88aa953ecee3dce4008c49d2e9d6f2f07e1cc0" # todo: replace with a tag when available +DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.4" # Set default versions if not overriden by provided env vars : ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION} From 3ba730806b364fa0d68101d977f7d395a9fc872e Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 5 Aug 2025 08:17:20 -0700 Subject: [PATCH 5/8] use ha/fix-missing-network-props --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 735f2f87..5ec3ecf1 100755 --- a/test-node.bash +++ b/test-node.bash @@ -9,7 +9,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8 # 1. authorizing validator signer key since validator wallet is buggy # - gas estimation sent from 0x0000 lead to balance and permission error DEFAULT_NITRO_CONTRACTS_VERSION="v3.1.0" -DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.4" +DEFAULT_TOKEN_BRIDGE_VERSION="ha/fix-missing-network-props" # Set default versions if not overriden by provided env vars : ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION} From 6a93346fc4e1a0b493a7d4e911ffcefcde8fd0ff Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 6 Aug 2025 12:09:23 -0700 Subject: [PATCH 6/8] set default token bridge to 1.2.5 --- test-node.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 5ec3ecf1..4aa8aa74 100755 --- a/test-node.bash +++ b/test-node.bash @@ -9,7 +9,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8 # 1. authorizing validator signer key since validator wallet is buggy # - gas estimation sent from 0x0000 lead to balance and permission error DEFAULT_NITRO_CONTRACTS_VERSION="v3.1.0" -DEFAULT_TOKEN_BRIDGE_VERSION="ha/fix-missing-network-props" +DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.5" # Set default versions if not overriden by provided env vars : ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION} From b7ccba42bb3f4c8b995bfbc283e1a0974cff76fe Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:10:01 -0700 Subject: [PATCH 7/8] add flags for l2 and l3 traffic --- test-node.bash | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/test-node.bash b/test-node.bash index 4aa8aa74..a685c418 100755 --- a/test-node.bash +++ b/test-node.bash @@ -70,6 +70,10 @@ build_utils=false force_build_utils=false build_node_images=false +# Create some traffic on L2 and L3 so blocks are reliably produced +l2_traffic=true +l3_traffic=true + while [[ $# -gt 0 ]]; do case $1 in --init) @@ -280,6 +284,14 @@ while [[ $# -gt 0 ]]; do simple=false shift ;; + --no-l2-traffic) + l2_traffic=false + shift + ;; + --no-l3-traffic) + l3_traffic=false + shift + ;; *) echo Usage: $0 \[OPTIONS..] echo $0 script [SCRIPT-ARGS] @@ -306,6 +318,8 @@ while [[ $# -gt 0 ]]; do 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-l2-traffic disables L2 spam transaction traffic (default: enabled) + echo --no-l3-traffic disables L3 spam transaction traffic (default: enabled) echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer echo --build-dev-nitro rebuild dev nitro docker image echo --no-build-dev-nitro don\'t rebuild dev nitro docker image @@ -590,6 +604,12 @@ if $force_init; then docker compose run scripts send-l1 --ethamount 1 --to address_0x0000000000000000000000000000000000000000 --wait docker compose run scripts send-l2 --ethamount 1 --to address_0x0000000000000000000000000000000000000000 --wait + if $l2_traffic; then + echo == create l2 traffic + docker compose run scripts send-l2 --ethamount 100 --to user_traffic_generator --wait + docker compose run scripts send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 500 --times 1000000 > /dev/null & + fi + if $l3node; then echo == Funding l3 users docker compose run scripts send-l2 --ethamount 1000 --to validator --wait @@ -604,10 +624,6 @@ if $force_init; then docker compose run scripts send-l1 --ethamount 100 --to user_fee_token_deployer --wait docker compose run scripts send-l2 --ethamount 100 --to user_fee_token_deployer --wait - echo == create l2 traffic - docker compose run scripts send-l2 --ethamount 100 --to user_traffic_generator --wait - docker compose run scripts send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 500 --times 1000000 > /dev/null & - echo == Writing l3 chain config l3owneraddress=`docker compose run scripts print-address --account l3owner | tail -n 1 | tr -d '\r\n'` echo l3owneraddress $l3owneraddress @@ -671,10 +687,11 @@ if $force_init; then echo == Deploy Stylus Deployer on L3 docker compose run scripts create-stylus-deployer --deployer l3owner --l3 - - echo == create l3 traffic - docker compose run scripts send-l3 --ethamount 10 --to user_traffic_generator --wait - docker compose run scripts send-l3 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 5000 --times 1000000 > /dev/null & + if $l3_traffic; then + echo == create l3 traffic + docker compose run scripts send-l3 --ethamount 10 --to user_traffic_generator --wait + docker compose run scripts send-l3 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 5000 --times 1000000 > /dev/null & + fi fi fi From e148d9afe1866b3b2338de1f1f426dce71ada836 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:29:33 -0700 Subject: [PATCH 8/8] syntax fix --- test-node.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index a685c418..03d6d530 100755 --- a/test-node.bash +++ b/test-node.bash @@ -318,8 +318,8 @@ while [[ $# -gt 0 ]]; do 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-l2-traffic disables L2 spam transaction traffic (default: enabled) - echo --no-l3-traffic disables L3 spam transaction traffic (default: enabled) + echo --no-l2-traffic disables L2 spam transaction traffic \(default: enabled\) + echo --no-l3-traffic disables L3 spam transaction traffic \(default: enabled\) echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer echo --build-dev-nitro rebuild dev nitro docker image echo --no-build-dev-nitro don\'t rebuild dev nitro docker image @@ -687,6 +687,7 @@ if $force_init; then echo == Deploy Stylus Deployer on L3 docker compose run scripts create-stylus-deployer --deployer l3owner --l3 + if $l3_traffic; then echo == create l3 traffic docker compose run scripts send-l3 --ethamount 10 --to user_traffic_generator --wait