Skip to content

Commit

Permalink
Merge pull request #18 from Layr-Labs/epociask--feat-feature-guard-ei…
Browse files Browse the repository at this point in the history
…genda

feat: Introduce optional eigenda flag for feature guarding
  • Loading branch information
epociask authored Jan 8, 2025
2 parents ba45a30 + 1e67dc7 commit d0173d5
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
44 changes: 39 additions & 5 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function writeConfigs(argv: any) {
},
"node": {
"eigen-da": {
"enable": true,
"enable": false,
"rpc": "http://eigenda_proxy:4242"
},
"staker": {
Expand Down Expand Up @@ -248,6 +248,9 @@ function writeConfigs(argv: any) {
"metrics": true,
}

if (argv.eigenda) {
baseConfig.node["eigen-da"].enable = true
}

const baseConfJSON = JSON.stringify(baseConfig)

Expand All @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
19 changes: 14 additions & 5 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ batchposters=1
devprivkey=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659
l1chainid=1337
simple=true
eigenda=false
monitor=false
while [[ $# -gt 0 ]]; do
case $1 in
Expand Down Expand Up @@ -173,6 +174,10 @@ while [[ $# -gt 0 ]]; do
simple=false
shift
;;
--eigenda)
eigenda=true
shift
;;
--monitor)
prometheus=true
grafana=true
Expand Down Expand Up @@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -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'`
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d0173d5

Please sign in to comment.