OffchainLabs / nitro

Nitro goes vroom and fixes everything
Other
701 stars 394 forks source link

Method handler crashed for debug methods #2450

Open SMihai97 opened 4 days ago

SMihai97 commented 4 days ago

Describe the bug The node panics when trying to use debug_* methods, I've only identified debug_traceBlockByHash because someone reported it, there could be more.

To Reproduce Example request: curl localhost:8545 -X POST -H "Content-Type: application/json" --data '{"id": 9513, "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": ["0x4a574d301f31b516b8f5f46547b4a81fbd37ea68a6f08f794c331ef2902b5b3b", {"tracer": "prestateTracer", "tracerConfig": {"onlyTopCall": false, "diffMode": true}, "timeout": null}]}' Output: {"jsonrpc":"2.0","id":9513,"error":{"code":-32603,"message":"method handler crashed"}}

Expected behavior The method to return a non-error response

Additional context Here is the stack-trace: https://gist.github.com/SMihai97/a664ef8786c9b69ee41cc2c3b39bda2e

Nitro version:

nitro --version
Version: v3.0.2-9efbc16, time: 2024-06-17T14:34:39-06:00

The node is running as a systemd unit, here is the command:

ExecStart=nitro \
    --init.url="https://snapshot.arbitrum.foundation/sepolia/nitro-archive.tar" \
    --parent-chain.connection.url <url> \
    --parent-chain.blob-client.beacon-url <url> \
    --chain.id 421614 \
    --persistent.global-config /node/data \
    --execution.caching.archive \
    --execution.rpc.evm-timeout=60s \
    --rpc.max-batch-response-size=200000000 \
    --http.api=net,web3,eth,debug \
    --http.corsdomain=* \
    --http.addr=0.0.0.0 \
    --http.port=8545 \
    --http.vhosts=* \
    --ws.addr=0.0.0.0 \
    --ws.api=net,web3,eth,debug \
    --ws.port=8546 \
    --ws.origins=* \
    --metrics \
    --validation.wasm.allowed-wasm-module-roots /node/data/nitro-legacy/machines,/node/data/target/machines \
    --metrics-server.addr 0.0.0.0

I suspect this thing will happen on One and maybe Nova as well when the upgrade time comes, so any help to solve this issue is greatly appreciated. Thanks!

af-afk commented 2 days ago

We can reproduce this with transactions affecting Stylus contracts, affecting debug_storageRangeAt breaking, the evmdis tracer has an out of bound stack as well.