Skip to content

Commit 343455c

Browse files
author
Roberto Bayardo
authored
update rollup config flags to match optimism's recommendations (#139)
1 parent 9138035 commit 343455c

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

.env.goerli

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ OP_NODE_RPC_ADDR=0.0.0.0
2828
OP_NODE_RPC_PORT=8545
2929
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log
3030
OP_NODE_VERIFIER_L1_CONFS=4
31+
OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true
3132

3233
# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node
3334
# is fully trusted. It also allows op-node to work with clients such as Erigon that do not

.env.mainnet

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ OP_NODE_RPC_ADDR=0.0.0.0
2828
OP_NODE_RPC_PORT=8545
2929
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log
3030
OP_NODE_VERIFIER_L1_CONFS=4
31+
OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true
3132

3233
# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node
3334
# is fully trusted. It also allows op-node to work with clients such as Erigon that do not

.env.sepolia

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ OP_NODE_RPC_ADDR=0.0.0.0
2828
OP_NODE_RPC_PORT=8545
2929
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log
3030
OP_NODE_VERIFIER_L1_CONFS=4
31+
OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true
3132

3233
# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node
3334
# is fully trusted. It also allows op-node to work with clients such as Erigon that do not

geth-entrypoint

+7-18
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ set -eu
33

44
VERBOSITY=${GETH_VERBOSITY:-3}
55
GETH_DATA_DIR=/data
6-
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata"
7-
OP_GETH_GENESIS_FILE_PATH="${OP_GETH_GENESIS_FILE_PATH:-/genesis.json}"
8-
CHAIN_ID=$(jq -r .config.chainId < "$OP_GETH_GENESIS_FILE_PATH")
96
RPC_PORT="${RPC_PORT:-8545}"
107
WS_PORT="${WS_PORT:-8546}"
118
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}"
@@ -14,18 +11,13 @@ HOST_IP="0.0.0.0"
1411
P2P_PORT="${P2P_PORT:-30303}"
1512
ADDITIONAL_ARGS=""
1613

17-
mkdir -p $GETH_DATA_DIR
18-
19-
if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
20-
echo "$GETH_CHAINDATA_DIR missing, running init"
21-
echo "Initializing genesis."
22-
./geth --verbosity="$VERBOSITY" init \
23-
--datadir="$GETH_DATA_DIR" \
24-
"$OP_GETH_GENESIS_FILE_PATH"
25-
else
26-
echo "$GETH_CHAINDATA_DIR exists."
14+
if [[ -z "$OP_NODE_NETWORK" ]]; then
15+
echo "expected OP_NODE_NETWORK to be set" 1>&2
16+
exit 1
2717
fi
2818

19+
mkdir -p $GETH_DATA_DIR
20+
2921
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
3022

3123
if [ "${OP_GETH_ETH_STATS+x}" = x ]; then
@@ -36,10 +28,6 @@ if [ "${OP_GETH_ALLOW_UNPROTECTED_TXS+x}" = x ]; then
3628
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rpc.allow-unprotected-txs=$OP_GETH_ALLOW_UNPROTECTED_TXS"
3729
fi
3830

39-
if [ "${OP_NODE_NETWORK+x}" = x ]; then
40-
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --op-network=$OP_NODE_NETWORK --rollup.superchain-upgrades"
41-
fi
42-
4331
exec ./geth \
4432
--datadir="$GETH_DATA_DIR" \
4533
--verbosity="$VERBOSITY" \
@@ -66,7 +54,8 @@ exec ./geth \
6654
--nodiscover \
6755
--maxpeers=100 \
6856
--nat=extip:$HOST_IP \
69-
--networkid="$CHAIN_ID" \
7057
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \
58+
--rollup.halt=major \
59+
--op-network=$OP_NODE_NETWORK" \
7160
--port="$P2P_PORT" \
7261
$ADDITIONAL_ARGS # intentionally unquoted

op-node-entrypoint

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22
set -eu
33

4+
if [[ -z "$OP_NODE_NETWORK" ]]; then
5+
echo "expected OP_NODE_NETWORK to be set" 1>&2
6+
exit 1
7+
fi
8+
49
# wait until local geth comes up (authed so will return 401 without token)
510
until [ "$(curl -s -w '%{http_code}' -o /dev/null "${OP_NODE_L2_ENGINE_RPC//ws/http}")" -eq 401 ]; do
611
echo "waiting for geth to be ready"

0 commit comments

Comments
 (0)