From 962d6c048ebdbd92a7b9aaf5c798307d565ace54 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Mon, 17 Jun 2024 14:24:43 +0200 Subject: [PATCH 1/4] 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 caa897c8a77bb9a4ac3b2330c6c28bd5b66a5a45 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Tue, 18 Jun 2024 09:29:10 +0200 Subject: [PATCH 2/4] 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 3/4] 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 4/4] 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