Skip to content

Commit

Permalink
Fix the L3 node
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJeremyHe committed Aug 19, 2024
1 parent 9ea0c23 commit 795be6d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ services:
depends_on:
- sequencer
- validation_node
- espresso-dev-node

validation_node:
pid: host # allow debugging
Expand Down Expand Up @@ -376,6 +377,18 @@ services:
- ESPRESSO_DEV_NODE_PORT
- RUST_LOG=info
- RUST_LOG_FORMAT
- ESPRESSO_DEPLOYER_ALT_CHAIN_PROVIDERS=${ESPRESSO_DEPLOYER_ALT_CHAIN_PROVIDERS:-}
- ESPRESSO_DEPLOYER_ALT_MNEMONICS=${ESPRESSO_DEPLOYER_ALT_MNEMONICS:-}
- ESPRESSO_SEQUENCER_DEPLOYER_ALT_INDICES=${ESPRESSO_SEQUENCER_DEPLOYER_ALT_INDICES:-}
depends_on:
- geth
- sequencer
healthcheck:
test: ["CMD-SHELL", "curl -fL http://localhost:$ESPRESSO_DEV_NODE_PORT || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
extra_hosts:
- "host.docker.internal:host-gateway"

Expand Down
13 changes: 12 additions & 1 deletion scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ function writeConfigs(argv: any) {
l3Config.node["delayed-sequencer"]["use-merge-finality"] = false
l3Config.node["batch-poster"].enable = true
l3Config.node["batch-poster"]["redis-url"] = ""
if (argv.espresso) {
l3Config.execution.sequencer.espresso = true
l3Config.execution.sequencer["hotshot-url"] = argv.espressoUrl
l3Config.node.feed.output.enable = true
l3Config.node.dangerous["no-sequencer-coordinator"] = true
}
fs.writeFileSync(path.join(consts.configpath, "l3node_config.json"), JSON.stringify(l3Config))

let validationNodeConfig = JSON.parse(JSON.stringify({
Expand Down Expand Up @@ -405,6 +411,7 @@ function writeL3ChainConfig(argv: any) {
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"espresso": argv.espresso,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
Expand All @@ -422,9 +429,13 @@ function writeL3ChainConfig(argv: any) {
"DataAvailabilityCommittee": false,
"InitialArbOSVersion": 30,
"InitialChainOwner": argv.l2owner,
"GenesisBlockNum": 0
"GenesisBlockNum": 0,
"EnableEspresso": false
}
}
if (argv.espresso) {
l3ChainConfig.arbitrum.EnableEspresso = true
}
const l3ChainConfigJSON = JSON.stringify(l3ChainConfig)
fs.writeFileSync(path.join(consts.configpath, "l3_chain_config.json"), l3ChainConfigJSON)
}
Expand Down
1 change: 1 addition & 0 deletions scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async function main() {
.options({
espresso: { boolean: true, decription: 'use Espresso Sequencer for sequencing and DA', default: false },
espressoUrl: { string: true, description: 'Espresso Sequencer url', default: 'http://espresso-dev-node:41000' },
espressoUrlForL3: { string: true, description: 'Espresso Sequencer url for l3 nodes', default: 'http://espresso-dev-node-for-l3:42000' },
lightClientAddress: { string: true, description: 'address of the light client contract', default: ''},
})
.command(bridgeFundsCommand)
Expand Down
23 changes: 17 additions & 6 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ l3node=false
consensusclient=false
redundantsequencers=0
lightClientAddr=0xb6eb235fa509e3206f959761d11e3777e16d0e98
lightClientAddrForL3=0xa3365a6fb38bce1a91b4beb37e229b2a7e49562c
dev_build_nitro=false
dev_build_blockscout=false
espresso=false
l2_espresso=false
latest_espresso_image=false
l3_custom_fee_token=false
l3_token_bridge=false
Expand Down Expand Up @@ -96,6 +98,7 @@ while [[ $# -gt 0 ]]; do
--espresso)
simple=false
espresso=true
l2_espresso=true
shift
;;
--latest-espresso-image)
Expand Down Expand Up @@ -277,13 +280,19 @@ elif ! $simple; then
fi
if $l3node; then
NODES="$NODES l3node"
export ESPRESSO_DEPLOYER_ALT_CHAIN_PROVIDERS="http://sequencer:8547"
export ESPRESSO_DEPLOYER_ALT_MNEMONICS="indoor dish desk flag debris potato excuse depart ticket judge file exit"
export ESPRESSO_SEQUENCER_DEPLOYER_ALT_INDICES="5"
fi
if $blockscout; then
NODES="$NODES blockscout"
fi

if $espresso; then
if $force_build; then
if $l3node; then
l2_espresso=false
fi
if $force_build && $l2_espresso; then
INITIAL_SEQ_NODES="$INITIAL_SEQ_NODES espresso-dev-node"
else
NODES="$NODES espresso-dev-node"
Expand Down Expand Up @@ -396,9 +405,10 @@ if $force_init; then
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 $l2ownerAddress

echo == Writing l2 chain config
docker compose run scripts --l2owner $l2ownerAddress write-l2-chain-config --espresso $espresso
docker compose run scripts --l2owner $l2ownerAddress write-l2-chain-config --espresso $l2_espresso

sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'`
l2ownerKey=`docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'`
Expand All @@ -407,13 +417,14 @@ if $force_init; then
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=$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" -e LIGHT_CLIENT_ADDR=$lightClientAddr rollupcreator create-rollup-testnode
docker compose run --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_chain_info.json > /config/l2_chain_info.json"
docker compose run --entrypoint sh rollupcreator -c "cat /config/l2_chain_info.json"

if $simple; then
echo == Writing configs
docker compose run scripts write-config --simple
else
echo == Writing configs
docker compose run scripts write-config --espresso $espresso --lightClientAddress $lightClientAddr
docker compose run scripts write-config --espresso $l2_espresso --lightClientAddress $lightClientAddr

echo == Initializing redis
docker compose up --wait redis
Expand All @@ -424,7 +435,7 @@ if $force_init; then
docker compose up --wait $INITIAL_SEQ_NODES
docker compose run scripts bridge-funds --ethamount 100000 --wait
docker compose run scripts send-l2 --ethamount 10000 --to espresso-sequencer --wait
docker compose run scripts send-l2 --ethamount 100 --to l2owner --wait
docker compose run scripts send-l2 --ethamount 10000 --to l2owner --wait

if $tokenbridge; then
echo == Deploying L1-L2 token bridge
Expand Down Expand Up @@ -460,7 +471,7 @@ if $force_init; then
echo == Writing 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
docker compose run scripts --l2owner $l3owneraddress write-l3-chain-config --espresso $espresso

if $l3_custom_fee_token; then
echo == Deploying custom fee token
Expand All @@ -474,7 +485,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=$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 -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" -e LIGHT_CLIENT_ADDR=$lightClientAddrForL3 $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
Expand Down

0 comments on commit 795be6d

Please sign in to comment.