Skip to content

Commit b73bd81

Browse files
Merge branch 'release' into “sync-master-release-10-01-2025”
2 parents de528e9 + 34f0e1c commit b73bd81

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

scripts/ethcommands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ export const createERC20Command = {
411411
.toString()
412412
);
413413

414-
const l1GatewayRouter = new ethers.Contract(l1l2tokenbridge.l2Network.tokenBridge.l1GatewayRouter, L1GatewayRouter.abi, deployerWallet);
415-
await (await token.functions.approve(l1l2tokenbridge.l2Network.tokenBridge.l1ERC20Gateway, ethers.constants.MaxUint256)).wait();
414+
const l1GatewayRouter = new ethers.Contract(l1l2tokenbridge.l2Network.tokenBridge.parentGatewayRouter, L1GatewayRouter.abi, deployerWallet);
415+
await (await token.functions.approve(l1l2tokenbridge.l2Network.tokenBridge.parentErc20Gateway, ethers.constants.MaxUint256)).wait();
416416
const supply = await token.totalSupply();
417417
// transfer 90% of supply to l2
418418
const transferAmount = supply.mul(9).div(10);

test-node.bash

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1111
DEFAULT_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}
@@ -70,6 +70,10 @@ build_utils=false
7070
force_build_utils=false
7171
build_node_images=false
7272

73+
# Create some traffic on L2 and L3 so blocks are reliably produced
74+
l2_traffic=true
75+
l3_traffic=true
76+
7377
while [[ $# -gt 0 ]]; do
7478
case $1 in
7579
--init)
@@ -280,6 +284,14 @@ while [[ $# -gt 0 ]]; do
280284
simple=false
281285
shift
282286
;;
287+
--no-l2-traffic)
288+
l2_traffic=false
289+
shift
290+
;;
291+
--no-l3-traffic)
292+
l3_traffic=false
293+
shift
294+
;;
283295
*)
284296
echo Usage: $0 \[OPTIONS..]
285297
echo $0 script [SCRIPT-ARGS]
@@ -306,6 +318,8 @@ while [[ $# -gt 0 ]]; do
306318
echo --tokenbridge deploy L1-L2 token bridge.
307319
echo --no-tokenbridge don\'t build or launch tokenbridge
308320
echo --no-run does not launch nodes \(useful with build or init\)
321+
echo --no-l2-traffic disables L2 spam transaction traffic \(default: enabled\)
322+
echo --no-l3-traffic disables L3 spam transaction traffic \(default: enabled\)
309323
echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer
310324
echo --build-dev-nitro rebuild dev nitro docker image
311325
echo --no-build-dev-nitro don\'t rebuild dev nitro docker image
@@ -590,6 +604,12 @@ if $force_init; then
590604
docker compose run scripts send-l1 --ethamount 1 --to address_0x0000000000000000000000000000000000000000 --wait
591605
docker compose run scripts send-l2 --ethamount 1 --to address_0x0000000000000000000000000000000000000000 --wait
592606

607+
if $l2_traffic; then
608+
echo == create l2 traffic
609+
docker compose run scripts send-l2 --ethamount 100 --to user_traffic_generator --wait
610+
docker compose run scripts send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 500 --times 1000000 > /dev/null &
611+
fi
612+
593613
if $l3node; then
594614
echo == Funding l3 users
595615
docker compose run scripts send-l2 --ethamount 1000 --to validator --wait
@@ -604,10 +624,6 @@ if $force_init; then
604624
docker compose run scripts send-l1 --ethamount 100 --to user_fee_token_deployer --wait
605625
docker compose run scripts send-l2 --ethamount 100 --to user_fee_token_deployer --wait
606626

607-
echo == create l2 traffic
608-
docker compose run scripts send-l2 --ethamount 100 --to user_traffic_generator --wait
609-
docker compose run scripts send-l2 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 500 --times 1000000 > /dev/null &
610-
611627
echo == Writing l3 chain config
612628
l3owneraddress=`docker compose run scripts print-address --account l3owner | tail -n 1 | tr -d '\r\n'`
613629
echo l3owneraddress $l3owneraddress
@@ -645,7 +661,7 @@ if $force_init; then
645661
if $tokenbridge; then
646662
# we deployed an L1 L2 token bridge
647663
# we need to pull out the L2 WETH address and pass it as an override to the L2 L3 token bridge deployment
648-
l2Weth=`docker compose run --entrypoint sh tokenbridge -c "cat l1l2_network.json" | jq -r '.l2Network.tokenBridge.l2Weth'`
664+
l2Weth=`docker compose run --entrypoint sh tokenbridge -c "cat l1l2_network.json" | jq -r '.l2Network.tokenBridge.childWeth'`
649665
fi
650666
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
651667
docker compose run --entrypoint sh tokenbridge -c "cat network.json && cp network.json l2l3_network.json"
@@ -672,9 +688,11 @@ if $force_init; then
672688
echo == Deploy Stylus Deployer on L3
673689
docker compose run scripts create-stylus-deployer --deployer l3owner --l3
674690

675-
echo == create l3 traffic
676-
docker compose run scripts send-l3 --ethamount 10 --to user_traffic_generator --wait
677-
docker compose run scripts send-l3 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 5000 --times 1000000 > /dev/null &
691+
if $l3_traffic; then
692+
echo == create l3 traffic
693+
docker compose run scripts send-l3 --ethamount 10 --to user_traffic_generator --wait
694+
docker compose run scripts send-l3 --ethamount 0.0001 --from user_traffic_generator --to user_traffic_generator --wait --delay 5000 --times 1000000 > /dev/null &
695+
fi
678696
fi
679697
fi
680698

0 commit comments

Comments
 (0)