smartcontracts/simple-optimism-node

Legacy containers are now run by default

Closed this issue · 3 comments

Previously there were two profiles - current and legacy.

In #117 these profiles were removed, but the legacy containers were kept

Was this intended? I assumed when removing the profiles you actually wanted to remove legacy so only the current containers were run. As now the container l2geth runs which isn't needed to run the stack (it's only needed for pre-bedrock Optimism right?)

It should automatically exit in case it's not needed (New OP chains or OP_GETH__HISTORICAL_RPC is configured).

if [ "$NETWORK_NAME" != "op-mainnet" ]; then
  echo "Stopping l2geth for a non op-mainnet chain"
  exit
fi

if [ -n "${OP_GETH__HISTORICAL_RPC+x}" ]; then
  echo "Stopping l2geth for using an external historical RPC"
  exit
fi

l2geth still needs to run if you want to do eth_call, estimate gas and debug trace on a pred-bedrock block of the Optimism Mainnet or Optimism Goerli Testnet as per docs: https://docs.optimism.io/builders/node-operators/management/configuration#legacy-geth.

Since I think l2geth is rarely used except for some kind of archival indexing use case. I have removed the profile to simplify the command.

Although, I can't think of a better way to conditionally start l2geth except let's it start and stop it from the entrypoint.

Let me know if you have better solution.

Ah ok that makes sense that it auto exits, sounds fine.