Skip to content

Commit

Permalink
update rollup config flags to match optimism's recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-bayardo committed Nov 7, 2023
1 parent 5f68f89 commit dd13e20
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
1 change: 1 addition & 0 deletions .env.goerli
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ OP_NODE_RPC_ADDR=0.0.0.0
OP_NODE_RPC_PORT=8545
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log
OP_NODE_VERIFIER_L1_CONFS=4
OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true

# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node
# is fully trusted. It also allows op-node to work with clients such as Erigon that do not
Expand Down
1 change: 1 addition & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ OP_NODE_RPC_ADDR=0.0.0.0
OP_NODE_RPC_PORT=8545
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log
OP_NODE_VERIFIER_L1_CONFS=4
OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true

# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node
# is fully trusted. It also allows op-node to work with clients such as Erigon that do not
Expand Down
1 change: 1 addition & 0 deletions .env.sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ OP_NODE_RPC_ADDR=0.0.0.0
OP_NODE_RPC_PORT=8545
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log
OP_NODE_VERIFIER_L1_CONFS=4
OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true

# OP_NODE_L1_TRUST_RPC allows for faster syncing, but should be used *only* if your L1 RPC node
# is fully trusted. It also allows op-node to work with clients such as Erigon that do not
Expand Down
25 changes: 7 additions & 18 deletions geth-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ set -eu

VERBOSITY=${GETH_VERBOSITY:-3}
GETH_DATA_DIR=/data
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata"
OP_GETH_GENESIS_FILE_PATH="${OP_GETH_GENESIS_FILE_PATH:-/genesis.json}"
CHAIN_ID=$(jq -r .config.chainId < "$OP_GETH_GENESIS_FILE_PATH")
RPC_PORT="${RPC_PORT:-8545}"
WS_PORT="${WS_PORT:-8546}"
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}"
Expand All @@ -14,18 +11,13 @@ HOST_IP="0.0.0.0"
P2P_PORT="${P2P_PORT:-30303}"
ADDITIONAL_ARGS=""

mkdir -p $GETH_DATA_DIR

if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
echo "$GETH_CHAINDATA_DIR missing, running init"
echo "Initializing genesis."
./geth --verbosity="$VERBOSITY" init \
--datadir="$GETH_DATA_DIR" \
"$OP_GETH_GENESIS_FILE_PATH"
else
echo "$GETH_CHAINDATA_DIR exists."
if [[ -z "$OP_NODE_NETWORK" ]]; then
echo "expected OP_NODE_NETWORK to be set" 1>&2
exit 1
fi

mkdir -p $GETH_DATA_DIR

echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"

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

if [ "${OP_NODE_NETWORK+x}" = x ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --op-network=$OP_NODE_NETWORK --rollup.superchain-upgrades"
fi

exec ./geth \
--datadir="$GETH_DATA_DIR" \
--verbosity="$VERBOSITY" \
Expand All @@ -66,7 +54,8 @@ exec ./geth \
--nodiscover \
--maxpeers=100 \
--nat=extip:$HOST_IP \
--networkid="$CHAIN_ID" \
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \
--rollup.halt=major \
--op-network=$OP_NODE_NETWORK" \
--port="$P2P_PORT" \
$ADDITIONAL_ARGS # intentionally unquoted
5 changes: 5 additions & 0 deletions op-node-entrypoint
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -eu

if [[ -z "$OP_NODE_NETWORK" ]]; then
echo "expected OP_NODE_NETWORK to be set" 1>&2
exit 1
fi

# wait until local geth comes up (authed so will return 401 without token)
until [ "$(curl -s -w '%{http_code}' -o /dev/null "${OP_NODE_L2_ENGINE_RPC//ws/http}")" -eq 401 ]; do
echo "waiting for geth to be ready"
Expand Down

0 comments on commit dd13e20

Please sign in to comment.