@@ -9,7 +9,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8
99# 1. authorizing validator signer key since validator wallet is buggy
1010# - gas estimation sent from 0x0000 lead to balance and permission error
1111DEFAULT_NITRO_CONTRACTS_VERSION=" v3.1.0"
12- DEFAULT_TOKEN_BRIDGE_VERSION=" v1.2.2 "
12+ DEFAULT_TOKEN_BRIDGE_VERSION=" v1.2.5 "
1313
1414# Set default versions if not overriden by provided env vars
1515: ${NITRO_CONTRACTS_BRANCH:= $DEFAULT_NITRO_CONTRACTS_VERSION }
@@ -74,6 +74,10 @@ build_utils=false
7474force_build_utils=false
7575build_node_images=false
7676
77+ # Create some traffic on L2 and L3 so blocks are reliably produced
78+ l2_traffic=true
79+ l3_traffic=true
80+
7781while [[ $# -gt 0 ]]; do
7882 case $1 in
7983 --init)
@@ -284,6 +288,14 @@ while [[ $# -gt 0 ]]; do
284288 simple=false
285289 shift
286290 ;;
291+ --no-l2-traffic)
292+ l2_traffic=false
293+ shift
294+ ;;
295+ --no-l3-traffic)
296+ l3_traffic=false
297+ shift
298+ ;;
287299 * )
288300 echo Usage: $0 \[ OPTIONS..]
289301 echo $0 script [SCRIPT-ARGS]
@@ -310,6 +322,8 @@ while [[ $# -gt 0 ]]; do
310322 echo --tokenbridge deploy L1-L2 token bridge.
311323 echo --no-tokenbridge don\' t build or launch tokenbridge
312324 echo --no-run does not launch nodes \( useful with build or init\)
325+ echo --no-l2-traffic disables L2 spam transaction traffic \( default: enabled\)
326+ echo --no-l3-traffic disables L3 spam transaction traffic \( default: enabled\)
313327 echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer
314328 echo --build-dev-nitro rebuild dev nitro docker image
315329 echo --no-build-dev-nitro don\' t rebuild dev nitro docker image
@@ -594,6 +608,12 @@ if $force_init; then
594608 run_script send-l1 --ethamount 1 --to address_0x0000000000000000000000000000000000000000 --wait
595609 run_script send-l2 --ethamount 1 --to address_0x0000000000000000000000000000000000000000 --wait
596610
611+ if $l2_traffic ; then
612+ echo == create l2 traffic
613+ run_script send-l2 --ethamount 100 --to user_traffic_generator --wait
614+ run_script send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 500 --times 1000000 > /dev/null &
615+ fi
616+
597617 if $l3node ; then
598618 echo == Funding l3 users
599619 run_script send-l2 --ethamount 1000 --to validator --wait
@@ -608,10 +628,6 @@ if $force_init; then
608628 run_script send-l1 --ethamount 100 --to user_fee_token_deployer --wait
609629 run_script send-l2 --ethamount 100 --to user_fee_token_deployer --wait
610630
611- echo == create l2 traffic
612- run_script send-l2 --ethamount 100 --to user_traffic_generator --wait
613- run_script send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 500 --times 1000000 > /dev/null &
614-
615631 echo == Writing l3 chain config
616632 l3owneraddress=` run_script print-address --account l3owner | tail -n 1 | tr -d ' \r\n' `
617633 echo l3owneraddress $l3owneraddress
@@ -649,7 +665,7 @@ if $force_init; then
649665 if $tokenbridge ; then
650666 # we deployed an L1 L2 token bridge
651667 # we need to pull out the L2 WETH address and pass it as an override to the L2 L3 token bridge deployment
652- l2Weth=` docker compose run --rm --entrypoint sh tokenbridge -c " cat l1l2_network.json" | jq -r ' .l2Network.tokenBridge.l2Weth ' `
668+ l2Weth=` docker compose run --rm --entrypoint sh tokenbridge -c " cat l1l2_network.json" | jq -r ' .l2Network.tokenBridge.childWeth ' `
653669 fi
654670 docker compose run --rm -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
655671 docker compose run --rm --entrypoint sh tokenbridge -c " cat network.json && cp network.json l2l3_network.json"
@@ -676,9 +692,11 @@ if $force_init; then
676692 echo == Deploy Stylus Deployer on L3
677693 run_script create-stylus-deployer --deployer l3owner --l3
678694
679- echo == create l3 traffic
680- run_script send-l3 --ethamount 10 --to user_traffic_generator --wait
681- run_script send-l3 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 5000 --times 1000000 > /dev/null &
695+ if $l3_traffic ; then
696+ echo == create l3 traffic
697+ run_script send-l3 --ethamount 10 --to user_traffic_generator --wait
698+ run_script send-l3 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 5000 --times 1000000 > /dev/null &
699+ fi
682700 fi
683701fi
684702
0 commit comments