Legacy Geth (Documentation Index
Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
Use this file to discover all available pages before exploring further.
l2geth) is required only for upgraded networks like OP Mainnet to serve historical execution traces from before the Bedrock upgrade.
If you’re running a node that had a chain genesis after the Bedrock upgrade, you do not need Legacy Geth.
Historical execution vs. historical data routing
Only requests for historical execution will be routed to Legacy Geth. Everything else will be served byop-geth directly.
The term historical execution refers to RPC methods that need to execute transactions prior to bedrock (not just read data from the database):
eth_calleth_estimateGasdebug_traceBlockByNumberdebug_traceBlockByHashdebug_traceCalldebug_traceTransaction
What is Legacy Geth?
Legacy Geth is the oldl2geth binary running against a preconfigured data directory.
It serves historical execution data from before the Bedrock upgrade.
Setup
1. Download the preconfigured data directory
Download and extract the Legacy Geth data directory, which is available at datadirs.optimism.io.2. Configure Legacy Geth
Run Legacy Geth with the minimum required configuration:3. Configure op-geth to route to Legacy Geth
Update your op-geth configuration to route historical requests to Legacy Geth:--rollup.historicalrpc flag tells op-geth where to route requests for historical execution.
Environment variables
Legacy Geth accepts the following environment variables:| Variable | Description | Default |
|---|---|---|
USING_OVM | Required. Enables OVM mode | N/A (must be set to true) |
ETH1_SYNC_SERVICE_ENABLE | Enables L1 sync service | true (set to false for read-only) |
RPC_API | Enabled RPC APIs | eth,net,web3 |
RPC_ADDR | RPC listening address | localhost |
RPC_CORS_DOMAIN | CORS domains | localhost |
RPC_ENABLE | Enable RPC server | false |
RPC_PORT | RPC port | 8545 |
RPC_VHOSTS | Virtual hosts | localhost |
Historical execution vs. historical data
Only requests for historical execution will be routed to Legacy Geth. Everything else will be served by op-geth directly.Historical execution RPC methods
These methods require transaction execution and are routed to Legacy Geth for pre-Bedrock blocks:eth_calleth_estimateGasdebug_traceBlockByNumberdebug_traceBlockByHashdebug_traceCalldebug_traceTransaction
Historical data RPC methods
These methods only read data from the database and are served by op-geth:eth_getBlockByNumbereth_getBlockByHasheth_getTransactionByHasheth_getTransactionReceipteth_getLogs
Troubleshooting
Legacy Geth won’t start
Problem:l2geth panics or returns errors on startup
Solution: Ensure USING_OVM=true is set in your environment variables
Invalid execution traces
Problem: Legacy Geth returns invalid or incorrect trace data Solution: Verify thatUSING_OVM=true is set and the data directory is complete and uncorrupted
op-geth not routing to Legacy Geth
Problem: Historical execution requests are not being routed to Legacy Geth Solution: Check that--rollup.historicalrpc is set on op-geth with the correct URL to Legacy Geth