From 1e67dc74e340e6e549bc5b88de914f079fdfbd22 Mon Sep 17 00:00:00 2001 From: Ethen Pociask Date: Wed, 8 Jan 2025 02:38:01 +0700 Subject: [PATCH] feat: Introduce optional eigenda flag for triggering integration --- scripts/config.ts | 44 +++++++++++++++++++++++++++++++++++++++----- test-node.bash | 19 ++++++++++++++----- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index a986103..feb7080 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -165,7 +165,7 @@ function writeConfigs(argv: any) { }, "node": { "eigen-da": { - "enable": true, + "enable": false, "rpc": "http://eigenda_proxy:4242" }, "staker": { @@ -248,6 +248,9 @@ function writeConfigs(argv: any) { "metrics": true, } + if (argv.eigenda) { + baseConfig.node["eigen-da"].enable = true + } const baseConfJSON = JSON.stringify(baseConfig) @@ -264,6 +267,7 @@ function writeConfigs(argv: any) { simpleConfig.execution["sequencer"].enable = true fs.writeFileSync(path.join(consts.configpath, "sequencer_config.json"), JSON.stringify(simpleConfig)) } else { + console.log("regular") let validatorConfig = JSON.parse(baseConfJSON) validatorConfig.node.staker.enable = true validatorConfig.node.staker["use-smart-contract-wallet"] = true @@ -354,11 +358,16 @@ function writeL2ChainConfig(argv: any) { "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, "InitialArbOSVersion": 32, - "EigenDA": true, + "EigenDA": false, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } } + + if (argv.eigenda) { + l2ChainConfig.arbitrum.EigenDA = true + } + const l2ChainConfigJSON = JSON.stringify(l2ChainConfig) fs.writeFileSync(path.join(consts.configpath, "l2_chain_config.json"), l2ChainConfigJSON) } @@ -389,10 +398,15 @@ function writeL3ChainConfig(argv: any) { "DataAvailabilityCommittee": false, "InitialArbOSVersion": 32, "InitialChainOwner": argv.l2owner, - "EigenDA": true, + "EigenDA": false, "GenesisBlockNum": 0 } } + + if (argv.eigenda) { + l3ChainConfig.arbitrum.EigenDA = true + } + const l3ChainConfigJSON = JSON.stringify(l3ChainConfig) fs.writeFileSync(path.join(consts.configpath, "l3_chain_config.json"), l3ChainConfigJSON) } @@ -406,8 +420,14 @@ export const writeConfigCommand = { describe: "simple config (sequencer is also poster, validator)", default: false, }, - }, - handler: (argv: any) => { + eigenda:{ + boolean: true, + default: false, + describe: "config with EigenDA enabled", + }, + }, + + handler: (argv: any) => { writeConfigs(argv) } } @@ -431,6 +451,13 @@ export const writeGethGenesisCommand = { export const writeL2ChainConfigCommand = { command: "write-l2-chain-config", describe: "writes l2 chain config file", + builder: { + eigenda:{ + boolean: true, + default: false, + describe: "config with EigenDA enabled", + }, + }, handler: (argv: any) => { writeL2ChainConfig(argv) } @@ -439,6 +466,13 @@ export const writeL2ChainConfigCommand = { export const writeL3ChainConfigCommand = { command: "write-l3-chain-config", describe: "writes l3 chain config file", + builder: { + eigenda:{ + boolean: true, + default: false, + describe: "config with EigenDA enabled", + }, + }, handler: (argv: any) => { writeL3ChainConfig(argv) } diff --git a/test-node.bash b/test-node.bash index f1fbd20..2ac3bdc 100755 --- a/test-node.bash +++ b/test-node.bash @@ -53,6 +53,7 @@ batchposters=1 devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 l1chainid=1337 simple=true +eigenda=false monitor=false while [[ $# -gt 0 ]]; do case $1 in @@ -173,6 +174,10 @@ while [[ $# -gt 0 ]]; do simple=false shift ;; + --eigenda) + eigenda=true + shift + ;; --monitor) prometheus=true grafana=true @@ -202,6 +207,7 @@ while [[ $# -gt 0 ]]; do echo --no-tokenbridge don\'t build or launch tokenbridge echo --no-run does not launch nodes \(useful with build or init\) echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer + echo --eigenda run using EigenDA for data availability echo --monitor start Prometheus, Loki, Promtail and Grafana server echo echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help @@ -225,7 +231,10 @@ if $dev_build_blockscout; then fi fi -NODES="eigenda_proxy" +if $eigenda; then + NODES="eigenda_proxy" +fi + NODES="$NODES sequencer" INITIAL_SEQ_NODES="sequencer" @@ -370,7 +379,7 @@ if $force_init; then 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 --l2owner $l2ownerAddress write-l2-chain-config + docker compose run scripts --l2owner $l2ownerAddress write-l2-chain-config --eigenda $eigenda 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'` @@ -382,10 +391,10 @@ if $force_init; then if $simple; then echo == Writing configs - docker compose run scripts write-config --simple + docker compose run scripts write-config --simple --eigenda $eigenda else echo == Writing configs - docker compose run scripts write-config + docker compose run scripts write-config --eigenda $eigenda echo == Initializing redis docker compose up --wait redis @@ -430,7 +439,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 --eigenda $eigenda if $l3_custom_fee_token; then echo == Deploying custom fee token