optimism icon indicating copy to clipboard operation
optimism copied to clipboard

debug_traceBlockByHash takes a lot of time to get traces and times out

Open aditya17cb opened this issue 3 years ago • 1 comments

Describe the bug Hello, I am an engineer at Coinbase working on getting Optimism traces for our service. We are seeing a lot of timeouts when calling debug_traceBlockByHash method and it takes a lot of time to get the data. Is this a known issue? And is there any fix for this to speed up the process of getting the traces.

For context, I am using Quicknode to get the Optimism data.

aditya17cb avatar Nov 03 '22 14:11 aditya17cb

@aditya17cb maybe you can try jsvisa/optimism-l2geth:v0.2 this docker image, FYI https://github.com/ethereum-optimism/optimism/pull/3097

jsvisa avatar Jan 08 '23 13:01 jsvisa

I've been able to resolve this by doing the following:

  1. Add 'timeout' param to the RPC call. Example: {"jsonrpc":"2.0", "method":"^Cbug_traceTransaction", "params":["0xa97067dd04cf7ab72a11c56af7506e16b0b70a6b0131840c7221e1aad05ba753", {"timeout":"120s", "tracer": "callTracer"}], "id":1}

  2. Configure the node to have extended read and idle timeouts:

  • create a directory (e.g. configs) and create a file called l2geth.toml that has the following: [Node.HTTPTimeouts] ReadTimeout = 120000000000 WriteTimeout = 30000000000 IdleTimeout = 120000000000

  • modify the docker-compose.yml to mount the directory as a volume called /configs/

  • modify the l2geth-start.sh script to have a new option called --configs=/configs/l2geth.toml

wwhchung avatar May 23 '23 16:05 wwhchung